diff options
Diffstat (limited to 'newlib/libc/include/sys/cdefs.h')
-rw-r--r-- | newlib/libc/include/sys/cdefs.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index f0b6a27b4..e3298efaf 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -58,6 +58,27 @@ #define __DOTS , ... #define __THROW +/* + * The __CONCAT macro is used to concatenate parts of symbol names, e.g. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI + * mode -- there must be no spaces between its arguments, and for nested + * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also + * concatenate double-quoted strings produced by the __STRING macro, but + * this only works with ANSI C. + * + * __XSTRING is like __STRING, but it expands any macros in its argument + * first. It is only available with ANSI C. + */ +#define __CONCAT1(x,y) x ## y +#define __CONCAT(x,y) __CONCAT1(x,y) +#define __STRING(x) #x /* stringify without expanding x */ +#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ + +#ifdef __GNUC__ +# define __ASMNAME(cname) __XSTRING (__USER_LABEL_PREFIX__) cname +#endif + #define __ptr_t void * #define __long_double_t long double |