1 /* This source file must have a .cpp extension so that all C++ compilers
2 recognize the extension without flags. Borland does not know .cxx for
5 # error "A C compiler has been selected for C++."
9 # define COMPILER_ID "Comeau"
11 #elif defined(__INTEL_COMPILER) || defined(__ICC)
12 # define COMPILER_ID "Intel"
14 #elif defined(__BORLANDC__)
15 # define COMPILER_ID "Borland"
17 #elif defined(__WATCOMC__)
18 # define COMPILER_ID "Watcom"
20 #elif defined(__SUNPRO_CC)
21 # define COMPILER_ID "SunPro"
23 #elif defined(__HP_aCC)
24 # define COMPILER_ID "HP"
26 #elif defined(__DECCXX)
27 # define COMPILER_ID "Compaq"
29 #elif defined(__IBMCPP__)
30 # define COMPILER_ID "VisualAge"
33 # define COMPILER_ID "PGI"
35 #elif defined(__GNUC__)
36 # define COMPILER_ID "GNU"
38 #elif defined(_MSC_VER)
39 # define COMPILER_ID "MSVC"
41 #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
42 /* Analog Devices C++ compiler for Blackfin, TigerSHARC and
44 # define COMPILER_ID "ADSP"
46 #elif defined(_COMPILER_VERSION)
47 # define COMPILER_ID "MIPSpro"
49 /* This compiler is either not known or is too old to define an
50 identification macro. Try to identify the platform and guess that
51 it is the native compiler. */
53 # define COMPILER_ID "MIPSpro"
55 #elif defined(__hpux) || defined(__hpua)
56 # define COMPILER_ID "HP"
58 #else /* unknown compiler */
59 # define COMPILER_ID ""
63 /* Construct the string literal in pieces to prevent the source from
64 getting matched. Store it in a pointer rather than an array
65 because some compilers will just produce instructions to fill the
66 array rather than assigning a pointer to a static array. */
67 char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
69 /* Identify known platforms by name. */
70 #if defined(__linux) || defined(__linux__) || defined(linux)
71 # define PLATFORM_ID "Linux"
73 #elif defined(__CYGWIN__)
74 # define PLATFORM_ID "Cygwin"
76 #elif defined(__MINGW32__)
77 # define PLATFORM_ID "MinGW"
79 #elif defined(__APPLE__)
80 # define PLATFORM_ID "Darwin"
82 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
83 # define PLATFORM_ID "Windows"
85 #elif defined(__FreeBSD__) || defined(__FreeBSD)
86 # define PLATFORM_ID "FreeBSD"
88 #elif defined(__NetBSD__) || defined(__NetBSD)
89 # define PLATFORM_ID "NetBSD"
91 #elif defined(__OpenBSD__) || defined(__OPENBSD)
92 # define PLATFORM_ID "OpenBSD"
94 #elif defined(__sun) || defined(sun)
95 # define PLATFORM_ID "SunOS"
97 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
98 # define PLATFORM_ID "AIX"
100 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
101 # define PLATFORM_ID "IRIX"
103 #elif defined(__hpux) || defined(__hpux__)
104 # define PLATFORM_ID "HP-UX"
106 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
107 # define PLATFORM_ID "BeOS"
109 #elif defined(__QNX__) || defined(__QNXNTO__)
110 # define PLATFORM_ID "QNX"
112 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
113 # define PLATFORM_ID "Tru64"
115 #elif defined(__riscos) || defined(__riscos__)
116 # define PLATFORM_ID "RISCos"
118 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
119 # define PLATFORM_ID "SINIX"
121 #elif defined(__UNIX_SV__)
122 # define PLATFORM_ID "UNIX_SV"
124 #elif defined(__bsdos__)
125 # define PLATFORM_ID "BSDOS"
127 #elif defined(_MPRAS) || defined(MPRAS)
128 # define PLATFORM_ID "MP-RAS"
130 #elif defined(__osf) || defined(__osf__)
131 # define PLATFORM_ID "OSF1"
133 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
134 # define PLATFORM_ID "SCO_SV"
136 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
137 # define PLATFORM_ID "ULTRIX"
139 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
140 # define PLATFORM_ID "Xenix"
142 #else /* unknown platform */
143 # define PLATFORM_ID ""
147 /* Construct the string literal in pieces to prevent the source from
148 getting matched. Store it in a pointer rather than an array
149 because some compilers will just produce instructions to fill the
150 array rather than assigning a pointer to a static array. */
151 char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
154 /*--------------------------------------------------------------------------*/
156 int main(int argc, char* argv[])
159 require += info_compiler[argc];
160 require += info_platform[argc];