maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
CMakeCXXCompilerId.cpp
Go to the documentation of this file.
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#if !defined(__has_include)
9/* If the compiler does not have __has_include, pretend the answer is
10 always no. */
11# define __has_include(x) 0
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 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 version 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(__open_xl__) && defined(__clang__)
176# define COMPILER_ID "IBMClang"
177# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
178# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
179# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
180# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
181# define COMPILER_VERSION_INTERNAL_STR __clang_version__
182
183
184#elif defined(__ibmxl__) && defined(__clang__)
185# define COMPILER_ID "XLClang"
186# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
187# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
188# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
189# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
190
191
192#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
193# define COMPILER_ID "XL"
194 /* __IBMCPP__ = VRP */
195# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
196# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
197# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
198
199#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
200# define COMPILER_ID "VisualAge"
201 /* __IBMCPP__ = VRP */
202# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
203# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
204# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
205
206#elif defined(__NVCOMPILER)
207# define COMPILER_ID "NVHPC"
208# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
209# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
210# if defined(__NVCOMPILER_PATCHLEVEL__)
211# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
212# endif
213
214#elif defined(__PGI)
215# define COMPILER_ID "PGI"
216# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
217# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
218# if defined(__PGIC_PATCHLEVEL__)
219# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
220# endif
221
222#elif defined(__clang__) && defined(__cray__)
223# define COMPILER_ID "CrayClang"
224# define COMPILER_VERSION_MAJOR DEC(__cray_major__)
225# define COMPILER_VERSION_MINOR DEC(__cray_minor__)
226# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
227# define COMPILER_VERSION_INTERNAL_STR __clang_version__
228
229
230#elif defined(_CRAYC)
231# define COMPILER_ID "Cray"
232# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
233# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
234
235#elif defined(__TI_COMPILER_VERSION__)
236# define COMPILER_ID "TI"
237 /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
238# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
239# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
240# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
241
242#elif defined(__CLANG_FUJITSU)
243# define COMPILER_ID "FujitsuClang"
244# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
245# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
246# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
247# define COMPILER_VERSION_INTERNAL_STR __clang_version__
248
249
250#elif defined(__FUJITSU)
251# define COMPILER_ID "Fujitsu"
252# if defined(__FCC_version__)
253# define COMPILER_VERSION __FCC_version__
254# elif defined(__FCC_major__)
255# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
256# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
257# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
258# endif
259# if defined(__fcc_version)
260# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
261# elif defined(__FCC_VERSION)
262# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
263# endif
264
265
266#elif defined(__ghs__)
267# define COMPILER_ID "GHS"
268/* __GHS_VERSION_NUMBER = VVVVRP */
269# ifdef __GHS_VERSION_NUMBER
270# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
271# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
272# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
273# endif
274
275#elif defined(__TASKING__)
276# define COMPILER_ID "Tasking"
277 # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
278 # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
279# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
280
281#elif defined(__ORANGEC__)
282# define COMPILER_ID "OrangeC"
283# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
284# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
285# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
286
287#elif defined(__RENESAS__)
288# define COMPILER_ID "Renesas"
289/* __RENESAS_VERSION__ = 0xVVRRPP00 */
290# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF)
291# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF)
292# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF)
293
294#elif defined(__SCO_VERSION__)
295# define COMPILER_ID "SCO"
296
297#elif defined(__ARMCC_VERSION) && !defined(__clang__)
298# define COMPILER_ID "ARMCC"
299#if __ARMCC_VERSION >= 1000000
300 /* __ARMCC_VERSION = VRRPPPP */
301 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
302 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
303 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
304#else
305 /* __ARMCC_VERSION = VRPPPP */
306 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
307 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
308 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
309#endif
310
311
312#elif defined(__clang__) && defined(__apple_build_version__)
313# define COMPILER_ID "AppleClang"
314# if defined(_MSC_VER)
315# define SIMULATE_ID "MSVC"
316# endif
317# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
318# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
319# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
320# if defined(_MSC_VER)
321 /* _MSC_VER = VVRR */
322# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
323# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
324# endif
325# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
326
327#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
328# define COMPILER_ID "ARMClang"
329 # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
330 # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
331 # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
332# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
333
334#elif defined(__clang__) && defined(__ti__)
335# define COMPILER_ID "TIClang"
336 # define COMPILER_VERSION_MAJOR DEC(__ti_major__)
337 # define COMPILER_VERSION_MINOR DEC(__ti_minor__)
338 # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
339# define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
340
341#elif defined(__clang__)
342# define COMPILER_ID "Clang"
343# if defined(_MSC_VER)
344# define SIMULATE_ID "MSVC"
345# endif
346# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
347# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
348# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
349# if defined(_MSC_VER)
350 /* _MSC_VER = VVRR */
351# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
352# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
353# endif
354
355#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
356# define COMPILER_ID "LCC"
357# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
358# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
359# if defined(__LCC_MINOR__)
360# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
361# endif
362# if defined(__GNUC__) && defined(__GNUC_MINOR__)
363# define SIMULATE_ID "GNU"
364# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
365# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
366# if defined(__GNUC_PATCHLEVEL__)
367# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
368# endif
369# endif
370
371#elif defined(__GNUC__) || defined(__GNUG__)
372# define COMPILER_ID "GNU"
373# if defined(__GNUC__)
374# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
375# else
376# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
377# endif
378# if defined(__GNUC_MINOR__)
379# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
380# endif
381# if defined(__GNUC_PATCHLEVEL__)
382# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
383# endif
384
385#elif defined(_MSC_VER)
386# define COMPILER_ID "MSVC"
387 /* _MSC_VER = VVRR */
388# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
389# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
390# if defined(_MSC_FULL_VER)
391# if _MSC_VER >= 1400
392 /* _MSC_FULL_VER = VVRRPPPPP */
393# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
394# else
395 /* _MSC_FULL_VER = VVRRPPPP */
396# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
397# endif
398# endif
399# if defined(_MSC_BUILD)
400# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
401# endif
402
403#elif defined(_ADI_COMPILER)
404# define COMPILER_ID "ADSP"
405#if defined(__VERSIONNUM__)
406 /* __VERSIONNUM__ = 0xVVRRPPTT */
407# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
408# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
409# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
410# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
411#endif
412
413#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
414# define COMPILER_ID "IAR"
415# if defined(__VER__) && defined(__ICCARM__)
416# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
417# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
418# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
419# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
420# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
421# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
422# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
423# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
424# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
425# endif
426
427#elif defined(__DCC__) && defined(_DIAB_TOOL)
428# define COMPILER_ID "Diab"
429 # define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__)
430 # define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__)
431 # define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__)
432 # define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__)
433
434
435
436/* These compilers are either not known or too old to define an
437 identification macro. Try to identify the platform and guess that
438 it is the native compiler. */
439#elif defined(__hpux) || defined(__hpua)
440# define COMPILER_ID "HP"
441
442#else /* unknown compiler */
443# define COMPILER_ID ""
444#endif
445
446/* Construct the string literal in pieces to prevent the source from
447 getting matched. Store it in a pointer rather than an array
448 because some compilers will just produce instructions to fill the
449 array rather than assigning a pointer to a static array. */
450 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
451#ifdef SIMULATE_ID
452 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
453#endif
454
455#ifdef __QNXNTO__
456 char const* qnxnto = "INFO" ":" "qnxnto[]";
457#endif
458
459#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
460 char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
461#endif
462
463#define STRINGIFY_HELPER(X) #X
464#define STRINGIFY(X) STRINGIFY_HELPER(X)
465
466/* Identify known platforms by name. */
467#if defined(__linux) || defined(__linux__) || defined(linux)
468# define PLATFORM_ID "Linux"
469
470#elif defined(__MSYS__)
471# define PLATFORM_ID "MSYS"
472
473#elif defined(__CYGWIN__)
474# define PLATFORM_ID "Cygwin"
475
476#elif defined(__MINGW32__)
477# define PLATFORM_ID "MinGW"
478
479#elif defined(__APPLE__)
480# define PLATFORM_ID "Darwin"
481
482#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
483# define PLATFORM_ID "Windows"
484
485#elif defined(__FreeBSD__) || defined(__FreeBSD)
486# define PLATFORM_ID "FreeBSD"
487
488#elif defined(__NetBSD__) || defined(__NetBSD)
489# define PLATFORM_ID "NetBSD"
490
491#elif defined(__OpenBSD__) || defined(__OPENBSD)
492# define PLATFORM_ID "OpenBSD"
493
494#elif defined(__sun) || defined(sun)
495# define PLATFORM_ID "SunOS"
496
497#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
498# define PLATFORM_ID "AIX"
499
500#elif defined(__hpux) || defined(__hpux__)
501# define PLATFORM_ID "HP-UX"
502
503#elif defined(__HAIKU__)
504# define PLATFORM_ID "Haiku"
505
506#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
507# define PLATFORM_ID "BeOS"
508
509#elif defined(__QNX__) || defined(__QNXNTO__)
510# define PLATFORM_ID "QNX"
511
512#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
513# define PLATFORM_ID "Tru64"
514
515#elif defined(__riscos) || defined(__riscos__)
516# define PLATFORM_ID "RISCos"
517
518#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
519# define PLATFORM_ID "SINIX"
520
521#elif defined(__UNIX_SV__)
522# define PLATFORM_ID "UNIX_SV"
523
524#elif defined(__bsdos__)
525# define PLATFORM_ID "BSDOS"
526
527#elif defined(_MPRAS) || defined(MPRAS)
528# define PLATFORM_ID "MP-RAS"
529
530#elif defined(__osf) || defined(__osf__)
531# define PLATFORM_ID "OSF1"
532
533#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
534# define PLATFORM_ID "SCO_SV"
535
536#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
537# define PLATFORM_ID "ULTRIX"
538
539#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
540# define PLATFORM_ID "Xenix"
541
542#elif defined(__WATCOMC__)
543# if defined(__LINUX__)
544# define PLATFORM_ID "Linux"
545
546# elif defined(__DOS__)
547# define PLATFORM_ID "DOS"
548
549# elif defined(__OS2__)
550# define PLATFORM_ID "OS2"
551
552# elif defined(__WINDOWS__)
553# define PLATFORM_ID "Windows3x"
554
555# elif defined(__VXWORKS__)
556# define PLATFORM_ID "VxWorks"
557
558# else /* unknown platform */
559# define PLATFORM_ID
560# endif
561
562#elif defined(__INTEGRITY)
563# if defined(INT_178B)
564# define PLATFORM_ID "Integrity178"
565
566# else /* regular Integrity */
567# define PLATFORM_ID "Integrity"
568# endif
569
570# elif defined(_ADI_COMPILER)
571# define PLATFORM_ID "ADSP"
572
573#else /* unknown platform */
574# define PLATFORM_ID
575
576#endif
577
578/* For windows compilers MSVC and Intel we can determine
579 the architecture of the compiler being used. This is because
580 the compilers do not have flags that can change the architecture,
581 but rather depend on which compiler is being used
582*/
583#if defined(_WIN32) && defined(_MSC_VER)
584# if defined(_M_IA64)
585# define ARCHITECTURE_ID "IA64"
586
587# elif defined(_M_ARM64EC)
588# define ARCHITECTURE_ID "ARM64EC"
589
590# elif defined(_M_X64) || defined(_M_AMD64)
591# define ARCHITECTURE_ID "x64"
592
593# elif defined(_M_IX86)
594# define ARCHITECTURE_ID "X86"
595
596# elif defined(_M_ARM64)
597# define ARCHITECTURE_ID "ARM64"
598
599# elif defined(_M_ARM)
600# if _M_ARM == 4
601# define ARCHITECTURE_ID "ARMV4I"
602# elif _M_ARM == 5
603# define ARCHITECTURE_ID "ARMV5I"
604# else
605# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
606# endif
607
608# elif defined(_M_MIPS)
609# define ARCHITECTURE_ID "MIPS"
610
611# elif defined(_M_SH)
612# define ARCHITECTURE_ID "SHx"
613
614# else /* unknown architecture */
615# define ARCHITECTURE_ID ""
616# endif
617
618#elif defined(__WATCOMC__)
619# if defined(_M_I86)
620# define ARCHITECTURE_ID "I86"
621
622# elif defined(_M_IX86)
623# define ARCHITECTURE_ID "X86"
624
625# else /* unknown architecture */
626# define ARCHITECTURE_ID ""
627# endif
628
629#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
630# if defined(__ICCARM__)
631# define ARCHITECTURE_ID "ARM"
632
633# elif defined(__ICCRX__)
634# define ARCHITECTURE_ID "RX"
635
636# elif defined(__ICCRH850__)
637# define ARCHITECTURE_ID "RH850"
638
639# elif defined(__ICCRL78__)
640# define ARCHITECTURE_ID "RL78"
641
642# elif defined(__ICCRISCV__)
643# define ARCHITECTURE_ID "RISCV"
644
645# elif defined(__ICCAVR__)
646# define ARCHITECTURE_ID "AVR"
647
648# elif defined(__ICC430__)
649# define ARCHITECTURE_ID "MSP430"
650
651# elif defined(__ICCV850__)
652# define ARCHITECTURE_ID "V850"
653
654# elif defined(__ICC8051__)
655# define ARCHITECTURE_ID "8051"
656
657# elif defined(__ICCSTM8__)
658# define ARCHITECTURE_ID "STM8"
659
660# else /* unknown architecture */
661# define ARCHITECTURE_ID ""
662# endif
663
664#elif defined(__ghs__)
665# if defined(__PPC64__)
666# define ARCHITECTURE_ID "PPC64"
667
668# elif defined(__ppc__)
669# define ARCHITECTURE_ID "PPC"
670
671# elif defined(__ARM__)
672# define ARCHITECTURE_ID "ARM"
673
674# elif defined(__x86_64__)
675# define ARCHITECTURE_ID "x64"
676
677# elif defined(__i386__)
678# define ARCHITECTURE_ID "X86"
679
680# else /* unknown architecture */
681# define ARCHITECTURE_ID ""
682# endif
683
684#elif defined(__clang__) && defined(__ti__)
685# if defined(__ARM_ARCH)
686# define ARCHITECTURE_ID "ARM"
687
688# else /* unknown architecture */
689# define ARCHITECTURE_ID ""
690# endif
691
692#elif defined(__TI_COMPILER_VERSION__)
693# if defined(__TI_ARM__)
694# define ARCHITECTURE_ID "ARM"
695
696# elif defined(__MSP430__)
697# define ARCHITECTURE_ID "MSP430"
698
699# elif defined(__TMS320C28XX__)
700# define ARCHITECTURE_ID "TMS320C28x"
701
702# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
703# define ARCHITECTURE_ID "TMS320C6x"
704
705# else /* unknown architecture */
706# define ARCHITECTURE_ID ""
707# endif
708
709# elif defined(__ADSPSHARC__)
710# define ARCHITECTURE_ID "SHARC"
711
712# elif defined(__ADSPBLACKFIN__)
713# define ARCHITECTURE_ID "Blackfin"
714
715#elif defined(__TASKING__)
716
717# if defined(__CTC__) || defined(__CPTC__)
718# define ARCHITECTURE_ID "TriCore"
719
720# elif defined(__CMCS__)
721# define ARCHITECTURE_ID "MCS"
722
723# elif defined(__CARM__) || defined(__CPARM__)
724# define ARCHITECTURE_ID "ARM"
725
726# elif defined(__CARC__)
727# define ARCHITECTURE_ID "ARC"
728
729# elif defined(__C51__)
730# define ARCHITECTURE_ID "8051"
731
732# elif defined(__CPCP__)
733# define ARCHITECTURE_ID "PCP"
734
735# else
736# define ARCHITECTURE_ID ""
737# endif
738
739#elif defined(__RENESAS__)
740# if defined(__CCRX__)
741# define ARCHITECTURE_ID "RX"
742
743# elif defined(__CCRL__)
744# define ARCHITECTURE_ID "RL78"
745
746# elif defined(__CCRH__)
747# define ARCHITECTURE_ID "RH850"
748
749# else
750# define ARCHITECTURE_ID ""
751# endif
752
753#else
754# define ARCHITECTURE_ID
755#endif
756
757/* Convert integer to decimal digit literals. */
758#define DEC(n) \
759 ('0' + (((n) / 10000000)%10)), \
760 ('0' + (((n) / 1000000)%10)), \
761 ('0' + (((n) / 100000)%10)), \
762 ('0' + (((n) / 10000)%10)), \
763 ('0' + (((n) / 1000)%10)), \
764 ('0' + (((n) / 100)%10)), \
765 ('0' + (((n) / 10)%10)), \
766 ('0' + ((n) % 10))
767
768/* Convert integer to hex digit literals. */
769#define HEX(n) \
770 ('0' + ((n)>>28 & 0xF)), \
771 ('0' + ((n)>>24 & 0xF)), \
772 ('0' + ((n)>>20 & 0xF)), \
773 ('0' + ((n)>>16 & 0xF)), \
774 ('0' + ((n)>>12 & 0xF)), \
775 ('0' + ((n)>>8 & 0xF)), \
776 ('0' + ((n)>>4 & 0xF)), \
777 ('0' + ((n) & 0xF))
778
779/* Construct a string literal encoding the version number. */
780#ifdef COMPILER_VERSION
781 char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
782
783/* Construct a string literal encoding the version number components. */
784#elif defined(COMPILER_VERSION_MAJOR)
785 char const info_version[] = {
786 'I', 'N', 'F', 'O', ':',
787 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
788 COMPILER_VERSION_MAJOR,
789# ifdef COMPILER_VERSION_MINOR
790 '.', COMPILER_VERSION_MINOR,
791# ifdef COMPILER_VERSION_PATCH
792 '.', COMPILER_VERSION_PATCH,
793# ifdef COMPILER_VERSION_TWEAK
794 '.', COMPILER_VERSION_TWEAK,
795# endif
796# endif
797# endif
798 ']','\0'};
799#endif
800
801/* Construct a string literal encoding the internal version number. */
802#ifdef COMPILER_VERSION_INTERNAL
803 char const info_version_internal[] = {
804 'I', 'N', 'F', 'O', ':',
805 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
806 'i','n','t','e','r','n','a','l','[',
807 COMPILER_VERSION_INTERNAL,']','\0'};
808#elif defined(COMPILER_VERSION_INTERNAL_STR)
809 char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
810#endif
811
812/* Construct a string literal encoding the version number components. */
813#ifdef SIMULATE_VERSION_MAJOR
814 char const info_simulate_version[] = {
815 'I', 'N', 'F', 'O', ':',
816 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
817 SIMULATE_VERSION_MAJOR,
818# ifdef SIMULATE_VERSION_MINOR
819 '.', SIMULATE_VERSION_MINOR,
820# ifdef SIMULATE_VERSION_PATCH
821 '.', SIMULATE_VERSION_PATCH,
822# ifdef SIMULATE_VERSION_TWEAK
823 '.', SIMULATE_VERSION_TWEAK,
824# endif
825# endif
826# endif
827 ']','\0'};
828#endif
829
830/* Construct the string literal in pieces to prevent the source from
831 getting matched. Store it in a pointer rather than an array
832 because some compilers will just produce instructions to fill the
833 array rather than assigning a pointer to a static array. */
834 char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
835 char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
836
837
838
839#define CXX_STD_98 199711L
840#define CXX_STD_11 201103L
841#define CXX_STD_14 201402L
842#define CXX_STD_17 201703L
843#define CXX_STD_20 202002L
844#define CXX_STD_23 202302L
845
846#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
847# if _MSVC_LANG > CXX_STD_17
848# define CXX_STD _MSVC_LANG
849# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
850# define CXX_STD CXX_STD_20
851# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
852# define CXX_STD CXX_STD_20
853# elif _MSVC_LANG > CXX_STD_14
854# define CXX_STD CXX_STD_17
855# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
856# define CXX_STD CXX_STD_14
857# elif defined(__INTEL_CXX11_MODE__)
858# define CXX_STD CXX_STD_11
859# else
860# define CXX_STD CXX_STD_98
861# endif
862#elif defined(_MSC_VER) && defined(_MSVC_LANG)
863# if _MSVC_LANG > __cplusplus
864# define CXX_STD _MSVC_LANG
865# else
866# define CXX_STD __cplusplus
867# endif
868#elif defined(__NVCOMPILER)
869# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
870# define CXX_STD CXX_STD_20
871# else
872# define CXX_STD __cplusplus
873# endif
874#elif defined(__INTEL_COMPILER) || defined(__PGI)
875# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
876# define CXX_STD CXX_STD_17
877# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
878# define CXX_STD CXX_STD_14
879# else
880# define CXX_STD __cplusplus
881# endif
882#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
883# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
884# define CXX_STD CXX_STD_14
885# else
886# define CXX_STD __cplusplus
887# endif
888#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
889# define CXX_STD CXX_STD_11
890#else
891# define CXX_STD __cplusplus
892#endif
893
894 const char* info_language_standard_default = "INFO" ":" "standard_default["
895#if CXX_STD > CXX_STD_23
896 "26"
897#elif CXX_STD > CXX_STD_20
898 "23"
899#elif CXX_STD > CXX_STD_17
900 "20"
901#elif CXX_STD > CXX_STD_14
902 "17"
903#elif CXX_STD > CXX_STD_11
904 "14"
905#elif CXX_STD >= CXX_STD_11
906 "11"
907#else
908 "98"
909#endif
910"]";
911
912 const char* info_language_extensions_default = "INFO" ":" "extensions_default["
913#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
914 defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \
915 !defined(__STRICT_ANSI__)
916 "ON"
917#else
918 "OFF"
919#endif
920"]";
921
922/*--------------------------------------------------------------------------*/
923
924 int main(int argc, char* argv[])
925{
926 int require = 0;
927 require += info_compiler[argc];
928 require += info_platform[argc];
929 require += info_arch[argc];
930#ifdef COMPILER_VERSION_MAJOR
931 require += info_version[argc];
932#endif
933#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR)
934 require += info_version_internal[argc];
935#endif
936#ifdef SIMULATE_ID
937 require += info_simulate[argc];
938#endif
939#ifdef SIMULATE_VERSION_MAJOR
940 require += info_simulate_version[argc];
941#endif
942#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
943 require += info_cray[argc];
944#endif
945 require += info_language_standard_default[argc];
946 require += info_language_extensions_default[argc];
947 (void)argv;
948 return require;
949}
info_language_extensions_default
const char * info_language_extensions_default
Definition CMakeCXXCompilerId.cpp:912
info_platform
char const * info_platform
Definition CMakeCXXCompilerId.cpp:834
info_language_standard_default
const char * info_language_standard_default
Definition CMakeCXXCompilerId.cpp:894
info_compiler
char const * info_compiler
Definition CMakeCXXCompilerId.cpp:450
info_arch
char const * info_arch
Definition CMakeCXXCompilerId.cpp:835
COMPILER_ID
#define COMPILER_ID
Definition CMakeCXXCompilerId.cpp:443
ARCHITECTURE_ID
#define ARCHITECTURE_ID
Definition CMakeCXXCompilerId.cpp:754
PLATFORM_ID
#define PLATFORM_ID
Definition CMakeCXXCompilerId.cpp:574
main
int main()
Definition echo_server.c:122