refactor GENSYM macro

This commit is contained in:
Yuichi Nishiwaki 2014-03-19 17:52:54 +09:00
parent 0b7597b80b
commit a20356952b
1 changed files with 3 additions and 3 deletions

View File

@ -20,12 +20,12 @@ extern "C" {
#define FALLTHROUGH ((void)0) #define FALLTHROUGH ((void)0)
#define UNUSED(v) ((void)(v)) #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) #define GENSYM1__(x,y) GENSYM2__(x,y)
#if defined(__COUNTER__) #if defined(__COUNTER__)
# define GENSYM(x) GENSYM1__(x,__COUNTER__) # define GENSYM(x) GENSYM1__(__COUNTER__,x)
#else #else
# define GENSYM(x) GENSYM1__(x,__LINE__) # define GENSYM(x) GENSYM1__(__LINE__,x)
#endif #endif
#if __GNUC__ || __clang__ #if __GNUC__ || __clang__