[ Borland C++ ] [ Microsoft Visual C++ ] [ GNU gcc/gpp ] [ MinGW(gcc for windows) ] [ DJGPP (gcc for DOS) ] [ Linux gcc ]
#if !defined(_WIN64) ...//win9x code #endif
Borland C++
- __BORLANDC__
- __cplusplus (only if compiling a C++ file or forcing C++ compilation [
-P]) - __STDC__
Microsoft Visual C++
- _MSC_VER
- _MSC_EXTENSIONS (don't know what this is for)
- __cplusplus (only if compiling a C++ file or forcing C++ compilation [
/Tpor/TP]) - _WIN64 (only if target is 64-bit)
- __STDC__
MSVC definitions (without documentation)
GNU gcc/gpp (includes djgpp, MinGW)
- __GNUC__
- __cplusplus (only if compiling with
g++/gppor compiling withgcc -x c++) - _WIN64 (only if target is 64-bit)
- __STDC__
MinGW (gcc for windows)
- __GNUC__
- __MINGW32__ (this is regardless of 32 or 64-bit)
- __cplusplus (only if compiling with
g++or compiling withgcc -x c++) - _WIN64 (only if target is 64-bit)
- __STDC__
- __MINGW64_VERSION_MAJOR
- __MINGW64_VERSION_MINOR
MinGW is a 32-bit compiler and mingw-w64 is a 32/64-bit gnu compiler set for windows which includes gnat, ada, g77(fortran77), java, and I am sure I am missing the others if there are any. MSYS is a companion set of UNIX build tools for windows and a BASH shell. The version of gcc is now at version 3.4.5 gor mingw and 4.4.5 for mingw-w64 as of 10/17/2010.
packing pragmas (how to make sure there are no holes/gaps in your structures during execution).
DJGPP (gcc for DOS)
- __GNUC__
- __DJGPP__
- __MSDOS__
- __GO32__
- __cplusplus (only if compiling with
gppor compiling withgcc -x c++) - __STDC__
DJGPP is a 32-bit gnu compiler set for MSDOS/FreeDOS which includes gnat, ada, g77(fortran77), java, and I am sure I am missing the others if there are any. It includes a companion set of UNIX build tools for DOS and a bourne shell and emacs and a programmer's IDE. The version of gcc is now at version 4.3.2.
Linux gcc
check this article before using the LINUX #define! I do not know any more than this about building for linux. I know each distribution is different and potentially has different #defines for it.
- LINUX (only if defined in makefile.am)
- __GNUC__
- __cplusplus (only if compiling with
g++/gppor compiling withgcc -x c++) - __STDC__
32/64-bit gnu compiler set for linux (just download and compile the source tarball from ftp.gnu.org) which includes gnat, ada, g77(fortran77), java, and I am sure I am missing the others if there are any. You get the latest of everything you want with linux gnu compiler set, and most of the time it compiles too. but you have to do it in a certain order. you'll find out as you go along which needs to come first (dependencies, dependencies, headache, headache, download, download, recompile, recompile). corrections/additions for this entry? contact me.
OpenWatcom
- __WATCOMC__
- __386__
- BUILD_DLL /* Codeblocks */
- __STDC__ (I think)
see article post