T
Trent Buck
I'm trying to find CPP predicates that allow conditional compilation
based on the compiler's standard / features / extensions. So far I have
determined that, for GCC,
- __STRICT_ANSI__ implies -ansi.
- ! __STDC_VERSION__ implies -std=c89 or -std=gnu89.
- 199409 == __STDC_VERSION__ implies -stdc=iso9899:199409.
- 199901 == __STDC_VERSION__ implies -std=c99 or -std=gnu99.
I'd like to be able to
- distinguish between cXX and gnuXX (i.e. are there extensions?).
- check support for variadic macros.
- check support for statement expressions.
- check support for the typeof operator
Can it be done? I don't want to take the autoconf route of attempting
to compile test programs. I currently only care about GCC, and maybe
Solaris.
Thanks in advance,
-trent
based on the compiler's standard / features / extensions. So far I have
determined that, for GCC,
- __STRICT_ANSI__ implies -ansi.
- ! __STDC_VERSION__ implies -std=c89 or -std=gnu89.
- 199409 == __STDC_VERSION__ implies -stdc=iso9899:199409.
- 199901 == __STDC_VERSION__ implies -std=c99 or -std=gnu99.
I'd like to be able to
- distinguish between cXX and gnuXX (i.e. are there extensions?).
- check support for variadic macros.
- check support for statement expressions.
- check support for the typeof operator
Can it be done? I don't want to take the autoconf route of attempting
to compile test programs. I currently only care about GCC, and maybe
Solaris.
Thanks in advance,
-trent