$ echo '__FreeBSD__ ' | gcc -E - # 1 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "<stdin>" __FreeBSD__ <== no replacement --> no macro defined $ echo '__linux__ ' | gcc -E - # 1 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "<stdin>" 1 <== replacement --> macro defined
C Macro Test with GCC
Leave a reply