diff options
| author | 2025-09-10 11:19:16 +0200 | |
|---|---|---|
| committer | 2025-09-10 11:19:16 +0200 | |
| commit | 45591bc221bb8268567acdaa523cbac94d31a90e (patch) | |
| tree | 4e992ea4822af8313bd6ce02a574c6e20ad690f6 /test | |
| parent | 59c9eb2a0766bdb7b1c1b1a2045f5381111771e5 (diff) | |
lex: implement basic function-like macro functionality
Diffstat (limited to 'test')
| -rw-r--r-- | test/pp.c | 3 | ||||
| -rw-r--r-- | test/pp.h | 12 |
2 files changed, 9 insertions, 6 deletions
@@ -5,6 +5,5 @@ int main(void) { - hi(); - return Foo + Bar; + hi(ADD(Foo, SQR(Bar+1))); } @@ -3,12 +3,16 @@ extern warnhere(); #define Foo 9 -void hi() { - extern int printf(); - printf("hi from header\n"); +void hi(int x) { + extern int printf(const char *, ...); + printf("hi from header ;%d\n", x); } - +#if 1 +#endif #elifndef Ww #define Bar 7 +#define SQR_(x) (x)*(x) +#define SQR(y) SQR_(y) +#define ADD(a,b) (a)+(b) #endif |