annotate sample/CMakeFiles/3.8.2/CompilerIdC/CMakeCCompilerId.c @ 1:4153915c519f

add sample
author ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
date Thu, 15 Jun 2017 17:18:17 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #ifdef __cplusplus
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 # error "A C++ compiler has been selected for C."
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #if defined(__18CXX)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 # define ID_VOID_MAIN
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 #if defined(__CLASSIC_C__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 /* cv-qualifiers did not exist in K&R C */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 # define const
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 # define volatile
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 /* Version number components: V=Version, R=Revision, P=Patch
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 Version date components: YYYY=Year, MM=Month, DD=Day */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 #if defined(__INTEL_COMPILER) || defined(__ICC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 # define COMPILER_ID "Intel"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 # if defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 # define SIMULATE_ID "MSVC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 /* __INTEL_COMPILER = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 # if defined(__INTEL_COMPILER_UPDATE)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 # if defined(__INTEL_COMPILER_BUILD_DATE)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 # if defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 /* _MSC_VER = VVRR */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 #elif defined(__PATHCC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 # define COMPILER_ID "PathScale"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 # define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 # if defined(__PATHCC_PATCHLEVEL__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 # define COMPILER_ID "Embarcadero"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 #elif defined(__BORLANDC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 # define COMPILER_ID "Borland"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 /* __BORLANDC__ = 0xVRR */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 #elif defined(__WATCOMC__) && __WATCOMC__ < 1200
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 # define COMPILER_ID "Watcom"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 /* __WATCOMC__ = VVRR */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 # if (__WATCOMC__ % 10) > 0
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 #elif defined(__WATCOMC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 # define COMPILER_ID "OpenWatcom"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 /* __WATCOMC__ = VVRP + 1100 */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 # if (__WATCOMC__ % 10) > 0
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 #elif defined(__SUNPRO_C)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 # define COMPILER_ID "SunPro"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 # if __SUNPRO_C >= 0x5100
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 /* __SUNPRO_C = 0xVRRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 /* __SUNPRO_CC = 0xVRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 #elif defined(__HP_cc)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 # define COMPILER_ID "HP"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 /* __HP_cc = VVRRPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 #elif defined(__DECC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 # define COMPILER_ID "Compaq"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 /* __DECC_VER = VVRRTPPPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 #elif defined(__IBMC__) && defined(__COMPILER_VER__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 # define COMPILER_ID "zOS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 /* __IBMC__ = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 # define COMPILER_ID "XL"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 /* __IBMC__ = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 # define COMPILER_ID "VisualAge"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 /* __IBMC__ = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 #elif defined(__PGI)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 # define COMPILER_ID "PGI"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 # define COMPILER_VERSION_MAJOR DEC(__PGIC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 # if defined(__PGIC_PATCHLEVEL__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 #elif defined(_CRAYC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 # define COMPILER_ID "Cray"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 #elif defined(__TI_COMPILER_VERSION__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 # define COMPILER_ID "TI"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 # define COMPILER_ID "Fujitsu"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 #elif defined(__TINYC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 # define COMPILER_ID "TinyCC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 #elif defined(__BCC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 # define COMPILER_ID "Bruce"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 #elif defined(__SCO_VERSION__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 # define COMPILER_ID "SCO"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 #elif defined(__clang__) && defined(__apple_build_version__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 # define COMPILER_ID "AppleClang"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 # if defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 # define SIMULATE_ID "MSVC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 # if defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 /* _MSC_VER = VVRR */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 #elif defined(__clang__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 # define COMPILER_ID "Clang"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 # if defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 # define SIMULATE_ID "MSVC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 # if defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 /* _MSC_VER = VVRR */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 #elif defined(__GNUC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 # define COMPILER_ID "GNU"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 # if defined(__GNUC_MINOR__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 # if defined(__GNUC_PATCHLEVEL__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 #elif defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 # define COMPILER_ID "MSVC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 /* _MSC_VER = VVRR */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 # if defined(_MSC_FULL_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 # if _MSC_VER >= 1400
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 /* _MSC_FULL_VER = VVRRPPPPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 /* _MSC_FULL_VER = VVRRPPPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 # if defined(_MSC_BUILD)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 # define COMPILER_ID "ADSP"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 #if defined(__VISUALDSPVERSION__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 #elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 # define COMPILER_ID "IAR"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 #elif defined(__ARMCC_VERSION)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 # define COMPILER_ID "ARMCC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 #if __ARMCC_VERSION >= 1000000
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 /* __ARMCC_VERSION = VRRPPPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 #else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 /* __ARMCC_VERSION = VRPPPP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 # define COMPILER_ID "SDCC"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 # if defined(__SDCC_VERSION_MAJOR)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 /* SDCC = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 # define COMPILER_VERSION_MAJOR DEC(SDCC/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 # define COMPILER_VERSION_PATCH DEC(SDCC % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 # define COMPILER_ID "MIPSpro"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 # if defined(_SGI_COMPILER_VERSION)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 /* _SGI_COMPILER_VERSION = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 /* _COMPILER_VERSION = VRP */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 /* These compilers are either not known or too old to define an
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 identification macro. Try to identify the platform and guess that
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 it is the native compiler. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 #elif defined(__sgi)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 # define COMPILER_ID "MIPSpro"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 #elif defined(__hpux) || defined(__hpua)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 # define COMPILER_ID "HP"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 #else /* unknown compiler */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 # define COMPILER_ID ""
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 /* Construct the string literal in pieces to prevent the source from
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 getting matched. Store it in a pointer rather than an array
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 because some compilers will just produce instructions to fill the
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 array rather than assigning a pointer to a static array. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 #ifdef SIMULATE_ID
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 #ifdef __QNXNTO__
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 char const* qnxnto = "INFO" ":" "qnxnto[]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 #if defined(__CRAYXE) || defined(__CRAYXC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 #define STRINGIFY_HELPER(X) #X
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 #define STRINGIFY(X) STRINGIFY_HELPER(X)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 /* Identify known platforms by name. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 #if defined(__linux) || defined(__linux__) || defined(linux)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 # define PLATFORM_ID "Linux"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 #elif defined(__CYGWIN__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 # define PLATFORM_ID "Cygwin"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 #elif defined(__MINGW32__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 # define PLATFORM_ID "MinGW"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 #elif defined(__APPLE__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 # define PLATFORM_ID "Darwin"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 # define PLATFORM_ID "Windows"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 #elif defined(__FreeBSD__) || defined(__FreeBSD)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 # define PLATFORM_ID "FreeBSD"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 #elif defined(__NetBSD__) || defined(__NetBSD)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 # define PLATFORM_ID "NetBSD"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 #elif defined(__OpenBSD__) || defined(__OPENBSD)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 # define PLATFORM_ID "OpenBSD"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 #elif defined(__sun) || defined(sun)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 # define PLATFORM_ID "SunOS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 # define PLATFORM_ID "AIX"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 # define PLATFORM_ID "IRIX"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 #elif defined(__hpux) || defined(__hpux__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 # define PLATFORM_ID "HP-UX"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 #elif defined(__HAIKU__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 # define PLATFORM_ID "Haiku"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 # define PLATFORM_ID "BeOS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 #elif defined(__QNX__) || defined(__QNXNTO__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 # define PLATFORM_ID "QNX"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 # define PLATFORM_ID "Tru64"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 #elif defined(__riscos) || defined(__riscos__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 # define PLATFORM_ID "RISCos"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 # define PLATFORM_ID "SINIX"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 #elif defined(__UNIX_SV__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 # define PLATFORM_ID "UNIX_SV"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 #elif defined(__bsdos__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 # define PLATFORM_ID "BSDOS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 #elif defined(_MPRAS) || defined(MPRAS)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 # define PLATFORM_ID "MP-RAS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 #elif defined(__osf) || defined(__osf__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 # define PLATFORM_ID "OSF1"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 # define PLATFORM_ID "SCO_SV"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 # define PLATFORM_ID "ULTRIX"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
378 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
379 # define PLATFORM_ID "Xenix"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 #elif defined(__WATCOMC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382 # if defined(__LINUX__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 # define PLATFORM_ID "Linux"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
384
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 # elif defined(__DOS__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 # define PLATFORM_ID "DOS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388 # elif defined(__OS2__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 # define PLATFORM_ID "OS2"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 # elif defined(__WINDOWS__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 # define PLATFORM_ID "Windows3x"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 # else /* unknown platform */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 # define PLATFORM_ID
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 #else /* unknown platform */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 # define PLATFORM_ID
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 /* For windows compilers MSVC and Intel we can determine
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 the architecture of the compiler being used. This is because
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 the compilers do not have flags that can change the architecture,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 but rather depend on which compiler is being used
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 #if defined(_WIN32) && defined(_MSC_VER)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 # if defined(_M_IA64)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 # define ARCHITECTURE_ID "IA64"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 # elif defined(_M_X64) || defined(_M_AMD64)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 # define ARCHITECTURE_ID "x64"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 # elif defined(_M_IX86)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416 # define ARCHITECTURE_ID "X86"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 # elif defined(_M_ARM)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 # if _M_ARM == 4
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
420 # define ARCHITECTURE_ID "ARMV4I"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 # elif _M_ARM == 5
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 # define ARCHITECTURE_ID "ARMV5I"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 # elif defined(_M_MIPS)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 # define ARCHITECTURE_ID "MIPS"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 # elif defined(_M_SH)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 # define ARCHITECTURE_ID "SHx"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
432
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 # else /* unknown architecture */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 # define ARCHITECTURE_ID ""
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 #elif defined(__WATCOMC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 # if defined(_M_I86)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 # define ARCHITECTURE_ID "I86"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 # elif defined(_M_IX86)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 # define ARCHITECTURE_ID "X86"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 # else /* unknown architecture */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 # define ARCHITECTURE_ID ""
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 #else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 # define ARCHITECTURE_ID
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 /* Convert integer to decimal digit literals. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 #define DEC(n) \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454 ('0' + (((n) / 10000000)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 ('0' + (((n) / 1000000)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 ('0' + (((n) / 100000)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 ('0' + (((n) / 10000)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 ('0' + (((n) / 1000)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 ('0' + (((n) / 100)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 ('0' + (((n) / 10)%10)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 ('0' + ((n) % 10))
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 /* Convert integer to hex digit literals. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 #define HEX(n) \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 ('0' + ((n)>>28 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 ('0' + ((n)>>24 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 ('0' + ((n)>>20 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 ('0' + ((n)>>16 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 ('0' + ((n)>>12 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 ('0' + ((n)>>8 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 ('0' + ((n)>>4 & 0xF)), \
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 ('0' + ((n) & 0xF))
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 /* Construct a string literal encoding the version number components. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 #ifdef COMPILER_VERSION_MAJOR
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 char const info_version[] = {
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 'I', 'N', 'F', 'O', ':',
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 COMPILER_VERSION_MAJOR,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 # ifdef COMPILER_VERSION_MINOR
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 '.', COMPILER_VERSION_MINOR,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 # ifdef COMPILER_VERSION_PATCH
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 '.', COMPILER_VERSION_PATCH,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 # ifdef COMPILER_VERSION_TWEAK
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 '.', COMPILER_VERSION_TWEAK,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 ']','\0'};
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 /* Construct a string literal encoding the version number components. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 #ifdef SIMULATE_VERSION_MAJOR
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 char const info_simulate_version[] = {
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 'I', 'N', 'F', 'O', ':',
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 SIMULATE_VERSION_MAJOR,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 # ifdef SIMULATE_VERSION_MINOR
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 '.', SIMULATE_VERSION_MINOR,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 # ifdef SIMULATE_VERSION_PATCH
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 '.', SIMULATE_VERSION_PATCH,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 # ifdef SIMULATE_VERSION_TWEAK
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503 '.', SIMULATE_VERSION_TWEAK,
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 ']','\0'};
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
508 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 /* Construct the string literal in pieces to prevent the source from
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 getting matched. Store it in a pointer rather than an array
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 because some compilers will just produce instructions to fill the
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 array rather than assigning a pointer to a static array. */
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
515 char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
516
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
517
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
518
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 #if !defined(__STDC__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521 # if defined(_MSC_VER) && !defined(__clang__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 # define C_DIALECT "90"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 # define C_DIALECT
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 #elif __STDC_VERSION__ >= 201000L
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 # define C_DIALECT "11"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 #elif __STDC_VERSION__ >= 199901L
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 # define C_DIALECT "99"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 #else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
531 # define C_DIALECT "90"
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 const char* info_language_dialect_default =
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 "INFO" ":" "dialect_default[" C_DIALECT "]";
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 /*--------------------------------------------------------------------------*/
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538 #ifdef ID_VOID_MAIN
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 void main() {}
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 #else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 # if defined(__CLASSIC_C__)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 int main(argc, argv) int argc; char *argv[];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 # else
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 int main(int argc, char* argv[])
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 # endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 {
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 int require = 0;
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 require += info_compiler[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 require += info_platform[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 require += info_arch[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 #ifdef COMPILER_VERSION_MAJOR
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 require += info_version[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 #ifdef SIMULATE_ID
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 require += info_simulate[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 #ifdef SIMULATE_VERSION_MAJOR
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558 require += info_simulate_version[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 #if defined(__CRAYXE) || defined(__CRAYXC)
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 require += info_cray[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562 #endif
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 require += info_language_dialect_default[argc];
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 (void)argv;
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 return require;
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
566 }
4153915c519f add sample
ikkun <ikkun@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
567 #endif