add gensym macro

This commit is contained in:
Yuichi Nishiwaki 2014-02-01 15:40:43 +09:00
parent 5080294472
commit c789200f5b
1 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,14 @@ extern "C" {
#define FALLTHROUGH ((void)0)
#define UNUSED(v) ((void)(v))
#define GENSYM2__(x,y) x##y
#define GENSYM1__(x,y) GENSYM2__(x,y)
#if defined(__COUNTER__)
# define GENSYM(x) GENSYM1__(x,__COUNTER__)
#else
# define GENSYM(x) GENSYM1__(x,__LINE__)
#endif
#include "config.h"
#include "picrin/value.h"