2 # error "A C++ compiler has been selected for C."
8 #if defined(__CLASSIC_C__)
14 #if !defined(__has_include)
17 # define __has_include(x) 0
24 #if defined(__INTEL_COMPILER) || defined(__ICC)
25 # define COMPILER_ID "Intel"
26 # if defined(_MSC_VER)
27 # define SIMULATE_ID "MSVC"
29 # if defined(__GNUC__)
30 # define SIMULATE_ID "GNU"
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)
40 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
43 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
44 # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
47 # define COMPILER_VERSION_PATCH DEC(0)
49 # if defined(__INTEL_COMPILER_BUILD_DATE)
51 # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
53 # if defined(_MSC_VER)
55 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
56 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
58 # if defined(__GNUC__)
59 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
60 # elif defined(__GNUG__)
61 # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
63 # if defined(__GNUC_MINOR__)
64 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
66 # if defined(__GNUC_PATCHLEVEL__)
67 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
70 #elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
71 # define COMPILER_ID "IntelLLVM"
73 # define SIMULATE_ID "MSVC"
76 # define SIMULATE_ID "GNU"
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)
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)
93 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
94 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
97 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
98 #elif defined(__GNUG__)
99 # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
101 #if defined(__GNUC_MINOR__)
102 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
104 #if defined(__GNUC_PATCHLEVEL__)
105 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
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__)
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)
122 #elif defined(__BORLANDC__)
123 # define COMPILER_ID "Borland"
125 # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
126 # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
128 #elif defined(__WATCOMC__) && __WATCOMC__ < 1200
129 # define COMPILER_ID "Watcom"
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)
137 #elif defined(__WATCOMC__)
138 # define COMPILER_ID "OpenWatcom"
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)
146 #elif defined(__SUNPRO_C)
147 # define COMPILER_ID "SunPro"
148 # if __SUNPRO_C >= 0x5100
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)
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)
160 #elif defined(__HP_cc)
161 # define COMPILER_ID "HP"
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)
167 #elif defined(__DECC)
168 # define COMPILER_ID "Compaq"
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)
174 #elif defined(__IBMC__) && defined(__COMPILER_VER__)
175 # define COMPILER_ID "zOS"
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)
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__)
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__)
197 #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
198 # define COMPILER_ID "XL"
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)
204 #elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
205 # define COMPILER_ID "VisualAge"
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)
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__)
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__)
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)
232 #elif defined(__TI_COMPILER_VERSION__)
233 # define COMPILER_ID "TI"
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)
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__
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__)
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)
263 #elif defined(__ghs__)
264 # define COMPILER_ID "GHS"
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)
272 #elif defined(__TINYC__)
273 # define COMPILER_ID "TinyCC"
275 #elif defined(__BCC__)
276 # define COMPILER_ID "Bruce"
278 #elif defined(__SCO_VERSION__)
279 # define COMPILER_ID "SCO"
281 #elif defined(__ARMCC_VERSION) && !defined(__clang__)
282 # define COMPILER_ID "ARMCC"
283 #if __ARMCC_VERSION >= 1000000
285 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
286 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
287 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
290 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
291 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
292 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
296 #elif defined(__clang__) && defined(__apple_build_version__)
297 # define COMPILER_ID "AppleClang"
298 # if defined(_MSC_VER)
299 # define SIMULATE_ID "MSVC"
301 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
302 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
303 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
304 # if defined(_MSC_VER)
306 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
307 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
309 # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
311 #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
312 # define COMPILER_ID "ARMClang"
313 # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
314 # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
315 # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
316 # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
318 #elif defined(__clang__)
319 # define COMPILER_ID "Clang"
320 # if defined(_MSC_VER)
321 # define SIMULATE_ID "MSVC"
323 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
324 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
325 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
326 # if defined(_MSC_VER)
328 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
329 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
332 #elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
333 # define COMPILER_ID "LCC"
334 # define COMPILER_VERSION_MAJOR DEC(1)
335 # if defined(__LCC__)
336 # define COMPILER_VERSION_MINOR DEC(__LCC__- 100)
338 # if defined(__LCC_MINOR__)
339 # define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
341 # if defined(__GNUC__) && defined(__GNUC_MINOR__)
342 # define SIMULATE_ID "GNU"
343 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
344 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
345 # if defined(__GNUC_PATCHLEVEL__)
346 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
350 #elif defined(__GNUC__)
351 # define COMPILER_ID "GNU"
352 # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
353 # if defined(__GNUC_MINOR__)
354 # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
356 # if defined(__GNUC_PATCHLEVEL__)
357 # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
360 #elif defined(_MSC_VER)
361 # define COMPILER_ID "MSVC"
363 # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
364 # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
365 # if defined(_MSC_FULL_VER)
366 # if _MSC_VER >= 1400
368 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
371 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
374 # if defined(_MSC_BUILD)
375 # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
378 #elif defined(_ADI_COMPILER)
379 # define COMPILER_ID "ADSP"
380 #if defined(__VERSIONNUM__)
382 # define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
383 # define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
384 # define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
385 # define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
388 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
389 # define COMPILER_ID "IAR"
390 # if defined(__VER__) && defined(__ICCARM__)
391 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
392 # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
393 # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
394 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
395 # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
396 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
397 # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
398 # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
399 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
402 #elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
403 # define COMPILER_ID "SDCC"
404 # if defined(__SDCC_VERSION_MAJOR)
405 # define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
406 # define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
407 # define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
410 # define COMPILER_VERSION_MAJOR DEC(SDCC/100)
411 # define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
412 # define COMPILER_VERSION_PATCH DEC(SDCC % 10)
419 #elif defined(__hpux) || defined(__hpua)
420 # define COMPILER_ID "HP"
423 # define COMPILER_ID ""
432 char const* info_simulate =
"INFO" ":" "simulate[" SIMULATE_ID
"]";
436 char const* qnxnto =
"INFO" ":" "qnxnto[]";
439 #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
440 char const *info_cray =
"INFO" ":" "compiler_wrapper[CrayPrgEnv]";
443 #define STRINGIFY_HELPER(X) #X
444 #define STRINGIFY(X) STRINGIFY_HELPER(X)
447 #if defined(__linux) || defined(__linux__) || defined(linux)
448 # define PLATFORM_ID "Linux"
450 #elif defined(__MSYS__)
451 # define PLATFORM_ID "MSYS"
453 #elif defined(__CYGWIN__)
454 # define PLATFORM_ID "Cygwin"
456 #elif defined(__MINGW32__)
457 # define PLATFORM_ID "MinGW"
459 #elif defined(__APPLE__)
460 # define PLATFORM_ID "Darwin"
462 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
463 # define PLATFORM_ID "Windows"
465 #elif defined(__FreeBSD__) || defined(__FreeBSD)
466 # define PLATFORM_ID "FreeBSD"
468 #elif defined(__NetBSD__) || defined(__NetBSD)
469 # define PLATFORM_ID "NetBSD"
471 #elif defined(__OpenBSD__) || defined(__OPENBSD)
472 # define PLATFORM_ID "OpenBSD"
474 #elif defined(__sun) || defined(sun)
475 # define PLATFORM_ID "SunOS"
477 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
478 # define PLATFORM_ID "AIX"
480 #elif defined(__hpux) || defined(__hpux__)
481 # define PLATFORM_ID "HP-UX"
483 #elif defined(__HAIKU__)
484 # define PLATFORM_ID "Haiku"
486 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
487 # define PLATFORM_ID "BeOS"
489 #elif defined(__QNX__) || defined(__QNXNTO__)
490 # define PLATFORM_ID "QNX"
492 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
493 # define PLATFORM_ID "Tru64"
495 #elif defined(__riscos) || defined(__riscos__)
496 # define PLATFORM_ID "RISCos"
498 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
499 # define PLATFORM_ID "SINIX"
501 #elif defined(__UNIX_SV__)
502 # define PLATFORM_ID "UNIX_SV"
504 #elif defined(__bsdos__)
505 # define PLATFORM_ID "BSDOS"
507 #elif defined(_MPRAS) || defined(MPRAS)
508 # define PLATFORM_ID "MP-RAS"
510 #elif defined(__osf) || defined(__osf__)
511 # define PLATFORM_ID "OSF1"
513 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
514 # define PLATFORM_ID "SCO_SV"
516 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
517 # define PLATFORM_ID "ULTRIX"
519 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
520 # define PLATFORM_ID "Xenix"
522 #elif defined(__WATCOMC__)
523 # if defined(__LINUX__)
524 # define PLATFORM_ID "Linux"
526 # elif defined(__DOS__)
527 # define PLATFORM_ID "DOS"
529 # elif defined(__OS2__)
530 # define PLATFORM_ID "OS2"
532 # elif defined(__WINDOWS__)
533 # define PLATFORM_ID "Windows3x"
535 # elif defined(__VXWORKS__)
536 # define PLATFORM_ID "VxWorks"
542 #elif defined(__INTEGRITY)
543 # if defined(INT_178B)
544 # define PLATFORM_ID "Integrity178"
547 # define PLATFORM_ID "Integrity"
550 # elif defined(_ADI_COMPILER)
551 # define PLATFORM_ID "ADSP"
563 #if defined(_WIN32) && defined(_MSC_VER)
564 # if defined(_M_IA64)
565 # define ARCHITECTURE_ID "IA64"
567 # elif defined(_M_ARM64EC)
568 # define ARCHITECTURE_ID "ARM64EC"
570 # elif defined(_M_X64) || defined(_M_AMD64)
571 # define ARCHITECTURE_ID "x64"
573 # elif defined(_M_IX86)
574 # define ARCHITECTURE_ID "X86"
576 # elif defined(_M_ARM64)
577 # define ARCHITECTURE_ID "ARM64"
579 # elif defined(_M_ARM)
581 # define ARCHITECTURE_ID "ARMV4I"
583 # define ARCHITECTURE_ID "ARMV5I"
585 # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
588 # elif defined(_M_MIPS)
589 # define ARCHITECTURE_ID "MIPS"
591 # elif defined(_M_SH)
592 # define ARCHITECTURE_ID "SHx"
595 # define ARCHITECTURE_ID ""
598 #elif defined(__WATCOMC__)
600 # define ARCHITECTURE_ID "I86"
602 # elif defined(_M_IX86)
603 # define ARCHITECTURE_ID "X86"
606 # define ARCHITECTURE_ID ""
609 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
610 # if defined(__ICCARM__)
611 # define ARCHITECTURE_ID "ARM"
613 # elif defined(__ICCRX__)
614 # define ARCHITECTURE_ID "RX"
616 # elif defined(__ICCRH850__)
617 # define ARCHITECTURE_ID "RH850"
619 # elif defined(__ICCRL78__)
620 # define ARCHITECTURE_ID "RL78"
622 # elif defined(__ICCRISCV__)
623 # define ARCHITECTURE_ID "RISCV"
625 # elif defined(__ICCAVR__)
626 # define ARCHITECTURE_ID "AVR"
628 # elif defined(__ICC430__)
629 # define ARCHITECTURE_ID "MSP430"
631 # elif defined(__ICCV850__)
632 # define ARCHITECTURE_ID "V850"
634 # elif defined(__ICC8051__)
635 # define ARCHITECTURE_ID "8051"
637 # elif defined(__ICCSTM8__)
638 # define ARCHITECTURE_ID "STM8"
641 # define ARCHITECTURE_ID ""
644 #elif defined(__ghs__)
645 # if defined(__PPC64__)
646 # define ARCHITECTURE_ID "PPC64"
648 # elif defined(__ppc__)
649 # define ARCHITECTURE_ID "PPC"
651 # elif defined(__ARM__)
652 # define ARCHITECTURE_ID "ARM"
654 # elif defined(__x86_64__)
655 # define ARCHITECTURE_ID "x64"
657 # elif defined(__i386__)
658 # define ARCHITECTURE_ID "X86"
661 # define ARCHITECTURE_ID ""
664 #elif defined(__TI_COMPILER_VERSION__)
665 # if defined(__TI_ARM__)
666 # define ARCHITECTURE_ID "ARM"
668 # elif defined(__MSP430__)
669 # define ARCHITECTURE_ID "MSP430"
671 # elif defined(__TMS320C28XX__)
672 # define ARCHITECTURE_ID "TMS320C28x"
674 # elif defined(__TMS320C6X__) || defined(_TMS320C6X)
675 # define ARCHITECTURE_ID "TMS320C6x"
678 # define ARCHITECTURE_ID ""
681 # elif defined(__ADSPSHARC__)
682 # define ARCHITECTURE_ID "SHARC"
684 # elif defined(__ADSPBLACKFIN__)
685 # define ARCHITECTURE_ID "Blackfin"
688 # define ARCHITECTURE_ID
693 ('0' + (((n) / 10000000)%10)), \
694 ('0' + (((n) / 1000000)%10)), \
695 ('0' + (((n) / 100000)%10)), \
696 ('0' + (((n) / 10000)%10)), \
697 ('0' + (((n) / 1000)%10)), \
698 ('0' + (((n) / 100)%10)), \
699 ('0' + (((n) / 10)%10)), \
704 ('0' + ((n)>>28 & 0xF)), \
705 ('0' + ((n)>>24 & 0xF)), \
706 ('0' + ((n)>>20 & 0xF)), \
707 ('0' + ((n)>>16 & 0xF)), \
708 ('0' + ((n)>>12 & 0xF)), \
709 ('0' + ((n)>>8 & 0xF)), \
710 ('0' + ((n)>>4 & 0xF)), \
714 #ifdef COMPILER_VERSION
715 char const* info_version =
"INFO" ":" "compiler_version[" COMPILER_VERSION
"]";
718 #elif defined(COMPILER_VERSION_MAJOR)
719 char const info_version[] = {
720 'I',
'N',
'F',
'O',
':',
721 'c',
'o',
'm',
'p',
'i',
'l',
'e',
'r',
'_',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'[',
722 COMPILER_VERSION_MAJOR,
723 # ifdef COMPILER_VERSION_MINOR
724 '.', COMPILER_VERSION_MINOR,
725 # ifdef COMPILER_VERSION_PATCH
726 '.', COMPILER_VERSION_PATCH,
727 # ifdef COMPILER_VERSION_TWEAK
728 '.', COMPILER_VERSION_TWEAK,
736 #ifdef COMPILER_VERSION_INTERNAL
737 char const info_version_internal[] = {
738 'I',
'N',
'F',
'O',
':',
739 'c',
'o',
'm',
'p',
'i',
'l',
'e',
'r',
'_',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'_',
740 'i',
'n',
't',
'e',
'r',
'n',
'a',
'l',
'[',
741 COMPILER_VERSION_INTERNAL,
']',
'\0'};
742 #elif defined(COMPILER_VERSION_INTERNAL_STR)
743 char const* info_version_internal =
"INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR
"]";
747 #ifdef SIMULATE_VERSION_MAJOR
748 char const info_simulate_version[] = {
749 'I',
'N',
'F',
'O',
':',
750 's',
'i',
'm',
'u',
'l',
'a',
't',
'e',
'_',
'v',
'e',
'r',
's',
'i',
'o',
'n',
'[',
751 SIMULATE_VERSION_MAJOR,
752 # ifdef SIMULATE_VERSION_MINOR
753 '.', SIMULATE_VERSION_MINOR,
754 # ifdef SIMULATE_VERSION_PATCH
755 '.', SIMULATE_VERSION_PATCH,
756 # ifdef SIMULATE_VERSION_TWEAK
757 '.', SIMULATE_VERSION_TWEAK,
773 #if !defined(__STDC__) && !defined(__clang__)
774 # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
775 # define C_VERSION "90"
779 #elif __STDC_VERSION__ > 201710L
780 # define C_VERSION "23"
781 #elif __STDC_VERSION__ >= 201710L
782 # define C_VERSION "17"
783 #elif __STDC_VERSION__ >= 201000L
784 # define C_VERSION "11"
785 #elif __STDC_VERSION__ >= 199901L
786 # define C_VERSION "99"
788 # define C_VERSION "90"
791 "INFO" ":" "standard_default[" C_VERSION "]";
794 #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
795 defined(__TI_COMPILER_VERSION__)) && \
796 !defined(__STRICT_ANSI__)
808 # if defined(__CLASSIC_C__)
818 #ifdef COMPILER_VERSION_MAJOR
819 require += info_version[argc];
821 #ifdef COMPILER_VERSION_INTERNAL
822 require += info_version_internal[argc];
825 require += info_simulate[argc];
827 #ifdef SIMULATE_VERSION_MAJOR
828 require += info_simulate_version[argc];
830 #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
831 require += info_cray[argc];
int main(int argc, char *argv[])
const char * info_language_extensions_default
char const * info_platform
const char * info_language_standard_default
char const * info_compiler
static static fork const void static count static fd const char const char static newpath char char argv