process-cpp: /build/process-cpp/src/process-cpp-3.0.1/build/CMakeFiles/3.19.2/CompilerIdC/CMakeCCompilerId.c Source File

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