diff options
Diffstat (limited to 'test/pp.c')
| -rw-r--r-- | test/pp.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -8,6 +8,11 @@ #define CATr(a) foo##a #define CAT(a,b) a##b +#define hash_hash # ## # +#define mkstr(a) # a +#define in_between(a) mkstr(a) +#define join(c, d) in_between(c hash_hash d) +char p[] = join(x, y); // equivalent to char p[] = "x ## y"; int main(void) @@ -20,5 +25,7 @@ main(void) 05.5), STR(ADD(1,2))); hi(ADD(Foo, SQR(Bar+1))); int foo123 = 77; - printf("%s %s %g\n", str(Foo,5), xstr(Foo), CAT(1.5,e3f) + CAT(7,)-CAT(1,)); + printf("%s %s %g\n", str(Foo,5), xstr(Foo), CAT(1.5,e3f) + CAT(7,)-CAT(,1)); + printf("join: \"%s\"\n", p); + CAT(ret,urn) 0; } |