From f61781a7d9749c4b5ccf79a24777653a8f9fa4e5 Mon Sep 17 00:00:00 2001 From: asterix Date: Mon, 26 Jul 2010 14:02:05 +0000 Subject: [PATCH] Fix count params macro. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4068 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/compiler.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bertos/cfg/compiler.h b/bertos/cfg/compiler.h index 07f4f141..3426cd06 100644 --- a/bertos/cfg/compiler.h +++ b/bertos/cfg/compiler.h @@ -80,14 +80,21 @@ #define COUNT_PARMS(...) \ COUNT_PARMS2(11 , ## __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) - #define FN_ARGS ... + /** + * usage: + * #define foo_init(...) PP_CAT(foo_init_, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__) + */ #else #define COUNT_PARMS2(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _, ...) _ #define COUNT_PARMS(args...) \ COUNT_PARMS2(11 , ## args, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) - #define FN_ARGS args... + /** + * usage: + * #define foo_init(args...) PP_CAT(foo_init_, COUNT_PARMS(args)) (args) + */ + #endif #if defined(__IAR_SYSTEMS_ICC) || defined(__IAR_SYSTEMS_ICC__) -- 2.25.1