pktools  2.6.7
Processing Kernel for geospatial data
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(__SCO_VERSION__)
176 # define COMPILER_ID "SCO"
177 
178 #elif defined(__clang__) && defined(__apple_build_version__)
179 # define COMPILER_ID "AppleClang"
180 # if defined(_MSC_VER)
181 # define SIMULATE_ID "MSVC"
182 # endif
183 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
184 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
185 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
186 # if defined(_MSC_VER)
187  /* _MSC_VER = VVRR */
188 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
189 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
190 # endif
191 # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
192 
193 #elif defined(__clang__)
194 # define COMPILER_ID "Clang"
195 # if defined(_MSC_VER)
196 # define SIMULATE_ID "MSVC"
197 # endif
198 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
199 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
200 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
201 # if defined(_MSC_VER)
202  /* _MSC_VER = VVRR */
203 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
204 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
205 # endif
206 
207 #elif defined(__GNUC__) || defined(__GNUG__)
208 # define COMPILER_ID "GNU"
209 # if defined(__GNUC__)
210 # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
211 # else
212 # define COMPILER_VERSION_MAJOR DEC(__GNUG__)
213 # endif
214 # if defined(__GNUC_MINOR__)
215 # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
216 # endif
217 # if defined(__GNUC_PATCHLEVEL__)
218 # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
219 # endif
220 
221 #elif defined(_MSC_VER)
222 # define COMPILER_ID "MSVC"
223  /* _MSC_VER = VVRR */
224 # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
225 # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
226 # if defined(_MSC_FULL_VER)
227 # if _MSC_VER >= 1400
228  /* _MSC_FULL_VER = VVRRPPPPP */
229 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
230 # else
231  /* _MSC_FULL_VER = VVRRPPPP */
232 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
233 # endif
234 # endif
235 # if defined(_MSC_BUILD)
236 # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
237 # endif
238 
239 #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
240 # define COMPILER_ID "ADSP"
241 #if defined(__VISUALDSPVERSION__)
242  /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
243 # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
244 # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
245 # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
246 #endif
247 
248 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
249 # define COMPILER_ID "IAR"
250 # if defined(__VER__)
251 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
252 # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
253 # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
254 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
255 # endif
256 
257 #elif defined(__ARMCC_VERSION)
258 # define COMPILER_ID "ARMCC"
259 #if __ARMCC_VERSION >= 1000000
260  /* __ARMCC_VERSION = VRRPPPP */
261  # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
262  # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
263  # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
264 #else
265  /* __ARMCC_VERSION = VRPPPP */
266  # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
267  # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
268  # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
269 #endif
270 
271 
272 #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
273 # define COMPILER_ID "MIPSpro"
274 # if defined(_SGI_COMPILER_VERSION)
275  /* _SGI_COMPILER_VERSION = VRP */
276 # define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
277 # define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
278 # define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10)
279 # else
280  /* _COMPILER_VERSION = VRP */
281 # define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
282 # define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
283 # define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10)
284 # endif
285 
286 
287 /* These compilers are either not known or too old to define an
288  identification macro. Try to identify the platform and guess that
289  it is the native compiler. */
290 #elif defined(__sgi)
291 # define COMPILER_ID "MIPSpro"
292 
293 #elif defined(__hpux) || defined(__hpua)
294 # define COMPILER_ID "HP"
295 
296 #else /* unknown compiler */
297 # define COMPILER_ID ""
298 #endif
299 
300 /* Construct the string literal in pieces to prevent the source from
301  getting matched. Store it in a pointer rather than an array
302  because some compilers will just produce instructions to fill the
303  array rather than assigning a pointer to a static array. */
304 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
305 #ifdef SIMULATE_ID
306 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
307 #endif
308 
309 #ifdef __QNXNTO__
310 char const* qnxnto = "INFO" ":" "qnxnto[]";
311 #endif
312 
313 #if defined(__CRAYXE) || defined(__CRAYXC)
314 char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
315 #endif
316 
317 #define STRINGIFY_HELPER(X) #X
318 #define STRINGIFY(X) STRINGIFY_HELPER(X)
319 
320 /* Identify known platforms by name. */
321 #if defined(__linux) || defined(__linux__) || defined(linux)
322 # define PLATFORM_ID "Linux"
323 
324 #elif defined(__CYGWIN__)
325 # define PLATFORM_ID "Cygwin"
326 
327 #elif defined(__MINGW32__)
328 # define PLATFORM_ID "MinGW"
329 
330 #elif defined(__APPLE__)
331 # define PLATFORM_ID "Darwin"
332 
333 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
334 # define PLATFORM_ID "Windows"
335 
336 #elif defined(__FreeBSD__) || defined(__FreeBSD)
337 # define PLATFORM_ID "FreeBSD"
338 
339 #elif defined(__NetBSD__) || defined(__NetBSD)
340 # define PLATFORM_ID "NetBSD"
341 
342 #elif defined(__OpenBSD__) || defined(__OPENBSD)
343 # define PLATFORM_ID "OpenBSD"
344 
345 #elif defined(__sun) || defined(sun)
346 # define PLATFORM_ID "SunOS"
347 
348 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
349 # define PLATFORM_ID "AIX"
350 
351 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
352 # define PLATFORM_ID "IRIX"
353 
354 #elif defined(__hpux) || defined(__hpux__)
355 # define PLATFORM_ID "HP-UX"
356 
357 #elif defined(__HAIKU__)
358 # define PLATFORM_ID "Haiku"
359 
360 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
361 # define PLATFORM_ID "BeOS"
362 
363 #elif defined(__QNX__) || defined(__QNXNTO__)
364 # define PLATFORM_ID "QNX"
365 
366 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
367 # define PLATFORM_ID "Tru64"
368 
369 #elif defined(__riscos) || defined(__riscos__)
370 # define PLATFORM_ID "RISCos"
371 
372 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
373 # define PLATFORM_ID "SINIX"
374 
375 #elif defined(__UNIX_SV__)
376 # define PLATFORM_ID "UNIX_SV"
377 
378 #elif defined(__bsdos__)
379 # define PLATFORM_ID "BSDOS"
380 
381 #elif defined(_MPRAS) || defined(MPRAS)
382 # define PLATFORM_ID "MP-RAS"
383 
384 #elif defined(__osf) || defined(__osf__)
385 # define PLATFORM_ID "OSF1"
386 
387 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
388 # define PLATFORM_ID "SCO_SV"
389 
390 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
391 # define PLATFORM_ID "ULTRIX"
392 
393 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
394 # define PLATFORM_ID "Xenix"
395 
396 #elif defined(__WATCOMC__)
397 # if defined(__LINUX__)
398 # define PLATFORM_ID "Linux"
399 
400 # elif defined(__DOS__)
401 # define PLATFORM_ID "DOS"
402 
403 # elif defined(__OS2__)
404 # define PLATFORM_ID "OS2"
405 
406 # elif defined(__WINDOWS__)
407 # define PLATFORM_ID "Windows3x"
408 
409 # else /* unknown platform */
410 # define PLATFORM_ID
411 # endif
412 
413 #else /* unknown platform */
414 # define PLATFORM_ID
415 
416 #endif
417 
418 /* For windows compilers MSVC and Intel we can determine
419  the architecture of the compiler being used. This is because
420  the compilers do not have flags that can change the architecture,
421  but rather depend on which compiler is being used
422 */
423 #if defined(_WIN32) && defined(_MSC_VER)
424 # if defined(_M_IA64)
425 # define ARCHITECTURE_ID "IA64"
426 
427 # elif defined(_M_X64) || defined(_M_AMD64)
428 # define ARCHITECTURE_ID "x64"
429 
430 # elif defined(_M_IX86)
431 # define ARCHITECTURE_ID "X86"
432 
433 # elif defined(_M_ARM64)
434 # define ARCHITECTURE_ID "ARM64"
435 
436 # elif defined(_M_ARM)
437 # if _M_ARM == 4
438 # define ARCHITECTURE_ID "ARMV4I"
439 # elif _M_ARM == 5
440 # define ARCHITECTURE_ID "ARMV5I"
441 # else
442 # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
443 # endif
444 
445 # elif defined(_M_MIPS)
446 # define ARCHITECTURE_ID "MIPS"
447 
448 # elif defined(_M_SH)
449 # define ARCHITECTURE_ID "SHx"
450 
451 # else /* unknown architecture */
452 # define ARCHITECTURE_ID ""
453 # endif
454 
455 #elif defined(__WATCOMC__)
456 # if defined(_M_I86)
457 # define ARCHITECTURE_ID "I86"
458 
459 # elif defined(_M_IX86)
460 # define ARCHITECTURE_ID "X86"
461 
462 # else /* unknown architecture */
463 # define ARCHITECTURE_ID ""
464 # endif
465 
466 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
467 # if defined(__ICCARM__)
468 # define ARCHITECTURE_ID "ARM"
469 
470 # elif defined(__ICCAVR__)
471 # define ARCHITECTURE_ID "AVR"
472 
473 # else /* unknown architecture */
474 # define ARCHITECTURE_ID ""
475 # endif
476 #else
477 # define ARCHITECTURE_ID
478 #endif
479 
480 /* Convert integer to decimal digit literals. */
481 #define DEC(n) \
482  ('0' + (((n) / 10000000)%10)), \
483  ('0' + (((n) / 1000000)%10)), \
484  ('0' + (((n) / 100000)%10)), \
485  ('0' + (((n) / 10000)%10)), \
486  ('0' + (((n) / 1000)%10)), \
487  ('0' + (((n) / 100)%10)), \
488  ('0' + (((n) / 10)%10)), \
489  ('0' + ((n) % 10))
490 
491 /* Convert integer to hex digit literals. */
492 #define HEX(n) \
493  ('0' + ((n)>>28 & 0xF)), \
494  ('0' + ((n)>>24 & 0xF)), \
495  ('0' + ((n)>>20 & 0xF)), \
496  ('0' + ((n)>>16 & 0xF)), \
497  ('0' + ((n)>>12 & 0xF)), \
498  ('0' + ((n)>>8 & 0xF)), \
499  ('0' + ((n)>>4 & 0xF)), \
500  ('0' + ((n) & 0xF))
501 
502 /* Construct a string literal encoding the version number components. */
503 #ifdef COMPILER_VERSION_MAJOR
504 char const info_version[] = {
505  'I', 'N', 'F', 'O', ':',
506  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
507  COMPILER_VERSION_MAJOR,
508 # ifdef COMPILER_VERSION_MINOR
509  '.', COMPILER_VERSION_MINOR,
510 # ifdef COMPILER_VERSION_PATCH
511  '.', COMPILER_VERSION_PATCH,
512 # ifdef COMPILER_VERSION_TWEAK
513  '.', COMPILER_VERSION_TWEAK,
514 # endif
515 # endif
516 # endif
517  ']','\0'};
518 #endif
519 
520 /* Construct a string literal encoding the internal version number. */
521 #ifdef COMPILER_VERSION_INTERNAL
522 char const info_version_internal[] = {
523  'I', 'N', 'F', 'O', ':',
524  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
525  'i','n','t','e','r','n','a','l','[',
526  COMPILER_VERSION_INTERNAL,']','\0'};
527 #endif
528 
529 /* Construct a string literal encoding the version number components. */
530 #ifdef SIMULATE_VERSION_MAJOR
531 char const info_simulate_version[] = {
532  'I', 'N', 'F', 'O', ':',
533  's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
534  SIMULATE_VERSION_MAJOR,
535 # ifdef SIMULATE_VERSION_MINOR
536  '.', SIMULATE_VERSION_MINOR,
537 # ifdef SIMULATE_VERSION_PATCH
538  '.', SIMULATE_VERSION_PATCH,
539 # ifdef SIMULATE_VERSION_TWEAK
540  '.', SIMULATE_VERSION_TWEAK,
541 # endif
542 # endif
543 # endif
544  ']','\0'};
545 #endif
546 
547 /* Construct the string literal in pieces to prevent the source from
548  getting matched. Store it in a pointer rather than an array
549  because some compilers will just produce instructions to fill the
550  array rather than assigning a pointer to a static array. */
551 char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
552 char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
553 
554 
555 
556 
557 #if defined(_MSC_VER) && defined(_MSVC_LANG)
558 #define CXX_STD _MSVC_LANG
559 #else
560 #define CXX_STD __cplusplus
561 #endif
562 
563 const char* info_language_dialect_default = "INFO" ":" "dialect_default["
564 #if CXX_STD > 201703L
565  "20"
566 #elif CXX_STD >= 201703L
567  "17"
568 #elif CXX_STD >= 201402L
569  "14"
570 #elif CXX_STD >= 201103L
571  "11"
572 #else
573  "98"
574 #endif
575 "]";
576 
577 /*--------------------------------------------------------------------------*/
578 
579 int main(int argc, char* argv[])
580 {
581  int require = 0;
582  require += info_compiler[argc];
583  require += info_platform[argc];
584 #ifdef COMPILER_VERSION_MAJOR
585  require += info_version[argc];
586 #endif
587 #ifdef COMPILER_VERSION_INTERNAL
588  require += info_version_internal[argc];
589 #endif
590 #ifdef SIMULATE_ID
591  require += info_simulate[argc];
592 #endif
593 #ifdef SIMULATE_VERSION_MAJOR
594  require += info_simulate_version[argc];
595 #endif
596 #if defined(__CRAYXE) || defined(__CRAYXC)
597  require += info_cray[argc];
598 #endif
599  require += info_language_dialect_default[argc];
600  (void)argv;
601  return require;
602 }