Default constants in any gcc compiler
I’ve always wondered what default constants (#ifdefs) are used in the gcc compiler, without having to look on the internet for it. A quick command to show this is:
echo "" | gcc -E -dM -c - | less -S
This will output a listing as follows:
#define __DBL_MIN_EXP__ (-1021) #define __FLT_MIN__ 1.17549435e-38F #define _WIN32 1 #define __CHAR_BIT__ 8 #define __WCHAR_MAX__ 65535U #define __DBL_DENORM_MIN__ 4.9406564584124654e-324 #define __FLT_EVAL_METHOD__ 2 #define __DBL_MIN_10_EXP__ (-307) #define __FINITE_MATH_ONLY__ 0 #define __GNUC_PATCHLEVEL__ 0 #define _stdcall __attribute__((__stdcall__))
… and lots more. This command was executed under MinGW/MSYS. I had to look for the correct #ifdef to check whether I am compiling some C++ source code under Windows, or Linux.
