1.gcc查看默认开启的宏
gcc -dM -E - </dev/null
https://stackoverflow.com/questions/2295479/can-i-see-defined-macros-during-compilation-of-a-c-code
https://stackoverflow.com/questions/9025708/mingw-not-defining-win32-error-in-preprocessor-directives
https://stackoverflow.com/questions/18867367/using-avx-with-gcc-builtin-ia32-addpd256-not-declared
2. cl查看默认开启的宏
/* MyC1.c */
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *p;
if ((p = getenv("MSC_CMD_FLAGS")) != NULL)
printf("MSC_CMD_FLAGS:\n%s\n", p);
if ((p = getenv("MSC_IDE_FLAGS")) != NULL)
printf("MSC_IDE_FLAGS:\n%s\n", p);
return EXIT_FAILURE;
}
cl /B1MyC1.exe AnyNameHere.c
cl /BxMyC1.exe AnyNameHere.cpp
https://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros