B15F Board 15 Famulus Edition

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