|
1 | 1 | # Compilers |
2 | 2 | ## Source |
3 | | -include/platform_predef/compilers.h |
| 3 | +src/compilers.h |
4 | 4 | ## Content |
5 | | -## \_\_has_xxx_compiler\_\_ |
| 5 | +### \_\_has_xxx_compiler\_\_ |
6 | 6 | #### Type |
7 | 7 | macros |
8 | 8 | #### Description |
9 | 9 | 1 if there is a corresponding compiler, otherwise 0. |
10 | | -The 'xxx' here refers to the compiler name, and details can be found in the 'src/lpcomps.h' source code. |
| 10 | +The 'xxx' here refers to the compiler name, and details can be found in the 'src/compilers.h' source code. |
11 | 11 |
|
12 | | -**Note: An environment may contain multiple compiler environments** |
| 12 | +**Note: An environment may contain multiple compiler environments.** |
13 | 13 | #### Usage |
14 | 14 | ```c |
15 | | -#include <cppp/libplatform.h> |
| 15 | +#include <cppp/cppp-platform.h> |
16 | 16 | #if __has_msvc_compiler__ |
17 | | -#error "You are compile with MSVC!" |
| 17 | +#error "This project do not support MSVC!" |
18 | 18 | #endif |
19 | 19 | int main(){} |
20 | 20 | ``` |
21 | | -#### Prototype |
22 | | -```c |
23 | | -/*ACC*/ |
24 | | -#define __has_acc_compiler__ 0 |
25 | | -/*Altium MicroBlaze C*/ |
26 | | -#define __has_has_altium_microblaze_c_compiler__ 0 |
27 | | -/*Altium C-to-Hardware*/ |
28 | | -#define __has_altium_c_to_hardware_compiler__ 0 |
29 | | -/*Amsterdam Compiler Kit*/ |
30 | | -#define __has_amsterdam_compiler__ 0 |
31 | | -/*ARM Compiler*/ |
32 | | -#define __has_arm_compiler__ 0 |
33 | | -/*Aztec C*/ |
34 | | -#define __has_aztec_c_compiler__ 0 |
35 | | -/*Borland C/C++*/ |
36 | | -#define __has_borland_compiler__ 0 |
37 | | -/*CC65*/ |
38 | | -#define __has_cc65_compiler__ 0 |
39 | | -/*Clang*/ |
40 | | -#define __has_clang_compiler__ 0 |
41 | | -/*Comeau*/ |
42 | | -#define __has_comeau_compiler__ 0 |
43 | | -/*Compaq C/C++*/ |
44 | | -#define __has_compaq_compiler__ 0 |
45 | | -/*Convex C*/ |
46 | | -#define __has_convex_c_compiler__ 0 |
47 | | -/*CompCert*/ |
48 | | -#define __has_compcert_compiler__ 0 |
49 | | -/*Coverity C/C++ Static Analyzer*/ |
50 | | -#define __has_coverity_compiler__ 0 |
51 | | -/*Cray C*/ |
52 | | -#define __has_cray_c_compiler__ 0 |
53 | | -/*Diab C/C++*/ |
54 | | -#define __has_diab_compiler__ 0 |
55 | | -/*DICE C*/ |
56 | | -#define __has_dice_c_compiler__ 0 |
57 | | -/*Digital Mars*/ |
58 | | -#define __has_digital_mars_compiler__ 0 |
59 | | -/*Dignus Systems/C++*/ |
60 | | -#define __has_dignus_systems_compiler__ 0 |
61 | | -/*DJGPP*/ |
62 | | -#define __has_djgpp_compiler__ 0 |
63 | | -/*EDG C++ Frontend*/ |
64 | | -#define __has_edg_compiler__ 0 |
65 | | -/*EKOPath*/ |
66 | | -#define __has_ekopath_compiler__ 0 |
67 | | -/*Fujitsu C++*/ |
68 | | -#define __has_fujitsu_compiler__ 0 |
69 | | -/*GCC C/C++*/ |
70 | | -#define __has_gcc_compiler__ 0 |
71 | | -/*Green Hill C/C++*/ |
72 | | -#define __has_greenhill_compiler__ 0 |
73 | | -/*HP ANSI C*/ |
74 | | -#define __has_hpansi_c_compiler__ 0 |
75 | | -/*HP aC++*/ |
76 | | -#define __has_hpa_compiler__ 0 |
77 | | -/*IAR C/C++*/ |
78 | | -#define __has_iar_compiler__ 0 |
79 | | -/*ImageCraft C*/ |
80 | | -#define __has_imagecraft_c_compiler__ 0 |
81 | | -/*Intel C/C++*/ |
82 | | -#define __has_intel_compiler__ 0 |
83 | | -/*KAI C++*/ |
84 | | -#define __has_kai_compiler__ 0 |
85 | | -/*KEIL CARM*/ |
86 | | -#define __has_keil_carm_compiler__ 0 |
87 | | -/*KEIL C166*/ |
88 | | -#define __has_keil_c166_compiler__ 0 |
89 | | -/*KEIL C51*/ |
90 | | -#define __has_keil_c51_compiler__ 0 |
91 | | -/*LCC*/ |
92 | | -#define __has_lcc_compiler__ 0 |
93 | | -/*LLVM*/ |
94 | | -#define __has_llvm_compiler__ 0 |
95 | | -/*MetaWare High C/C++*/ |
96 | | -#define __has_metaware_high_compiler__ 0 |
97 | | -/*Metrowerks CodeWarrior*/ |
98 | | -#define __has_metrowerks_codewarrior_compiler__ 0 |
99 | | -/*Microsoft Visual C++*/ |
100 | | -#define __has_msvc_compiler__ 0 |
101 | | -/*Microtec C/C++*/ |
102 | | -#define __has_microtec_compiler__ 0 |
103 | | -/*Microway NDP C*/ |
104 | | -#define __has_microway_ndp_c_compiler__ 0 |
105 | | -/*MinGW*/ |
106 | | -#define __has_mingw_compiler__ 0 |
107 | | -/*MIPSpro*/ |
108 | | -#define __has_mipspro_compiler__ 0 |
109 | | -/*Miracle C*/ |
110 | | -#define __has_miracle_c_compiler__ 0 |
111 | | -/*MPW C++*/ |
112 | | -#define __has_mpr_compiler__ 0 |
113 | | -/*Norcroft C*/ |
114 | | -#define __has_norcroft_c_compiler__ 0 |
115 | | -/*NWCC*/ |
116 | | -#define __has_nwcc_compiler__ 0 |
117 | | -/*Open64*/ |
118 | | -#define __has_open64_compiler__ 0 |
119 | | -/*Oracle Pro*C Precompiler*/ |
120 | | -#define __has_oracle_pro_compiler__ 0 |
121 | | -/*Oracle Solaris Studio*/ |
122 | | -#define __has_oracle_solaris_studio_compiler__ 0 |
123 | | -/*Pacific C*/ |
124 | | -#define __has_pacific_c_compiler__ 0 |
125 | | -/*Palm C/C++*/ |
126 | | -#define __has_palm_compiler__ 0 |
127 | | -/*Pelles C*/ |
128 | | -#define __has_pelles_c_compiler__ 0 |
129 | | -/*Portland Group C/C++*/ |
130 | | -#define __has_portland_group_compiler__ 0 |
131 | | -/*Renesas C/C++*/ |
132 | | -#define __has_renesas_compiler__ 0 |
133 | | -/*SAS/C*/ |
134 | | -#define __has_sas_c_compiler__ 0 |
135 | | -/*SCO OpenServer*/ |
136 | | -#define __has_sco_compiler__ 0 |
137 | | -/*Small Device C Compiler*/ |
138 | | -#define __has_small_device_compiler__ 0 |
139 | | -/*SN Compiler*/ |
140 | | -#define __has_sn_compiler__ 0 |
141 | | -/*Stratus VOS C*/ |
142 | | -#define __has_stratus_vos_c_compiler__ 0 |
143 | | -/*Symantec C++*/ |
144 | | -#define __has_symantec_compiler__ 0 |
145 | | -/*TenDRA C/C++*/ |
146 | | -#define __has_tendra_compiler__ 0 |
147 | | -/*Texas Instruments C/C++ Compiler*/ |
148 | | -#define __has_texas_instruments_compiler__ 0 |
149 | | -/*THINK C*/ |
150 | | -#define __has_think_c_compiler__ 0 |
151 | | -/*Tiny C*/ |
152 | | -#define __has_tiny_c_compiler__ 0 |
153 | | -/*Turbo C/C++*/ |
154 | | -#define __has_turboc_compiler__ 0 |
155 | | -/*Ultimate C/C++*/ |
156 | | -#define __has_ultimate_compiler__ 0 |
157 | | -/*USL C*/ |
158 | | -#define __has_usl_c_compiler__ 0 |
159 | | -/*VBCC*/ |
160 | | -#define __has_vbcc_compiler__ 0 |
161 | | -/*Watcom C++*/ |
162 | | -#define __has_watcom_compiler__ 0 |
163 | | -/*Zortech C++*/ |
164 | | -#define __has_zortech_compiler__ 0 |
165 | | -``` |
| 21 | +#### We provide preset compiler macros |
| 22 | +| Compiler | Macro | |
| 23 | +| :----: | :----: | |
| 24 | +| ACC | \_\_has_acc_compiler\_\_ | |
| 25 | +| Altium MicroBlaze C | \_\_has_has_altium_microblaze_c_compiler\_\_ | |
| 26 | +| Altium C-to-Hardware | \_\_has_altium_c_to_hardware_compiler\_\_ | |
| 27 | +| Amsterdam Compiler Kit | \_\_has_amsterdam_compiler\_\_ | |
| 28 | +| ARM Compiler | \_\_has_arm_compiler\_\_ | |
| 29 | +| Aztec C | \_\_has_aztec_c_compiler\_\_ | |
| 30 | +| Borland C/C++ | \_\_has_borland_compiler\_\_ | |
| 31 | +| CC65 | \_\_has_cc65_compiler\_\_ | |
| 32 | +| Clang | \_\_has_clang_compiler\_\_ | |
| 33 | +| Comeau | \_\_has_comeau_compiler\_\_ | |
| 34 | +| Compaq C/C++ | \_\_has_compaq_compiler\_\_ | |
| 35 | +| Convex C | \_\_has_convex_c_compiler\_\_ | |
| 36 | +| CompCert | \_\_has_compcert_compiler\_\_ | |
| 37 | +| Coverity C/C++ Static Analyzer | \_\_has_coverity_compiler\_\_ | |
| 38 | +| Cray C | \_\_has_cray_c_compiler\_\_ | |
| 39 | +| Diab C/C++ | \_\_has_diab_compiler\_\_ | |
| 40 | +| DICE C | \_\_has_dice_c_compiler\_\_ | |
| 41 | +| Digital Mars | \_\_has_digital_mars_compiler\_\_ | |
| 42 | +| Dignus Systems/C++ | \_\_has_dignus_systems_compiler\_\_ | |
| 43 | +| DJGPP | \_\_has_djgpp_compiler\_\_ | |
| 44 | +| EDG C++ Frontend | \_\_has_edg_compiler\_\_ | |
| 45 | +| EKOPath | \_\_has_ekopath_compiler\_\_ | |
| 46 | +| Fujitsu C++ | \_\_has_fujitsu_compiler\_\_ | |
| 47 | +| GCC C/C++ | \_\_has_gcc_compiler\_\_ | |
| 48 | +| Green Hill C/C++ | \_\_has_greenhill_compiler\_\_ | |
| 49 | +| HP ANSI C | \_\_has_hpansi_c_compiler\_\_ | |
| 50 | +| HP aC++ | \_\_has_hpa_compiler\_\_ | |
| 51 | +| IAR C/C++ | \_\_has_iar_compiler\_\_ | |
| 52 | +| ImageCraft C | \_\_has_imagecraft_c_compiler\_\_ | |
| 53 | +| Intel C/C++ | \_\_has_intel_compiler\_\_ | |
| 54 | +| KAI C++ | \_\_has_kai_compiler\_\_ | |
| 55 | +| KEIL CARM | \_\_has_keil_carm_compiler\_\_ | |
| 56 | +| KEIL C166 | \_\_has_keil_c166_compiler\_\_ | |
| 57 | +| KEIL C51 | \_\_has_keil_c51_compiler\_\_ | |
| 58 | +| LCC | \_\_has_lcc_compiler\_\_ | |
| 59 | +| LLVM | \_\_has_llvm_compiler\_\_ | |
| 60 | +| MetaWare High C/C++ | \_\_has_metaware_high_compiler\_\_ | |
| 61 | +| Metrowerks CodeWarrior | \_\_has_metrowerks_codewarrior_compiler\_\_ | |
| 62 | +| Microsoft Visual C++ | \_\_has_msvc_compiler\_\_ | |
| 63 | +| Microtec C/C++ | \_\_has_microtec_compiler\_\_ | |
| 64 | +| Microway NDP C | \_\_has_microway_ndp_c_compiler\_\_ | |
| 65 | +| MinGW | \_\_has_mingw_compiler\_\_ | |
| 66 | +| MIPSpro | \_\_has_mipspro_compiler\_\_ | |
| 67 | +| Miracle C | \_\_has_miracle_c_compiler\_\_ | |
| 68 | +| MPW C++ | \_\_has_mpr_compiler\_\_ | |
| 69 | +| Norcroft C | \_\_has_norcroft_c_compiler\_\_ | |
| 70 | +| NWCC | \_\_has_nwcc_compiler\_\_ | |
| 71 | +| Open64 | \_\_has_open64_compiler\_\_ | |
| 72 | +| Oracle Pro*C Precompiler | \_\_has_oracle_pro_compiler\_\_ | |
| 73 | +| Oracle Solaris Studio | \_\_has_oracle_solaris_studio_compiler\_\_ | |
| 74 | +| Pacific C | \_\_has_pacific_c_compiler\_\_ | |
| 75 | +| Palm C/C++ | \_\_has_palm_compiler\_\_ | |
| 76 | +| Pelles C | \_\_has_pelles_c_compiler\_\_ | |
| 77 | +| Portland Group C/C++ | \_\_has_portland_group_compiler\_\_ | |
| 78 | +| Renesas C/C++ | \_\_has_renesas_compiler\_\_ | |
| 79 | +| SAS/C | \_\_has_sas_c_compiler\_\_ | |
| 80 | +| SCO OpenServer | \_\_has_sco_compiler\_\_ | |
| 81 | +| Small Device C Compiler | \_\_has_small_device_compiler\_\_ | |
| 82 | +| SN Compiler | \_\_has_sn_compiler\_\_ | |
| 83 | +| Stratus VOS C | \_\_has_stratus_vos_c_compiler\_\_ | |
| 84 | +| Symantec C++ | \_\_has_symantec_compiler\_\_ | |
| 85 | +| TenDRA C/C++ | \_\_has_tendra_compiler\_\_ | |
| 86 | +| Texas Instruments C/C++ Compiler | \_\_has_texas_instruments_compiler\_\_ | |
| 87 | +| THINK C | \_\_has_think_c_compiler\_\_ | |
| 88 | +| Tiny C | \_\_has_tiny_c_compiler\_\_ | |
| 89 | +| Turbo C/C++ | \_\_has_turboc_compiler\_\_ | |
| 90 | +| Ultimate C/C++ | \_\_has_ultimate_compiler\_\_ | |
| 91 | +| USL C | \_\_has_usl_c_compiler\_\_ | |
| 92 | +| VBCC | \_\_has_vbcc_compiler\_\_ | |
| 93 | +| Watcom C++ | \_\_has_watcom_compiler\_\_ | |
| 94 | +| Zortech C++ | \_\_has_zortech_compiler\_\_ | |
0 commit comments