From a20356952bb4447d5df5d01f4023f7f125b6c2b8 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 19 Mar 2014 17:52:54 +0900 Subject: [PATCH] refactor GENSYM macro --- include/picrin/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/picrin/util.h b/include/picrin/util.h index f5971832..3475caae 100644 --- a/include/picrin/util.h +++ b/include/picrin/util.h @@ -20,12 +20,12 @@ extern "C" { #define FALLTHROUGH ((void)0) #define UNUSED(v) ((void)(v)) -#define GENSYM2__(x,y) x##y +#define GENSYM2__(x,y) G##x##_##y##__ #define GENSYM1__(x,y) GENSYM2__(x,y) #if defined(__COUNTER__) -# define GENSYM(x) GENSYM1__(x,__COUNTER__) +# define GENSYM(x) GENSYM1__(__COUNTER__,x) #else -# define GENSYM(x) GENSYM1__(x,__LINE__) +# define GENSYM(x) GENSYM1__(__LINE__,x) #endif #if __GNUC__ || __clang__