Cross Reference: 039-func-arg-obj-macro-with-comma.c
xref: /xsrc/external/mit/MesaLib.old/dist/src/compiler/glsl/glcpp/tests/039-func-arg-obj-macro-with-comma.c
  • Home
  • History
  • AnnotateAnnotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /xsrc/external/mit/MesaLib.old/dist/src/compiler/glsl/glcpp/tests/
1b8e80941Smrg/* This works. */
2b8e80941Smrg#define foo(a) (a)
3b8e80941Smrg#define bar two,words
4b8e80941Smrgfoo(bar)
5b8e80941Smrg
6b8e80941Smrg/* So does this. */
7b8e80941Smrg#define foo2(a,b) (a separate b)
8b8e80941Smrg#define foo2_wrap(a) foo2(a)
9b8e80941Smrgfoo2_wrap(bar)
10b8e80941Smrg
11b8e80941Smrg/* But this generates an error. */
12b8e80941Smrg#define foo_wrap(a) foo(a)
13b8e80941Smrgfoo_wrap(bar)
14b8e80941Smrg
15b8e80941Smrg/* Adding parentheses to foo_wrap fixes it. */
16b8e80941Smrg#define foo_wrap_parens(a) foo((a))
17b8e80941Smrgfoo_wrap_parens(bar)
18b8e80941Smrg
19b8e80941Smrg/* As does adding parentheses to bar */
20b8e80941Smrg#define bar_parens (two,words)
21b8e80941Smrgfoo_wrap(bar_parens)
22b8e80941Smrgfoo_wrap_parens(bar_parens)
23b8e80941Smrg
24b8e80941Smrg
25

Indexes created Mon Dec 01 00:09:28 GMT 2025