properties-cpp  0.0.1
A very simple convenience library for handling properties and signals in C++11.
CMakeCCompilerId.c
Go to the documentation of this file.
1 #ifdef __cplusplus
2 # error "A C++ compiler has been selected for C."
3 #endif
4 
5 #if defined(__18CXX)
6 # define ID_VOID_MAIN
7 #endif
8 #if defined(__CLASSIC_C__)
9 /* cv-qualifiers did not exist in K&R C */
10 # define const
11 # define volatile
12 #endif
13 
14 #if !defined(__has_include)
15 /* If the compiler does not have __has_include, pretend the answer is
16  always no. */
17 # define __has_include(x) 0
18 #endif
19 
20 
21 /* Version number components: V=Version, R=Revision, P=Patch
22  Version date components: YYYY=Year, MM=Month, DD=Day */
23 
24 #if defined(__INTEL_COMPILER) || defined(__ICC)
25 # define COMPILER_ID "Intel"
26 # if defined(_MSC_VER)
27 # define SIMULATE_ID "MSVC"
28 # endif
29 # if defined(__GNUC__)
30 # define SIMULATE_ID "GNU"
31 # endif
32  /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
33  except that a few beta releases use the old format with V=2021. */
34 # if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
35 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
36 # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
37 # if defined(__INTEL_COMPILER_UPDATE)
38 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
39 # else
40 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
41 # endif
42 # else
43 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
44 # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
45  /* The third version component from --version is an update index,
46  but no macro is provided for it. */
47 # define COMPILER_VERSION_PATCH DEC(0)
48 # endif
49 # if defined(__INTEL_COMPILER_BUILD_DATE)
50  /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
51 # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
52 # endif
53 # if defined(_MSC_VER)
54  /* _MSC_VER = VVRR */
55 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
56 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
57 # endif
58 # if defined(__GNUC__)
59 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
60 # elif defined(__GNUG__)
61 # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
62 # endif
63 # if defined(__GNUC_MINOR__)
64 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
65 # endif
66 # if defined(__GNUC_PATCHLEVEL__)
67 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
68 # endif
69 
70 #elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
71 # define COMPILER_ID "IntelLLVM"
72 #if defined(_MSC_VER)
73 # define SIMULATE_ID "MSVC"
74 #endif
75 #if defined(__GNUC__)
76 # define SIMULATE_ID "GNU"
77 #endif
78 /* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
79  * later. Look for 6 digit vs. 8 digit version number to decide encoding.
80  * VVVV is no smaller than the current year when a version is released.
81  */
82 #if __INTEL_LLVM_COMPILER < 1000000L
83 # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
84 # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
85 # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
86 #else
87 # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
88 # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
89 # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
90 #endif
91 #if defined(_MSC_VER)
92  /* _MSC_VER = VVRR */
93 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
94 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
95 #endif
96 #if defined(__GNUC__)
97 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
98 #elif defined(__GNUG__)
99 # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
100 #endif
101 #if defined(__GNUC_MINOR__)
102 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
103 #endif
104 #if defined(__GNUC_PATCHLEVEL__)
105 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
106 #endif
107 
108 #elif defined(__PATHCC__)
109 # define COMPILER_ID "PathScale"
110 # define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
111 # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
112 # if defined(__PATHCC_PATCHLEVEL__)
113 # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
114 # endif
115 
116 #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
117 # define COMPILER_ID "Embarcadero"
118 # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
119 # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
120 # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
121 
122 #elif defined(__BORLANDC__)
123 # define COMPILER_ID "Borland"
124  /* __BORLANDC__ = 0xVRR */
125 # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
126 # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
127 
128 #elif defined(__WATCOMC__) && __WATCOMC__ < 1200
129 # define COMPILER_ID "Watcom"
130  /* __WATCOMC__ = VVRR */
131 # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
132 # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
133 # if (__WATCOMC__ % 10) > 0
134 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
135 # endif
136 
137 #elif defined(__WATCOMC__)
138 # define COMPILER_ID "OpenWatcom"
139  /* __WATCOMC__ = VVRP + 1100 */
140 # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
141 # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
142 # if (__WATCOMC__ % 10) > 0
143 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
144 # endif
145 
146 #elif defined(__SUNPRO_C)
147 # define COMPILER_ID "SunPro"
148 # if __SUNPRO_C >= 0x5100
149  /* __SUNPRO_C = 0xVRRP */
150 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
151 # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
152 # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
153 # else
154  /* __SUNPRO_CC = 0xVRP */
155 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
156 # define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
157 # define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
158 # endif
159 
160 #elif defined(__HP_cc)
161 # define COMPILER_ID "HP"
162  /* __HP_cc = VVRRPP */
163 # define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
164 # define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
165 # define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
166 
167 #elif defined(__DECC)
168 # define COMPILER_ID "Compaq"
169  /* __DECC_VER = VVRRTPPPP */
170 # define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
171 # define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
172 # define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
173 
174 #elif defined(__IBMC__) && defined(__COMPILER_VER__)
175 # define COMPILER_ID "zOS"
176  /* __IBMC__ = VRP */
177 # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
178 # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
179 # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
180 
181 #elif defined(__open_xl__) && defined(__clang__)
182 # define COMPILER_ID "IBMClang"
183 # define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
184 # define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
185 # define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
186 # define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
187 
188 
189 #elif defined(__ibmxl__) && defined(__clang__)
190 # define COMPILER_ID "XLClang"
191 # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
192 # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
193 # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
194 # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
195 
196 
197 #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
198 # define COMPILER_ID "XL"
199  /* __IBMC__ = VRP */
200 # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
201 # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
202 # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
203 
204 #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
205 # define COMPILER_ID "VisualAge"
206  /* __IBMC__ = VRP */
207 # define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
208 # define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
209 # define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
210 
211 #elif defined(__NVCOMPILER)
212 # define COMPILER_ID "NVHPC"
213 # define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
214 # define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
215 # if defined(__NVCOMPILER_PATCHLEVEL__)
216 # define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
217 # endif
218 
219 #elif defined(__PGI)
220 # define COMPILER_ID "PGI"
221 # define COMPILER_VERSION_MAJOR DEC(__PGIC__)
222 # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
223 # if defined(__PGIC_PATCHLEVEL__)
224 # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
225 # endif
226 
227 #elif defined(_CRAYC)
228 # define COMPILER_ID "Cray"
229 # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
230 # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
231 
232 #elif defined(__TI_COMPILER_VERSION__)
233 # define COMPILER_ID "TI"
234  /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
235 # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
236 # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
237 # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
238 
239 #elif defined(__CLANG_FUJITSU)
240 # define COMPILER_ID "FujitsuClang"
241 # define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
242 # define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
243 # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
244 # define COMPILER_VERSION_INTERNAL_STR __clang_version__
245 
246 
247 #elif defined(__FUJITSU)
248 # define COMPILER_ID "Fujitsu"
249 # if defined(__FCC_version__)
250 # define COMPILER_VERSION __FCC_version__
251 # elif defined(__FCC_major__)
252 # define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
253 # define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
254 # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
255 # endif
256 # if defined(__fcc_version)
257 # define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
258 # elif defined(__FCC_VERSION)
259 # define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
260 # endif
261 
262 
263 #elif defined(__ghs__)
264 # define COMPILER_ID "GHS"
265 /* __GHS_VERSION_NUMBER = VVVVRP */
266 # ifdef __GHS_VERSION_NUMBER
267 # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
268 # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
269 # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
270 # endif
271 
272 #elif defined(__TASKING__)
273 # define COMPILER_ID "Tasking"
274  # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
275  # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
276 # define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
277 
278 #elif defined(__TINYC__)
279 # define COMPILER_ID "TinyCC"
280 
281 #elif defined(__BCC__)
282 # define COMPILER_ID "Bruce"
283 
284 #elif defined(__SCO_VERSION__)
285 # define COMPILER_ID "SCO"
286 
287 #elif defined(__ARMCC_VERSION) && !defined(__clang__)
288 # define COMPILER_ID "ARMCC"
289 #if __ARMCC_VERSION >= 1000000
290  /* __ARMCC_VERSION = VRRPPPP */
291  # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
292  # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
293  # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
294 #else
295  /* __ARMCC_VERSION = VRPPPP */
296  # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
297  # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
298  # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
299 #endif
300 
301 
302 #elif defined(__clang__) && defined(__apple_build_version__)
303 # define COMPILER_ID "AppleClang"
304 # if defined(_MSC_VER)
305 # define SIMULATE_ID "MSVC"
306 # endif
307 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
308 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
309 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
310 # if defined(_MSC_VER)
311  /* _MSC_VER = VVRR */
312 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
313 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
314 # endif
315 # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
316 
317 #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
318 # define COMPILER_ID "ARMClang"
319  # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
320  # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
321  # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
322 # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
323 
324 #elif defined(__clang__)
325 # define COMPILER_ID "Clang"
326 # if defined(_MSC_VER)
327 # define SIMULATE_ID "MSVC"
328 # endif
329 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
330 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
331 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
332 # if defined(_MSC_VER)
333  /* _MSC_VER = VVRR */
334 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
335 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
336 # endif
337 
338 #elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
339 # define COMPILER_ID "LCC"
340 # define COMPILER_VERSION_MAJOR DEC(1)
341 # if defined(__LCC__)
342 # define COMPILER_VERSION_MINOR DEC(__LCC__- 100)
343 # endif
344 # if defined(__LCC_MINOR__)
345 # define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
346 # endif
347 # if defined(__GNUC__) && defined(__GNUC_MINOR__)
348 # define SIMULATE_ID "GNU"
349 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
350 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
351 # if defined(__GNUC_PATCHLEVEL__)
352 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
353 # endif
354 # endif
355 
356 #elif defined(__GNUC__)
357 # define COMPILER_ID "GNU"
358 # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
359 # if defined(__GNUC_MINOR__)
360 # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
361 # endif
362 # if defined(__GNUC_PATCHLEVEL__)
363 # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
364 # endif
365 
366 #elif defined(_MSC_VER)
367 # define COMPILER_ID "MSVC"
368  /* _MSC_VER = VVRR */
369 # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
370 # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
371 # if defined(_MSC_FULL_VER)
372 # if _MSC_VER >= 1400
373  /* _MSC_FULL_VER = VVRRPPPPP */
374 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
375 # else
376  /* _MSC_FULL_VER = VVRRPPPP */
377 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
378 # endif
379 # endif
380 # if defined(_MSC_BUILD)
381 # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
382 # endif
383 
384 #elif defined(_ADI_COMPILER)
385 # define COMPILER_ID "ADSP"
386 #if defined(__VERSIONNUM__)
387  /* __VERSIONNUM__ = 0xVVRRPPTT */
388 # define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
389 # define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
390 # define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
391 # define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
392 #endif
393 
394 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
395 # define COMPILER_ID "IAR"
396 # if defined(__VER__) && defined(__ICCARM__)
397 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
398 # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
399 # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
400 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
401 # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
402 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
403 # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
404 # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
405 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
406 # endif
407 
408 #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
409 # define COMPILER_ID "SDCC"
410 # if defined(__SDCC_VERSION_MAJOR)
411 # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
412 # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
413 # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
414 # else
415  /* SDCC = VRP */
416 # define COMPILER_VERSION_MAJOR DEC(SDCC/100)
417 # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
418 # define COMPILER_VERSION_PATCH DEC(SDCC % 10)
419 # endif
420 
421 
422 /* These compilers are either not known or too old to define an
423  identification macro. Try to identify the platform and guess that
424  it is the native compiler. */
425 #elif defined(__hpux) || defined(__hpua)
426 # define COMPILER_ID "HP"
427 
428 #else /* unknown compiler */
429 # define COMPILER_ID ""
430 #endif
431 
432 /* Construct the string literal in pieces to prevent the source from
433  getting matched. Store it in a pointer rather than an array
434  because some compilers will just produce instructions to fill the
435  array rather than assigning a pointer to a static array. */
436 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
437 #ifdef SIMULATE_ID
438 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
439 #endif
440 
441 #ifdef __QNXNTO__
442 char const* qnxnto = "INFO" ":" "qnxnto[]";
443 #endif
444 
445 #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
446 char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
447 #endif
448 
449 #define STRINGIFY_HELPER(X) #X
450 #define STRINGIFY(X) STRINGIFY_HELPER(X)
451 
452 /* Identify known platforms by name. */
453 #if defined(__linux) || defined(__linux__) || defined(linux)
454 # define PLATFORM_ID "Linux"
455 
456 #elif defined(__MSYS__)
457 # define PLATFORM_ID "MSYS"
458 
459 #elif defined(__CYGWIN__)
460 # define PLATFORM_ID "Cygwin"
461 
462 #elif defined(__MINGW32__)
463 # define PLATFORM_ID "MinGW"
464 
465 #elif defined(__APPLE__)
466 # define PLATFORM_ID "Darwin"
467 
468 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
469 # define PLATFORM_ID "Windows"
470 
471 #elif defined(__FreeBSD__) || defined(__FreeBSD)
472 # define PLATFORM_ID "FreeBSD"
473 
474 #elif defined(__NetBSD__) || defined(__NetBSD)
475 # define PLATFORM_ID "NetBSD"
476 
477 #elif defined(__OpenBSD__) || defined(__OPENBSD)
478 # define PLATFORM_ID "OpenBSD"
479 
480 #elif defined(__sun) || defined(sun)
481 # define PLATFORM_ID "SunOS"
482 
483 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
484 # define PLATFORM_ID "AIX"
485 
486 #elif defined(__hpux) || defined(__hpux__)
487 # define PLATFORM_ID "HP-UX"
488 
489 #elif defined(__HAIKU__)
490 # define PLATFORM_ID "Haiku"
491 
492 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
493 # define PLATFORM_ID "BeOS"
494 
495 #elif defined(__QNX__) || defined(__QNXNTO__)
496 # define PLATFORM_ID "QNX"
497 
498 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
499 # define PLATFORM_ID "Tru64"
500 
501 #elif defined(__riscos) || defined(__riscos__)
502 # define PLATFORM_ID "RISCos"
503 
504 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
505 # define PLATFORM_ID "SINIX"
506 
507 #elif defined(__UNIX_SV__)
508 # define PLATFORM_ID "UNIX_SV"
509 
510 #elif defined(__bsdos__)
511 # define PLATFORM_ID "BSDOS"
512 
513 #elif defined(_MPRAS) || defined(MPRAS)
514 # define PLATFORM_ID "MP-RAS"
515 
516 #elif defined(__osf) || defined(__osf__)
517 # define PLATFORM_ID "OSF1"
518 
519 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
520 # define PLATFORM_ID "SCO_SV"
521 
522 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
523 # define PLATFORM_ID "ULTRIX"
524 
525 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
526 # define PLATFORM_ID "Xenix"
527 
528 #elif defined(__WATCOMC__)
529 # if defined(__LINUX__)
530 # define PLATFORM_ID "Linux"
531 
532 # elif defined(__DOS__)
533 # define PLATFORM_ID "DOS"
534 
535 # elif defined(__OS2__)
536 # define PLATFORM_ID "OS2"
537 
538 # elif defined(__WINDOWS__)
539 # define PLATFORM_ID "Windows3x"
540 
541 # elif defined(__VXWORKS__)
542 # define PLATFORM_ID "VxWorks"
543 
544 # else /* unknown platform */
545 # define PLATFORM_ID
546 # endif
547 
548 #elif defined(__INTEGRITY)
549 # if defined(INT_178B)
550 # define PLATFORM_ID "Integrity178"
551 
552 # else /* regular Integrity */
553 # define PLATFORM_ID "Integrity"
554 # endif
555 
556 # elif defined(_ADI_COMPILER)
557 # define PLATFORM_ID "ADSP"
558 
559 #else /* unknown platform */
560 # define PLATFORM_ID
561 
562 #endif
563 
564 /* For windows compilers MSVC and Intel we can determine
565  the architecture of the compiler being used. This is because
566  the compilers do not have flags that can change the architecture,
567  but rather depend on which compiler is being used
568 */
569 #if defined(_WIN32) && defined(_MSC_VER)
570 # if defined(_M_IA64)
571 # define ARCHITECTURE_ID "IA64"
572 
573 # elif defined(_M_ARM64EC)
574 # define ARCHITECTURE_ID "ARM64EC"
575 
576 # elif defined(_M_X64) || defined(_M_AMD64)
577 # define ARCHITECTURE_ID "x64"
578 
579 # elif defined(_M_IX86)
580 # define ARCHITECTURE_ID "X86"
581 
582 # elif defined(_M_ARM64)
583 # define ARCHITECTURE_ID "ARM64"
584 
585 # elif defined(_M_ARM)
586 # if _M_ARM == 4
587 # define ARCHITECTURE_ID "ARMV4I"
588 # elif _M_ARM == 5
589 # define ARCHITECTURE_ID "ARMV5I"
590 # else
591 # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
592 # endif
593 
594 # elif defined(_M_MIPS)
595 # define ARCHITECTURE_ID "MIPS"
596 
597 # elif defined(_M_SH)
598 # define ARCHITECTURE_ID "SHx"
599 
600 # else /* unknown architecture */
601 # define ARCHITECTURE_ID ""
602 # endif
603 
604 #elif defined(__WATCOMC__)
605 # if defined(_M_I86)
606 # define ARCHITECTURE_ID "I86"
607 
608 # elif defined(_M_IX86)
609 # define ARCHITECTURE_ID "X86"
610 
611 # else /* unknown architecture */
612 # define ARCHITECTURE_ID ""
613 # endif
614 
615 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
616 # if defined(__ICCARM__)
617 # define ARCHITECTURE_ID "ARM"
618 
619 # elif defined(__ICCRX__)
620 # define ARCHITECTURE_ID "RX"
621 
622 # elif defined(__ICCRH850__)
623 # define ARCHITECTURE_ID "RH850"
624 
625 # elif defined(__ICCRL78__)
626 # define ARCHITECTURE_ID "RL78"
627 
628 # elif defined(__ICCRISCV__)
629 # define ARCHITECTURE_ID "RISCV"
630 
631 # elif defined(__ICCAVR__)
632 # define ARCHITECTURE_ID "AVR"
633 
634 # elif defined(__ICC430__)
635 # define ARCHITECTURE_ID "MSP430"
636 
637 # elif defined(__ICCV850__)
638 # define ARCHITECTURE_ID "V850"
639 
640 # elif defined(__ICC8051__)
641 # define ARCHITECTURE_ID "8051"
642 
643 # elif defined(__ICCSTM8__)
644 # define ARCHITECTURE_ID "STM8"
645 
646 # else /* unknown architecture */
647 # define ARCHITECTURE_ID ""
648 # endif
649 
650 #elif defined(__ghs__)
651 # if defined(__PPC64__)
652 # define ARCHITECTURE_ID "PPC64"
653 
654 # elif defined(__ppc__)
655 # define ARCHITECTURE_ID "PPC"
656 
657 # elif defined(__ARM__)
658 # define ARCHITECTURE_ID "ARM"
659 
660 # elif defined(__x86_64__)
661 # define ARCHITECTURE_ID "x64"
662 
663 # elif defined(__i386__)
664 # define ARCHITECTURE_ID "X86"
665 
666 # else /* unknown architecture */
667 # define ARCHITECTURE_ID ""
668 # endif
669 
670 #elif defined(__TI_COMPILER_VERSION__)
671 # if defined(__TI_ARM__)
672 # define ARCHITECTURE_ID "ARM"
673 
674 # elif defined(__MSP430__)
675 # define ARCHITECTURE_ID "MSP430"
676 
677 # elif defined(__TMS320C28XX__)
678 # define ARCHITECTURE_ID "TMS320C28x"
679 
680 # elif defined(__TMS320C6X__) || defined(_TMS320C6X)
681 # define ARCHITECTURE_ID "TMS320C6x"
682 
683 # else /* unknown architecture */
684 # define ARCHITECTURE_ID ""
685 # endif
686 
687 # elif defined(__ADSPSHARC__)
688 # define ARCHITECTURE_ID "SHARC"
689 
690 # elif defined(__ADSPBLACKFIN__)
691 # define ARCHITECTURE_ID "Blackfin"
692 
693 #elif defined(__TASKING__)
694 
695 # if defined(__CTC__) || defined(__CPTC__)
696 # define ARCHITECTURE_ID "TriCore"
697 
698 # elif defined(__CMCS__)
699 # define ARCHITECTURE_ID "MCS"
700 
701 # elif defined(__CARM__)
702 # define ARCHITECTURE_ID "ARM"
703 
704 # elif defined(__CARC__)
705 # define ARCHITECTURE_ID "ARC"
706 
707 # elif defined(__C51__)
708 # define ARCHITECTURE_ID "8051"
709 
710 # elif defined(__CPCP__)
711 # define ARCHITECTURE_ID "PCP"
712 
713 # else
714 # define ARCHITECTURE_ID ""
715 # endif
716 
717 #else
718 # define ARCHITECTURE_ID
719 #endif
720 
721 /* Convert integer to decimal digit literals. */
722 #define DEC(n) \
723  ('0' + (((n) / 10000000)%10)), \
724  ('0' + (((n) / 1000000)%10)), \
725  ('0' + (((n) / 100000)%10)), \
726  ('0' + (((n) / 10000)%10)), \
727  ('0' + (((n) / 1000)%10)), \
728  ('0' + (((n) / 100)%10)), \
729  ('0' + (((n) / 10)%10)), \
730  ('0' + ((n) % 10))
731 
732 /* Convert integer to hex digit literals. */
733 #define HEX(n) \
734  ('0' + ((n)>>28 & 0xF)), \
735  ('0' + ((n)>>24 & 0xF)), \
736  ('0' + ((n)>>20 & 0xF)), \
737  ('0' + ((n)>>16 & 0xF)), \
738  ('0' + ((n)>>12 & 0xF)), \
739  ('0' + ((n)>>8 & 0xF)), \
740  ('0' + ((n)>>4 & 0xF)), \
741  ('0' + ((n) & 0xF))
742 
743 /* Construct a string literal encoding the version number. */
744 #ifdef COMPILER_VERSION
745 char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
746 
747 /* Construct a string literal encoding the version number components. */
748 #elif defined(COMPILER_VERSION_MAJOR)
749 char const info_version[] = {
750  'I', 'N', 'F', 'O', ':',
751  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
752  COMPILER_VERSION_MAJOR,
753 # ifdef COMPILER_VERSION_MINOR
754  '.', COMPILER_VERSION_MINOR,
755 # ifdef COMPILER_VERSION_PATCH
756  '.', COMPILER_VERSION_PATCH,
757 # ifdef COMPILER_VERSION_TWEAK
758  '.', COMPILER_VERSION_TWEAK,
759 # endif
760 # endif
761 # endif
762  ']','\0'};
763 #endif
764 
765 /* Construct a string literal encoding the internal version number. */
766 #ifdef COMPILER_VERSION_INTERNAL
767 char const info_version_internal[] = {
768  'I', 'N', 'F', 'O', ':',
769  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
770  'i','n','t','e','r','n','a','l','[',
771  COMPILER_VERSION_INTERNAL,']','\0'};
772 #elif defined(COMPILER_VERSION_INTERNAL_STR)
773 char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
774 #endif
775 
776 /* Construct a string literal encoding the version number components. */
777 #ifdef SIMULATE_VERSION_MAJOR
778 char const info_simulate_version[] = {
779  'I', 'N', 'F', 'O', ':',
780  's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
781  SIMULATE_VERSION_MAJOR,
782 # ifdef SIMULATE_VERSION_MINOR
783  '.', SIMULATE_VERSION_MINOR,
784 # ifdef SIMULATE_VERSION_PATCH
785  '.', SIMULATE_VERSION_PATCH,
786 # ifdef SIMULATE_VERSION_TWEAK
787  '.', SIMULATE_VERSION_TWEAK,
788 # endif
789 # endif
790 # endif
791  ']','\0'};
792 #endif
793 
794 /* Construct the string literal in pieces to prevent the source from
795  getting matched. Store it in a pointer rather than an array
796  because some compilers will just produce instructions to fill the
797  array rather than assigning a pointer to a static array. */
798 char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
799 char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
800 
801 
802 
803 #if !defined(__STDC__) && !defined(__clang__)
804 # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
805 # define C_VERSION "90"
806 # else
807 # define C_VERSION
808 # endif
809 #elif __STDC_VERSION__ > 201710L
810 # define C_VERSION "23"
811 #elif __STDC_VERSION__ >= 201710L
812 # define C_VERSION "17"
813 #elif __STDC_VERSION__ >= 201000L
814 # define C_VERSION "11"
815 #elif __STDC_VERSION__ >= 199901L
816 # define C_VERSION "99"
817 #else
818 # define C_VERSION "90"
819 #endif
821  "INFO" ":" "standard_default[" C_VERSION "]";
822 
823 const char* info_language_extensions_default = "INFO" ":" "extensions_default["
824 #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
825  defined(__TI_COMPILER_VERSION__)) && \
826  !defined(__STRICT_ANSI__)
827  "ON"
828 #else
829  "OFF"
830 #endif
831 "]";
832 
833 /*--------------------------------------------------------------------------*/
834 
835 #ifdef ID_VOID_MAIN
836 void main() {}
837 #else
838 # if defined(__CLASSIC_C__)
839 int main(argc, argv) int argc; char *argv[];
840 # else
841 int main(int argc, char* argv[])
842 # endif
843 {
844  int require = 0;
845  require += info_compiler[argc];
846  require += info_platform[argc];
847  require += info_arch[argc];
848 #ifdef COMPILER_VERSION_MAJOR
849  require += info_version[argc];
850 #endif
851 #ifdef COMPILER_VERSION_INTERNAL
852  require += info_version_internal[argc];
853 #endif
854 #ifdef SIMULATE_ID
855  require += info_simulate[argc];
856 #endif
857 #ifdef SIMULATE_VERSION_MAJOR
858  require += info_simulate_version[argc];
859 #endif
860 #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
861  require += info_cray[argc];
862 #endif
863  require += info_language_standard_default[argc];
864  require += info_language_extensions_default[argc];
865  (void)argv;
866  return require;
867 }
868 #endif
const char * info_language_extensions_default
char const * info_arch
char const * info_compiler
int main(int argc, char *argv[])
#define C_VERSION
char const * info_platform
const char * info_language_standard_default
#define ARCHITECTURE_ID
#define COMPILER_ID
#define PLATFORM_ID