plibsys
pmacroscompiler.h
Go to the documentation of this file.
1 /*
2  * The MIT License
3  *
4  * Copyright (C) 2017 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++
53  * CLANG - LLVM Clang C/C++
54  * SUN - Sun WorkShop/Studio C/C++
55  * XLC - IBM XL C/C++
56  * HP - HP C/aC++
57  * DEC - DEC C/C++
58  * MIPS - MIPSpro C/C++
59  * USLC - SCO OUDK and UDK C/C++
60  * WATCOM - Watcom C/C++
61  * BORLAND - Borland C/C++
62  * PGI - Portland Group C/C++
63  * CRAY - CRAY C/C++
64  */
65 
156 #if defined(_MSC_VER)
157 # define P_CC_MSVC
158 # if defined(__INTEL_COMPILER)
159 # define P_CC_INTEL
160 # endif
161 # if defined(__clang__)
162 # define P_CC_CLANG
163 # endif
164 #elif defined(__GNUC__)
165 # define P_CC_GNU
166 # if defined(__MINGW32__)
167 # define P_CC_MINGW
168 # endif
169 # if defined(__INTEL_COMPILER)
170 # define P_CC_INTEL
171 # endif
172 # if defined(__clang__)
173 # define P_CC_CLANG
174 # endif
175 # if defined(_CRAYC)
176 # define P_CC_CRAY
177 # endif
178 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
179 # define P_CC_SUN
180 #elif defined(__xlc__) || defined(__xlC__)
181 # define P_CC_XLC
182 #elif defined(__HP_cc) || defined(__HP_aCC)
183 # define P_CC_HP
184 #elif defined (__DECC) || defined(__DECCXX)
185 # define P_CC_DEC
186 #elif (defined(__sgi) || defined(sgi)) && \
187  (defined(_COMPILER_VERSION) || defined(_SGI_COMPILER_VERSION))
188 # define P_CC_MIPS
189 #elif defined(__USLC__) && defined(__SCO_VERSION__)
190 # define P_CC_USLC
191 #elif defined(__WATCOMC__)
192 # define P_CC_WATCOM
193 #elif defined(__BORLANDC__)
194 # define P_CC_BORLAND
195 #elif defined(__INTEL_COMPILER)
196 # define P_CC_INTEL
197 #elif defined(__PGI)
198 # define P_CC_PGI
199 #elif defined(_CRAYC)
200 # define P_CC_CRAY
201 #endif
202 
203 /* We need this to generate full Doxygen documentation */
204 
205 #ifdef DOXYGEN
206 # ifndef P_CC_MSVC
207 # define P_CC_MSVC
208 # endif
209 # ifndef P_CC_GNU
210 # define P_CC_GNU
211 # endif
212 # ifndef P_CC_MINGW
213 # define P_CC_MINGW
214 # endif
215 # ifndef P_CC_INTEL
216 # define P_CC_INTEL
217 # endif
218 # ifndef P_CC_CLANG
219 # define P_CC_CLANG
220 # endif
221 # ifndef P_CC_SUN
222 # define P_CC_SUN
223 # endif
224 # ifndef P_CC_XLC
225 # define P_CC_XLC
226 # endif
227 # ifndef P_CC_HP
228 # define P_CC_HP
229 # endif
230 # ifndef P_CC_DEC
231 # define P_CC_DEC
232 # endif
233 # ifndef P_CC_MIPS
234 # define P_CC_MIPS
235 # endif
236 # ifndef P_CC_USLC
237 # define P_CC_USLC
238 # endif
239 # ifndef P_CC_WATCOM
240 # define P_CC_WATCOM
241 # endif
242 # ifndef P_CC_BORLAND
243 # define P_CC_BORLAND
244 # endif
245 # ifndef P_CC_PGI
246 # define P_CC_PGI
247 # endif
248 # ifndef P_CC_CRAY
249 # define P_CC_CRAY
250 # endif
251 #endif
252 
253 #endif /* PLIBSYS_HEADER_PMACROSCOMPILER_H */