macro6.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 33 行

C
33
字号
/* { dg-do run } *//* Test that, when a macro expansion spills into the source file, we   expand macros we suck in from there, as the standard clearly states   they are not nested.   Submitter: Neil Booth, with minor modifications to the originals. 3   Dec 2000.   Source: PR 962 and Thomas Pornin.  */extern void abort (void);int e = 10, f = 100;#define e(n) 4 + n#define X e#define f(x) x#define h(x) x + fintmain (){  if (X(X) != 14)		/* Should expand to "4 + e".  */    abort ();  if (X(X(f)) != 108)		/* Should expand to "4 + 4 + f".  */    abort ();  if (h(e)(h(e)) != 120)	/* Should expand to "e + e + f".  */    abort ();  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?