1 /* Identify known platforms by name. */
2 #if defined(__linux) || defined(__linux__) || defined(linux)
3 # define PLATFORM_ID "Linux"
5 #elif defined(__CYGWIN__)
6 # define PLATFORM_ID "Cygwin"
8 #elif defined(__MINGW32__)
9 # define PLATFORM_ID "MinGW"
11 #elif defined(__APPLE__)
12 # define PLATFORM_ID "Darwin"
14 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
15 # define PLATFORM_ID "Windows"
17 #elif defined(__FreeBSD__) || defined(__FreeBSD)
18 # define PLATFORM_ID "FreeBSD"
20 #elif defined(__NetBSD__) || defined(__NetBSD)
21 # define PLATFORM_ID "NetBSD"
23 #elif defined(__OpenBSD__) || defined(__OPENBSD)
24 # define PLATFORM_ID "OpenBSD"
26 #elif defined(__sun) || defined(sun)
27 # define PLATFORM_ID "SunOS"
29 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
30 # define PLATFORM_ID "AIX"
32 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
33 # define PLATFORM_ID "IRIX"
35 #elif defined(__hpux) || defined(__hpux__)
36 # define PLATFORM_ID "HP-UX"
38 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
39 # define PLATFORM_ID "BeOS"
41 #elif defined(__QNX__) || defined(__QNXNTO__)
42 # define PLATFORM_ID "QNX"
44 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
45 # define PLATFORM_ID "Tru64"
47 #elif defined(__riscos) || defined(__riscos__)
48 # define PLATFORM_ID "RISCos"
50 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
51 # define PLATFORM_ID "SINIX"
53 #elif defined(__UNIX_SV__)
54 # define PLATFORM_ID "UNIX_SV"
56 #elif defined(__bsdos__)
57 # define PLATFORM_ID "BSDOS"
59 #elif defined(_MPRAS) || defined(MPRAS)
60 # define PLATFORM_ID "MP-RAS"
62 #elif defined(__osf) || defined(__osf__)
63 # define PLATFORM_ID "OSF1"
65 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
66 # define PLATFORM_ID "SCO_SV"
68 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
69 # define PLATFORM_ID "ULTRIX"
71 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
72 # define PLATFORM_ID "Xenix"
74 #else /* unknown platform */
75 # define PLATFORM_ID ""
79 /* Construct the string literal in pieces to prevent the source from
80 getting matched. Store it in a pointer rather than an array
81 because some compilers will just produce instructions to fill the
82 array rather than assigning a pointer to a static array. */
83 char* info_platform
= "INFO" ":" "platform[" PLATFORM_ID
"]";