December, 2011

  • December 7, 2011

    All C/C++ compilers predefine macros indicating the target processor, operating system, language features, compiler name and version, and more. Cross-platform code can use #if/#endif to wrap OS-specific #includes (such as <Windows.h> vs. <unistd.h>), compiler-specific code (such as inline assembly), or processor-specific optimizations (such as SSE instructions on x86). Macro names are not standardized and nor are methods to get the compiler to list them. This article surveys common desktop and server application compilers and shows how to list their predefined macros.

Syndicate content
Nadeau software consulting
Nadeau software consulting