plibsys
pmacroscompiler.h
Go to the documentation of this file.
1 /*
2  * The MIT License
3  *
4  * Copyright (C) 2017-2023 Alexander Saprykin <saprykin.spb@gmail.com>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * 'Software'), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sublicense, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be
15  * included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 
39 #if !defined (PLIBSYS_H_INSIDE) && !defined (PLIBSYS_COMPILATION)
40 # error "Header files shouldn't be included directly, consider using <plibsys.h> instead."
41 #endif
42 
43 #ifndef PLIBSYS_HEADER_PMACROSCOMPILER_H
44 #define PLIBSYS_HEADER_PMACROSCOMPILER_H
45 
46 /*
47  * List of supported compilers (P_CC_x):
48  *
49  * MSVC - Microsoft Visual C/C++
50  * GNU - GNU C/C++
51  * MINGW - MinGW C/C++
52  * INTEL - Intel C/C++ (Classic)
53  * INTELX - Intel DPC++/C++
54  * CLANG - LLVM Clang C/C++
55  * SUN - Sun WorkShop/Studio C/C++
56  * XLC - IBM XL C/C++
57  * IXLC - IBM XL C/C++ (Clang-based)
58  * OXLC - IBM Open XL C/C++
59  * HP - HP C/aC++
60  * DEC - DEC C/C++
61  * MIPS - MIPSpro C/C++
62  * USLC - SCO OUDK and UDK C/C++
63  * WATCOM - Watcom C/C++
64  * BORLAND - Borland C/C++
65  * PGI - Portland Group C/C++
66  * CRAY - CRAY C/C++
67  */
68 
177 #if defined(_MSC_VER)
178 # define P_CC_MSVC
179 # if defined(__INTEL_COMPILER)
180 # define P_CC_INTEL
181 # endif
182 # if defined(__clang__)
183 # define P_CC_CLANG
184 # endif
185 # if defined(__INTEL_CLANG_COMPILER) || defined(__INTEL_LLVM_COMPILER)
186 # define P_CC_INTELX
187 # endif
188 #elif defined(__GNUC__)
189 # define P_CC_GNU
190 # if defined(__MINGW32__)
191 # define P_CC_MINGW
192 # endif
193 # if defined(__INTEL_COMPILER)
194 # define P_CC_INTEL
195 # endif
196 # if defined(__INTEL_CLANG_COMPILER) || defined(__INTEL_LLVM_COMPILER)
197 # define P_CC_INTELX
198 # endif
199 # if defined(__clang__)
200 # define P_CC_CLANG
201 # endif
202 # if defined(__PGI)
203 # define P_CC_PGI
204 # endif
205 # if defined(_CRAYC)
206 # define P_CC_CRAY
207 # endif
208 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
209 # define P_CC_SUN
210 #elif defined(__xlc__) || defined(__xlC__)
211 # define P_CC_XLC
212 # if defined(__ibmxl__)
213 # define P_CC_IXLC
214 # define P_CC_CLANG
215 # endif
216 #elif defined(__ibmxl__)
217 # define P_CC_IXLC
218 # define P_CC_CLANG
219 #elif defined(__open_xl__)
220 # define P_CC_OXLC
221 # define P_CC_CLANG
222 #elif defined(__HP_cc) || defined(__HP_aCC)
223 # define P_CC_HP
224 #elif defined (__DECC) || defined(__DECCXX)
225 # define P_CC_DEC
226 #elif (defined(__sgi) || defined(sgi)) && \
227  (defined(_COMPILER_VERSION) || defined(_SGI_COMPILER_VERSION))
228 # define P_CC_MIPS
229 #elif defined(__USLC__) && defined(__SCO_VERSION__)
230 # define P_CC_USLC
231 #elif defined(__WATCOMC__)
232 # define P_CC_WATCOM
233 #elif defined(__BORLANDC__)
234 # define P_CC_BORLAND
235 #elif defined(__INTEL_COMPILER)
236 # define P_CC_INTEL
237 #elif defined(__INTEL_CLANG_COMPILER) || defined(__INTEL_LLVM_COMPILER)
238 # define P_CC_INTELX
239 #elif defined(__PGI)
240 # define P_CC_PGI
241 #elif defined(_CRAYC)
242 # define P_CC_CRAY
243 #endif
244 
245 /* We need this to generate full Doxygen documentation */
246 
247 #ifdef DOXYGEN
248 # ifndef P_CC_MSVC
249 # define P_CC_MSVC
250 # endif
251 # ifndef P_CC_GNU
252 # define P_CC_GNU
253 # endif
254 # ifndef P_CC_MINGW
255 # define P_CC_MINGW
256 # endif
257 # ifndef P_CC_INTEL
258 # define P_CC_INTEL
259 # endif
260 # ifndef P_CC_INTELX
261 # define P_CC_INTELX
262 # endif
263 # ifndef P_CC_CLANG
264 # define P_CC_CLANG
265 # endif
266 # ifndef P_CC_SUN
267 # define P_CC_SUN
268 # endif
269 # ifndef P_CC_XLC
270 # define P_CC_XLC
271 # endif
272 # ifndef P_CC_IXLC
273 # define P_CC_IXLC
274 # endif
275 # ifndef P_CC_OXLC
276 # define P_CC_OXLC
277 # endif
278 # ifndef P_CC_HP
279 # define P_CC_HP
280 # endif
281 # ifndef P_CC_DEC
282 # define P_CC_DEC
283 # endif
284 # ifndef P_CC_MIPS
285 # define P_CC_MIPS
286 # endif
287 # ifndef P_CC_USLC
288 # define P_CC_USLC
289 # endif
290 # ifndef P_CC_WATCOM
291 # define P_CC_WATCOM
292 # endif
293 # ifndef P_CC_BORLAND
294 # define P_CC_BORLAND
295 # endif
296 # ifndef P_CC_PGI
297 # define P_CC_PGI
298 # endif
299 # ifndef P_CC_CRAY
300 # define P_CC_CRAY
301 # endif
302 #endif
303 
304 #endif /* PLIBSYS_HEADER_PMACROSCOMPILER_H */