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