version 2.8
gfx_compilers.h
Go to the documentation of this file.
1 /*
2  * This file is subject to the terms of the GFX License. If a copy of
3  * the license was not distributed with this file, you can obtain one at:
4  *
5  * http://ugfx.org/license.html
6  */
7 
8 /**
9  * @file gfx_compilers.h
10  * @brief GFX compiler support header file.
11  *
12  * @addtogroup GFX
13  *
14  * @brief Main module to glue all the others together
15  *
16  * @{
17  */
18 
19 #ifndef _GFX_COMPILERS_H
20 #define _GFX_COMPILERS_H
21 
22 /**
23  * @name GFX compilation options
24  * @{
25  */
26  /**
27  * @brief Should various inline ugfx functions be non-inline.
28  * @details Defaults to FALSE
29  * @note Generally there is no need to set this to TRUE as it will have huge performance impacts
30  * in the driver level.
31  */
32  #ifndef GFX_NO_INLINE
33  #define GFX_NO_INLINE FALSE
34  #endif
35 
36  // Set the no inline value
37  #if GFX_NO_INLINE
38  #define GFXINLINE
39  #endif
40 
41  /**
42  * @brief Show which compiler we detected as a compiler warning message
43  */
44  #ifndef GFX_SHOW_COMPILER
45  #define GFX_SHOW_COMPILER FALSE
46  #endif
47 
48  /**
49  * @brief Enable compiler specific code
50  * @details Auto detected by default but it can be overridden in gfxconf.h
51  * @note This is setting enables optimisations and code options that are compiler specific.
52  * @note If the compiler can't be auto-detected it is set to GFX_COMPILER_UNKNOWN
53  * @{
54  */
55  #ifndef GFX_COMPILER
56  #define GFX_COMPILER GFX_COMPILER_UNKNOWN
57  #endif
58  #define GFX_COMPILER_UNKNOWN 0 //**< Unknown compiler
59  #define GFX_COMPILER_ACC 1 //**< ACC Compiler
60  #define GFX_COMPILER_ALTIUM 2 //**< Altium MicroBlaze C
61  #define GFX_COMPILER_ALTIUMHW 3 //**< Altium C-to-Hardware
62  #define GFX_COMPILER_AMSTERDAM 4 //**< Amsterdam Compiler Kit
63  #define GFX_COMPILER_ARMCC 5 //**< ARM Compiler
64  #define GFX_COMPILER_AZTEC 6 //**< Aztec C
65  #define GFX_COMPILER_BORLAND 7 //**< Borland C++
66  #define GFX_COMPILER_CC65 8 //**< CC65
67  #define GFX_COMPILER_CLANG 9 //**< CLang (LLVM) compiler
68  #define GFX_COMPILER_COMEAU 10 //**< Comeau C++
69  #define GFX_COMPILER_COMPAQ 11 //**< Compaq C
70  #define GFX_COMPILER_COMPCERT 12 //**< Compcert Compiler
71  #define GFX_COMPILER_CONVEX 13 //**< Convex C
72  #define GFX_COMPILER_CRAY 14 //**< Cray C/C++
73  #define GFX_COMPILER_CYGWIN 15 //**< Cygwin (x86) unix emulator compiler for windows
74  #define GFX_COMPILER_DAIB 16 //**< Diab C/C++
75  #define GFX_COMPILER_DEC 17 //**< The older DEC C Compiler
76  #define GFX_COMPILER_DICE 18 //**< DICE C Compiler
77  #define GFX_COMPILER_DIGNUS 19 //**< Dignus Systems C++ Compiler
78  #define GFX_COMPILER_DJGPP 20 //**< DJGPP
79  #define GFX_COMPILER_DMARS 21 //**< Digital Mars
80  #define GFX_COMPILER_EDG 22 //**< EDG C++
81  #define GFX_COMPILER_EKOPATH 23 //**< EKOPath Compiler
82  #define GFX_COMPILER_FUJITSU 24 //**< Fujitsu C++ Compiler
83  #define GFX_COMPILER_GCC 25 //**< Standard GCC/G++
84  #define GFX_COMPILER_GREENHILL 26 //**< Green Hill C/C++
85  #define GFX_COMPILER_HIGHC 27 //**< Metaware High C/C++
86  #define GFX_COMPILER_HP 28 //**< HP C/aC++
87  #define GFX_COMPILER_IAR 29 //**< IAR C/C++
88  #define GFX_COMPILER_IBMXL 30 //**< IBM XL C/C++ Compiler
89  #define GFX_COMPILER_IMAGECRAFT 31 //**< ImageCraft C Compiler
90  #define GFX_COMPILER_INTEL 32 //**< Intel ICC/ICPC Compiler
91  #define GFX_COMPILER_KAI 33 //**< Kai C++
92  #define GFX_COMPILER_KEIL 34 //**< Keil (use this when working with uVision IDE)
93  #define GFX_COMPILER_LCC 35 //**< LCC
94  #define GFX_COMPILER_METROWORKS 36 //**< Metroworks
95  #define GFX_COMPILER_MICROTEC 37 //**< Microtec C/C++
96  #define GFX_COMPILER_MICROWAY 38 //**< Microway NDP C
97  #define GFX_COMPILER_MINGW32 39 //**< MingW32 (x86) compiler for windows
98  #define GFX_COMPILER_MINGW64 40 //**< MingW64 (x64) compiler for windows
99  #define GFX_COMPILER_MIPSPRO 41 //**< MIPS Pro
100  #define GFX_COMPILER_MIRACLE 42 //**< Miracle C
101  #define GFX_COMPILER_MPW 43 //**< MPW C++
102  #define GFX_COMPILER_NORCROFT 44 //**< Norcroft ARM
103  #define GFX_COMPILER_NWCC 45 //**< NWCC
104  #define GFX_COMPILER_OPEN64 46 //**< Open64
105  #define GFX_COMPILER_OSS 47 //**< Oracle Solaris Studio
106  #define GFX_COMPILER_PACIFIC 48 //**< Pacific C
107  #define GFX_COMPILER_PALM 49 //**< Palm C/C++
108  #define GFX_COMPILER_PELLES 50 //**< Pelles C
109  #define GFX_COMPILER_PGCC 51 //**< Portland PGCC/PGCPP
110  #define GFX_COMPILER_RENESAS 52 //**< Renesas C/C++
111  #define GFX_COMPILER_SASC 53 //**< SAS/C
112  #define GFX_COMPILER_SCO 54 //**< SCO OpenServer
113  #define GFX_COMPILER_SDCC 55 //**< Small Device C Compiler
114  #define GFX_COMPILER_SN 56 //**< SN Compiler
115  #define GFX_COMPILER_STRATUS 57 //**< Stratus VOS C
116  #define GFX_COMPILER_SYMANTEC 58 //**< Symantec C++
117  #define GFX_COMPILER_TENDRA 59 //**< TenDRA C/C++
118  #define GFX_COMPILER_THINK 60 //**< Think C
119  #define GFX_COMPILER_TI 61 //**< Texas Instruments C/C++
120  #define GFX_COMPILER_TINYC 62 //**< Tiny C
121  #define GFX_COMPILER_TURBOC 63 //**< Borland Turbo C
122  #define GFX_COMPILER_ULTIMATE 64 //**< Ultimate C/C++
123  #define GFX_COMPILER_USL 65 //**< USL C
124  #define GFX_COMPILER_VBCC 66 //**< VBCC
125  #define GFX_COMPILER_VS 67 //**< Microsoft Visual Studio
126  #define GFX_COMPILER_WATCOM 68 //**< Watcom
127  #define GFX_COMPILER_ZTC 69 //**< Zortech C++
128  /** @} */
129 
130  /************************************ Start Compiler Auto-Detection *************************
131  *
132  * Do not alter the order of these unless you know what you are doing as some compilers try
133  * to emulate other compilers. GCC in particular is commonly emulated and is also used as
134  * a code base for other compiler variants.
135  */
136  #if GFX_COMPILER == GFX_COMPILER_UNKNOWN
137  #undef GFX_COMPILER
138  #if defined(__MINGW32__)
139  #define GFX_COMPILER GFX_COMPILER_MINGW32
140  #elif defined(__MINGW64__)
141  #define GFX_COMPILER GFX_COMPILER_MINGW64
142  #elif defined(__CYGWIN__)
143  #define GFX_COMPILER GFX_COMPILER_CYGWIN
144  #elif defined(__KEIL__) || defined(__CA__) || defined(__C51__) || defined(__CX51__) || defined(__C166__) || defined(__C251__) \
145  || (defined(__CC_ARM) && defined(__EDG__))
146  #define GFX_COMPILER GFX_COMPILER_KEIL
147  #elif defined(__clang__) || defined(__llvm__)
148  #define GFX_COMPILER GFX_COMPILER_CLANG
149  #elif defined(__INTEL_COMPILER) || defined(__ICC) || defined(__ECC) || defined(__TCL)
150  #define GFX_COMPILER GFX_COMPILER_INTEL
151  #elif defined(__GNUC__) || defined(__GNUG__)
152  #define GFX_COMPILER GFX_COMPILER_GCC
153  #elif defined(__CC_ARM)
154  #define GFX_COMPILER GFX_COMPILER_ARMCC
155  #elif defined(__HP_cc) || defined(__HP_aCC)
156  #define GFX_COMPILER GFX_COMPILER_HP
157  #elif defined(__IBMC__) || defined(__IBMCPP__) || defined(__xlc__) || defined(__xlC__)
158  #define GFX_COMPILER GFX_COMPILER_IBMXL
159  #elif defined(_MSC_VER)
160  #define GFX_COMPILER GFX_COMPILER_VS
161  #elif defined(__PGI)
162  #define GFX_COMPILER GFX_COMPILER_PGCC
163  #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
164  #define GFX_COMPILER GFX_COMPILER_OSS
165  #elif defined(__TURBOC__)
166  #define GFX_COMPILER GFX_COMPILER_TURBOC
167  #elif defined(__BORLANDC__)
168  #define GFX_COMPILER GFX_COMPILER_BORLAND
169  #elif defined(__COMO__)
170  #define GFX_COMPILER GFX_COMPILER_COMEAU
171  #elif defined(__DECC) || defined(__VAXC) || defined(VAXC) || defined(__DECCXX)
172  #define GFX_COMPILER GFX_COMPILER_COMPAQ
173  #elif defined(__osf__) && defined(__LANGUAGE_C__)
174  #define GFX_COMPILER GFX_COMPILER_DEC
175  #elif defined(_CRAYC)
176  #define GFX_COMPILER GFX_COMPILER_CRAY
177  #elif defined(__DCC__)
178  #define GFX_COMPILER GFX_COMPILER_DAIB
179  #elif defined(__DMC__)
180  #define GFX_COMPILER GFX_COMPILER_DMARS
181  #elif defined(__KCC)
182  #define GFX_COMPILER GFX_COMPILER_KAI
183  #elif defined(__LCC__)
184  #define GFX_COMPILER GFX_COMPILER_LCC
185  #elif defined(__HIGHC__)
186  #define GFX_COMPILER GFX_COMPILER_HIGHC
187  #elif defined(__MWERKS__) || defined(__CWCC__)
188  #define GFX_COMPILER GFX_COMPILER_METROWORKS
189  #elif defined(__sgi)
190  #define GFX_COMPILER GFX_COMPILER_MIPSPRO
191  #elif defined(__MRC__)
192  #define GFX_COMPILER GFX_COMPILER_MPW
193  #elif defined(__CC_NORCROFT)
194  #define GFX_COMPILER GFX_COMPILER_NORCROFT
195  #elif defined(__SASC__)
196  #define GFX_COMPILER GFX_COMPILER_SASC
197  #elif defined( _SCO_DS )
198  #define GFX_COMPILER GFX_COMPILER_SCO
199  #elif defined(__TINYC__)
200  #define GFX_COMPILER GFX_COMPILER_TINYC
201  #elif defined( __USLC__ )
202  #define GFX_COMPILER GFX_COMPILER_USL
203  #elif defined(__WATCOMC__)
204  #define GFX_COMPILER GFX_COMPILER_WATCOM
205  #elif defined(__AZTEC_C__) || defined(AZTEC_C)
206  #define GFX_COMPILER GFX_COMPILER_AZTEC
207  #elif defined(__CC65__)
208  #define GFX_COMPILER GFX_COMPILER_CC65
209  #elif defined(__convexc__)
210  #define GFX_COMPILER GFX_COMPILER_CONVEX
211  #elif defined(__COMPCERT__)
212  #define GFX_COMPILER GFX_COMPILER_COMPCERT
213  #elif defined(_DICE)
214  #define GFX_COMPILER GFX_COMPILER_DICE
215  #elif defined(__SYSC__)
216  #define GFX_COMPILER GFX_COMPILER_DIGNUS
217  #elif defined(__DJGPP__) || defined(__GO32__)
218  #define GFX_COMPILER GFX_COMPILER_DJGPP
219  #elif defined(__EDG__)
220  #define GFX_COMPILER GFX_COMPILER_EDG
221  #elif defined(__PATHCC__)
222  #define GFX_COMPILER GFX_COMPILER_EKOPATH
223  #elif defined(__FCC_VERSION)
224  #define GFX_COMPILER GFX_COMPILER_FUJITSU
225  #elif defined(__ghs__)
226  #define GFX_COMPILER GFX_COMPILER_GREENHILL
227  #elif defined(__IAR_SYSTEMS_ICC__)
228  #define GFX_COMPILER GFX_COMPILER_IAR
229  #elif defined(_MRI)
230  #define GFX_COMPILER GFX_COMPILER_MICROTEC
231  #elif defined(__NDPC__) || defined(__NDPX__)
232  #define GFX_COMPILER GFX_COMPILER_MICROWAY
233  #elif defined(MIRACLE)
234  #define GFX_COMPILER GFX_COMPILER_MIRACLE
235  #elif defined(__NWCC__)
236  #define GFX_COMPILER GFX_COMPILER_NWCC
237  #elif defined(__OPEN64__)
238  #define GFX_COMPILER GFX_COMPILER_OPEN64
239  #elif defined(__PACIFIC__)
240  #define GFX_COMPILER GFX_COMPILER_PACIFIC
241  #elif defined(_PACC_VER)
242  #define GFX_COMPILER GFX_COMPILER_PALM
243  #elif defined(__POCC__)
244  #define GFX_COMPILER GFX_COMPILER_PELLES
245  #elif defined(__RENESAS__) || defined(__HITACHI__)
246  #define GFX_COMPILER GFX_COMPILER_RENESAS
247  #elif defined(SDCC)
248  #define GFX_COMPILER GFX_COMPILER_SDCC
249  #elif defined(__SNC__)
250  #define GFX_COMPILER GFX_COMPILER_SN
251  #elif defined(__VOSC__)
252  #define GFX_COMPILER GFX_COMPILER_STRATUS
253  #elif defined(__TenDRA__)
254  #define GFX_COMPILER GFX_COMPILER_TENDRA
255  #elif defined(__TI_COMPILER_VERSION__)
256  #define GFX_COMPILER GFX_COMPILER_TI
257  #elif defined(THINKC3) || defined(THINKC4)
258  #define GFX_COMPILER GFX_COMPILER_THINK
259  #elif defined(_UCC)
260  #define GFX_COMPILER GFX_COMPILER_ULTIMATE
261  #elif defined(__VBCC__)
262  #define GFX_COMPILER GFX_COMPILER_VBCC
263  #elif defined(__ZTC__)
264  #define GFX_COMPILER GFX_COMPILER_ZTC
265  #elif defined(__SC__)
266  #define GFX_COMPILER GFX_COMPILER_SYMANTEC
267  #elif defined(_ACC_)
268  #define GFX_COMPILER GFX_COMPILER_ACC
269  #elif defined(__CMB__)
270  #define GFX_COMPILER GFX_COMPILER_ALTIUM
271  #elif defined(__CHC__)
272  #define GFX_COMPILER GFX_COMPILER_ALTIUMHW
273  #elif defined(__ACK__)
274  #define GFX_COMPILER GFX_COMPILER_AMSTERDAM
275  #elif defined(__IMAGECRAFT__)
276  #define GFX_COMPILER GFX_COMPILER_IMAGECRAFT
277 
278  #else
279  #define GFX_COMPILER GFX_COMPILER_UNKNOWN
280  #endif
281  #endif
282  /************************************ End Compiler Auto-Detection *************************/
283 
284  /************************************ Start Compiler Settings *****************************
285  *
286  * Please keep this list in alphabetical order to keep it easier to maintain
287  */
288 
289  #undef GFX_COMPILER_NAME
290  #undef GFX_COMPILER_TESTED
291  #undef GFX_COMPILER_VERSION_MAJOR
292  #undef GFX_COMPILER_VERSION_MINOR
293  #undef GFX_COMPILER_VERSION_PATCH
294  #undef GFX_COMPILER_VERSION_BUILD
295  #undef GFX_COMPILER_WARNING_TYPE
296  #define GFX_COMPILER_WARNING_NONE 0 /* Don't display warnings */
297  #define GFX_COMPILER_WARNING_DIRECT 1 /* Use #warning text, no macro expansion possible */
298  #define GFX_COMPILER_WARNING_MACRO 2 /* Use COMPILER_WARNING(text), macro expansion possible */
299  #define GFX_COMPILER_WARNING_GCC 3 /* Use GCC style warnings - converted to GFX_COMPILER_WARNING_MACRO */
300 
301  #if GFX_COMPILER == GFX_COMPILER_ACC
302  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
303  #warning "Compiler: ACC"
304  #endif
305  #define GFX_COMPILER_NAME "ACC"
306  #elif GFX_COMPILER == GFX_COMPILER_ALTIUM
307  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
308  #warning "Compiler: ALTIUM"
309  #endif
310  #define GFX_COMPILER_NAME "Altium MicroBlaze C"
311  #ifdef __BUILD__
312  #define GFX_COMPILER_VERSION_MAJOR ((__BUILD__)/1000000)
313  #define GFX_COMPILER_VERSION_MINOR (((__BUILD__)/1000)%1000)
314  #define GFX_COMPILER_VERSION_PATCH ((__BUILD__)%1000)
315  #else
316  #define GFX_COMPILER_VERSION_MAJOR ((__VERSION__)/1000)
317  #define GFX_COMPILER_VERSION_MINOR ((__VERSION__)%1000)
318  #define GFX_COMPILER_VERSION_PATCH (__REVISION__)
319  #endif
320  #elif GFX_COMPILER == GFX_COMPILER_ALTIUMHW
321  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
322  #warning "Compiler: ALTIUMHW"
323  #endif
324  #define GFX_COMPILER_NAME "Altium C-to-Hardware"
325  #ifdef __BUILD__
326  #define GFX_COMPILER_VERSION_MAJOR ((__BUILD__)/1000000)
327  #define GFX_COMPILER_VERSION_MINOR (((__BUILD__)/1000)%1000)
328  #define GFX_COMPILER_VERSION_PATCH ((__BUILD__)%1000)
329  #else
330  #define GFX_COMPILER_VERSION_MAJOR ((__VERSION__)/1000)
331  #define GFX_COMPILER_VERSION_MINOR ((__VERSION__)%1000)
332  #define GFX_COMPILER_VERSION_PATCH (__REVISION__)
333  #endif
334  #elif GFX_COMPILER == GFX_COMPILER_AMSTERDAM
335  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
336  #warning "Compiler: AMSTERDAM"
337  #endif
338  #define GFX_COMPILER_NAME "Amsterdam Compiler Kit"
339  #elif GFX_COMPILER == GFX_COMPILER_ARMCC
340  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
341  #warning "Compiler: ARMCC"
342  #endif
343  #define GFX_COMPILER_NAME "ARMCC"
344  #define GFX_COMPILER_VERSION_MAJOR ((__ARMCC_VERSION)/100000)
345  #define GFX_COMPILER_VERSION_MINOR (((__ARMCC_VERSION)/10000)%10)
346  #define GFX_COMPILER_VERSION_PATCH (((__ARMCC_VERSION)/1000)%10)
347  #define GFX_COMPILER_VERSION_BUILD ((__ARMCC_VERSION)%1000)
348  #pragma anon_unions // Allow anonymous unions
349  #define __LITTLE_IF_NOT_BIG__ // Oops - Defines __BIG_ENDIAN but not __LITTLE_ENDIAN
350  #elif GFX_COMPILER == GFX_COMPILER_AZTEC
351  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
352  #warning "Compiler: AZTEC"
353  #endif
354  #define GFX_COMPILER_NAME "Aztec"
355  #define GFX_COMPILER_VERSION_MAJOR ((__VERSION)/100)
356  #define GFX_COMPILER_VERSION_MINOR ((__VERSION)%100)
357  #elif GFX_COMPILER == GFX_COMPILER_BORLAND
358  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
359  #warning "Compiler: BORLAND"
360  #endif
361  #define GFX_COMPILER_NAME "Borland C++"
362  #define GFX_COMPILER_VERSION_MAJOR ((__BORLANDC__)/0x100)
363  #define GFX_COMPILER_VERSION_MINOR (((((__BORLANDC__)%0x100)/0x10)*10) + ((__BORLANDC__)%0x10))
364  #elif GFX_COMPILER == GFX_COMPILER_CC65
365  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
366  #warning "Compiler: CC65"
367  #endif
368  #define GFX_COMPILER_NAME "CC65"
369  #define GFX_COMPILER_VERSION_MAJOR ((__CC65__)/0x100)
370  #define GFX_COMPILER_VERSION_MINOR (((__CC65__)/0x10)%0x10)
371  #define GFX_COMPILER_VERSION_PATCH ((__CC65__)%0x10)
372  #elif GFX_COMPILER == GFX_COMPILER_CLANG
373  #define GFX_COMPILER_NAME "CLang (LLVM)"
374  #define GFX_COMPILER_TESTED TRUE
375  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_GCC
376  #define GFX_COMPILER_VERSION_MAJOR (__clang_major__)
377  #define GFX_COMPILER_VERSION_MINOR (__clang_minor__)
378  #define GFX_COMPILER_VERSION_PATCH (__clang_patchlevel__)
379  #define DEPRECATED(msg) __attribute__((deprecated(msg)))
380  #elif GFX_COMPILER == GFX_COMPILER_COMEAU
381  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
382  #warning "Compiler: COMEAU"
383  #endif
384  #define GFX_COMPILER_NAME "Comeau C++"
385  #define GFX_COMPILER_VERSION_MAJOR ((__COMO_VERSION__)/100)
386  #define GFX_COMPILER_VERSION_MINOR ((__COMO_VERSION__)%100)
387  #elif GFX_COMPILER == GFX_COMPILER_COMPAQ
388  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
389  #warning "Compiler: COMPAQ"
390  #endif
391  #define GFX_COMPILER_NAME "Compaq C"
392  #define GFX_COMPILER_VERSION_MAJOR ((__DECC_VER)/10000000)
393  #define GFX_COMPILER_VERSION_MINOR (((__DECC_VER)/100000)%100)
394  #define GFX_COMPILER_VERSION_PATCH ((__DECC_VER)%10000)
395  #elif GFX_COMPILER == GFX_COMPILER_COMPCERT
396  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
397  #warning "Compiler: COMPCERT"
398  #endif
399  #define GFX_COMPILER_NAME "Compcert"
400  #elif GFX_COMPILER == GFX_COMPILER_CONVEX
401  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
402  #warning "Compiler: CONVEX"
403  #endif
404  #define GFX_COMPILER_NAME "Convex C"
405  #elif GFX_COMPILER == GFX_COMPILER_CRAY
406  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
407  #warning "Compiler: CRAY"
408  #endif
409  #define GFX_COMPILER_NAME "Cray C/C++"
410  #define GFX_COMPILER_VERSION_MAJOR (_RELEASE)
411  #define GFX_COMPILER_VERSION_MINOR (_RELEASE_MINOR)
412  #elif GFX_COMPILER == GFX_COMPILER_CYGWIN
413  #define GFX_COMPILER_NAME "Cygwin"
414  #define GFX_COMPILER_TESTED TRUE
415  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_GCC
416  #define GFX_COMPILER_VERSION_MAJOR (__GNUC__)
417  #define GFX_COMPILER_VERSION_MINOR (__GNUC_MINOR__)
418  #ifdef __GNUC_PATCHLEVEL__
419  #define GFX_COMPILER_VERSION_PATCH (__GNUC_PATCHLEVEL__)
420  #endif
421  #define DEPRECATED(msg) __attribute__((deprecated(msg)))
422  #elif GFX_COMPILER == GFX_COMPILER_DAIB
423  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
424  #warning "Compiler: DAIB"
425  #endif
426  #define GFX_COMPILER_NAME "Diab C/C++"
427  #define GFX_COMPILER_VERSION_MAJOR ((__VERSION_NUMBER__)/1000)
428  #define GFX_COMPILER_VERSION_MINOR (((__VERSION_NUMBER__)/100)%10)
429  #define GFX_COMPILER_VERSION_PATCH ((__VERSION_NUMBER__)%100)
430  #elif GFX_COMPILER == GFX_COMPILER_DEC
431  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
432  #warning "Compiler: DEC"
433  #endif
434  #define GFX_COMPILER_NAME "DEC"
435  #elif GFX_COMPILER == GFX_COMPILER_DICE
436  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
437  #warning "Compiler: DICE"
438  #endif
439  #define GFX_COMPILER_NAME "DICE C"
440  #elif GFX_COMPILER == GFX_COMPILER_DIGNUS
441  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
442  #warning "Compiler: DIGNUS"
443  #endif
444  #define GFX_COMPILER_NAME "Dignus Systems C++"
445  #define GFX_COMPILER_VERSION_MAJOR ((__SYSC_VER__)/10000)
446  #define GFX_COMPILER_VERSION_MINOR (((__SYSC_VER__)/100)%100)
447  #define GFX_COMPILER_VERSION_PATCH ((__SYSC_VER__)%100)
448  #elif GFX_COMPILER == GFX_COMPILER_DJGPP
449  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
450  #warning "Compiler: DJGPP"
451  #endif
452  #define GFX_COMPILER_NAME "DJGPP"
453  #ifdef __DJGPP__
454  #define GFX_COMPILER_VERSION_MAJOR (__DJGPP__)
455  #define GFX_COMPILER_VERSION_MINOR (__DJGPP_MINOR__)
456  #else
457  #define GFX_COMPILER_VERSION_MAJOR (1)
458  #endif
459  #elif GFX_COMPILER == GFX_COMPILER_DMARS
460  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
461  #warning "Compiler: DMARS"
462  #endif
463  #define GFX_COMPILER_NAME "Digital Mars"
464  #define GFX_COMPILER_VERSION_MAJOR ((__DMC__)/0x100)
465  #define GFX_COMPILER_VERSION_MINOR (((__DMC__)/0x10)%0x10)
466  #define GFX_COMPILER_VERSION_PATCH ((__DMC__)%0x10)
467  #elif GFX_COMPILER == GFX_COMPILER_EDG
468  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
469  #warning "Compiler: EDG"
470  #endif
471  #define GFX_COMPILER_NAME "EDG C++"
472  #define GFX_COMPILER_TESTED TRUE
473  #define GFX_COMPILER_VERSION_MAJOR ((__EDG_VERSION__)/100)
474  #define GFX_COMPILER_VERSION_MINOR ((__EDG_VERSION__)%100)
475  #pragma diag_remark = Pe301
476  #pragma diag_remark = Pe083
477  #pragma diag_remark = Pe767
478  #pragma diag_remark = Pe188
479  #pragma diag_remark = Pe186
480  #pragma diag_remark = Pe068
481  #pragma diag_remark = Pa050
482  #elif GFX_COMPILER == GFX_COMPILER_EKOPATH
483  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
484  #warning "Compiler: EKOPATH"
485  #endif
486  #define GFX_COMPILER_NAME "EKOPath"
487  #define GFX_COMPILER_VERSION_MAJOR (__PATHCC__)
488  #define GFX_COMPILER_VERSION_MINOR (__PATHCC_MINOR__)
489  #define GFX_COMPILER_VERSION_PATCH (__PATHCC_PATCHLEVEL__)
490  #elif GFX_COMPILER == GFX_COMPILER_FUJITSU
491  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
492  #warning "Compiler: FUJITSU"
493  #endif
494  #define GFX_COMPILER_NAME "Fujitsu C++"
495  #elif GFX_COMPILER == GFX_COMPILER_GCC
496  #define GFX_COMPILER_NAME "GCC"
497  #define GFX_COMPILER_TESTED TRUE
498  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_GCC
499  #define GFX_COMPILER_VERSION_MAJOR (__GNUC__)
500  #define GFX_COMPILER_VERSION_MINOR (__GNUC_MINOR__)
501  #ifdef __GNUC_PATCHLEVEL__
502  #define GFX_COMPILER_VERSION_PATCH (__GNUC_PATCHLEVEL__)
503  #endif
504  #define DEPRECATED(msg) __attribute__((deprecated(msg)))
505  #elif GFX_COMPILER == GFX_COMPILER_GREENHILL
506  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
507  #warning "Compiler: GREENHILL"
508  #endif
509  #define GFX_COMPILER_NAME "Green Hill C/C++"
510  #define GFX_COMPILER_VERSION_MAJOR ((__GHS_VERSION_NUMBER__)/100)
511  #define GFX_COMPILER_VERSION_MINOR (((__GHS_VERSION_NUMBER__)/10)%10)
512  #define GFX_COMPILER_VERSION_PATCH ((__GHS_VERSION_NUMBER__)%10)
513  #elif GFX_COMPILER == GFX_COMPILER_HIGHC
514  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
515  #warning "Compiler: HIGHC"
516  #endif
517  #define GFX_COMPILER_NAME "Metaware High C/C++"
518  #elif GFX_COMPILER == GFX_COMPILER_HP
519  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
520  #warning "Compiler: HP"
521  #endif
522  #define GFX_COMPILER_NAME "HP C/aC++"
523  #ifdef __HP_aCC
524  #if __HP_aCC == 1
525  #define GFX_COMPILER_VERSION_MAJOR (1)
526  #define GFX_COMPILER_VERSION_MINOR (15)
527  #else
528  #define GFX_COMPILER_VERSION_MAJOR ((__HP_aCC)/10000)
529  #define GFX_COMPILER_VERSION_MINOR (((__HP_aCC)/100)%100)
530  #define GFX_COMPILER_VERSION_PATCH ((__HP_aCC)%100)
531  #endif
532  #endif
533  #elif GFX_COMPILER == GFX_COMPILER_IAR
534  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
535  #warning "Compiler: IAR"
536  #endif
537  #define GFX_COMPILER_NAME "IAR C++"
538  #define GFX_COMPILER_TESTED TRUE
539  #define GFX_COMPILER_VERSION_MAJOR ((__VER__)/100)
540  #define GFX_COMPILER_VERSION_MINOR ((__VER__)%100)
541  #pragma diag_remark = Pe301
542  #pragma diag_remark = Pe083
543  #pragma diag_remark = Pe767
544  #pragma diag_remark = Pe188
545  #pragma diag_remark = Pe186
546  #pragma diag_remark = Pe068
547  #pragma diag_remark = Pa050
548  #elif GFX_COMPILER == GFX_COMPILER_IBMXL
549  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
550  #warning "Compiler: IBMXL"
551  #endif
552  #define GFX_COMPILER_NAME "IBM XL C/C++"
553  #ifdef __xlC__
554  #define GFX_COMPILER_VERSION_MAJOR ((__xlC__)/0x100)
555  #define GFX_COMPILER_VERSION_MINOR ((__xlC__)%0x100)
556  #define GFX_COMPILER_VERSION_PATCH ((__xlC_ver__)/0x100)
557  #define GFX_COMPILER_VERSION_BUILD ((__xlC_ver__)%0x100)
558  #elif defined(__COMPILER_VER__)
559  #define GFX_COMPILER_VERSION_MAJOR (((__COMPILER_VER__)/0x1000000)%0x10)
560  #define GFX_COMPILER_VERSION_MINOR (((__COMPILER_VER__)/0x10000)%0x100)
561  #define GFX_COMPILER_VERSION_PATCH ((__COMPILER_VER__)/0x10000)
562  #elif defined(__IBMC__)
563  #define GFX_COMPILER_VERSION_MAJOR ((__IBMC__)/100)
564  #define GFX_COMPILER_VERSION_MINOR (((__IBMC__)/10)%10)
565  #define GFX_COMPILER_VERSION_PATCH ((__IBMC__)%10)
566  #elif defined(__IBMCPP__)
567  #define GFX_COMPILER_VERSION_MAJOR ((__IBMCPP__)/100)
568  #define GFX_COMPILER_VERSION_MINOR (((__IBMCPP__)/10)%10)
569  #define GFX_COMPILER_VERSION_PATCH ((__IBMCPP__)%10)
570  #endif
571  #elif GFX_COMPILER == GFX_COMPILER_IMAGECRAFT
572  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
573  #warning "Compiler: IMAGECRAFT"
574  #endif
575  #define GFX_COMPILER_NAME "Imagecraft C"
576  #elif GFX_COMPILER == GFX_COMPILER_INTEL
577  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
578  #warning "Compiler: INTEL"
579  #endif
580  #define GFX_COMPILER_NAME "Intel ICC/ICPC"
581  #ifdef __INTEL_COMPILER
582  #define GFX_COMPILER_VERSION_MAJOR ((__INTEL_COMPILER)/100)
583  #define GFX_COMPILER_VERSION_MINOR (((__INTEL_COMPILER)/10)%10)
584  #define GFX_COMPILER_VERSION_PATCH ((__INTEL_COMPILER)%10)
585  #ifdef __INTEL_COMPILER_BUILD_DATE
586  #define GFX_COMPILER_VERSION_BUILD (__INTEL_COMPILER_BUILD_DATE)
587  #endif
588  #endif
589  #elif GFX_COMPILER == GFX_COMPILER_KAI
590  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
591  #warning "Compiler: KAI"
592  #endif
593  #define GFX_COMPILER_NAME "Kai C++"
594  #define GFX_COMPILER_VERSION_MAJOR ((__KCC_VERSION)/0x1000)
595  #define GFX_COMPILER_VERSION_MINOR (((__KCC_VERSION)/0x100)%0x10)
596  #define GFX_COMPILER_VERSION_PATCH ((__KCC_VERSION)%0x100)
597  #elif GFX_COMPILER == GFX_COMPILER_KEIL
598  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
599  #warning "Compiler: KEIL"
600  #endif
601  #define GFX_COMPILER_NAME "Keil"
602  #define GFX_COMPILER_TESTED TRUE
603  #if defined(__ARMCC_VERSION)
604  #define GFX_COMPILER_VERSION_MAJOR ((__ARMCC_VERSION)/1000000)
605  #define GFX_COMPILER_VERSION_MINOR (((__ARMCC_VERSION)/10000)%100)
606  #define GFX_COMPILER_VERSION_PATCH ((__ARMCC_VERSION)%10000)
607  #ifdef __EDG_VERSION__
608  #define GFX_COMPILER_VERSION_BUILD (__EDG_VERSION__)
609  #endif
610  #elif defined(__CA__)
611  #define GFX_COMPILER_VERSION_MAJOR ((__CA__)/100)
612  #define GFX_COMPILER_VERSION_MINOR ((__CA__)%100)
613  #elif defined(__C166__)
614  #define GFX_COMPILER_VERSION_MAJOR ((__C166__)/100)
615  #define GFX_COMPILER_VERSION_MINOR ((__C166__)%100)
616  #elif defined(__C51__)
617  #define GFX_COMPILER_VERSION_MAJOR ((__C51__)/100)
618  #define GFX_COMPILER_VERSION_MINOR ((__C51__)%100)
619  #elif defined(__C251__)
620  #define GFX_COMPILER_VERSION_MAJOR ((__C251__)/100)
621  #define GFX_COMPILER_VERSION_MINOR ((__C251__)%100)
622  #endif
623  #define DEPRECATED(msg) __attribute__((deprecated(msg)))
624  #pragma anon_unions // Allow anonymous unions
625  #pragma diag_remark 1293 // Turn off warning: assignment in condition
626  #pragma diag_remark 83 // Turn off warning: type qualifier specified more than once
627  #pragma diag_remark 767 // Turn off warning: conversion from pointer to smaller integer
628  #pragma diag_remark 188 // Turn off warning: enumerated type mixed with another type
629  #pragma diag_remark 68 // Turn off warning: integer conversion resulted in a change of sign
630  #pragma diag_remark 111 // Turn off warning: statement is unreachable
631  #ifndef GFXINLINE // Get the Keil definition for inline
632  #define GFXINLINE __inline
633  #endif
634  #define __LITTLE_IF_NOT_BIG__ // Oops - Defines __BIG_ENDIAN but not __LITTLE_ENDIAN
635  #elif GFX_COMPILER == GFX_COMPILER_LCC
636  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
637  #warning "Compiler: LCC"
638  #endif
639  #define GFX_COMPILER_NAME "LCC"
640  #elif GFX_COMPILER == GFX_COMPILER_METROWORKS
641  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
642  #warning "Compiler: METROWORKS"
643  #endif
644  #define GFX_COMPILER_NAME "Metroworks CodeWarrior"
645  #define GFX_COMPILER_VERSION_MAJOR ((__MWERKS__)/0x1000)
646  #define GFX_COMPILER_VERSION_MINOR (((__MWERKS__)/0x100)%0x10)
647  #define GFX_COMPILER_VERSION_PATCH ((__MWERKS__)%100)
648  #elif GFX_COMPILER == GFX_COMPILER_MICROTEC
649  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
650  #warning "Compiler: MICROTEC"
651  #endif
652  #define GFX_COMPILER_NAME "Microtec C/C++"
653  #elif GFX_COMPILER == GFX_COMPILER_MICROWAY
654  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
655  #warning "Compiler: MICROWAY"
656  #endif
657  #define GFX_COMPILER_NAME "Microway NDP C"
658  #elif GFX_COMPILER == GFX_COMPILER_MINGW32
659  #define GFX_COMPILER_NAME "MingW32"
660  #define GFX_COMPILER_TESTED TRUE
661  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_GCC
662  #define GFX_COMPILER_VERSION_MAJOR (__GNUC__)
663  #define GFX_COMPILER_VERSION_MINOR (__GNUC_MINOR__)
664  #ifdef __GNUC_PATCHLEVEL__
665  #define GFX_COMPILER_VERSION_PATCH (__GNUC_PATCHLEVEL__)
666  #endif
667  #define DEPRECATED(msg) __attribute__((deprecated(msg)))
668  #elif GFX_COMPILER == GFX_COMPILER_MINGW64
669  #define GFX_COMPILER_NAME "MingW64"
670  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_GCC
671  #define GFX_COMPILER_VERSION_MAJOR (__GNUC__)
672  #define GFX_COMPILER_VERSION_MINOR (__GNUC_MINOR__)
673  #ifdef __GNUC_PATCHLEVEL__
674  #define GFX_COMPILER_VERSION_PATCH (__GNUC_PATCHLEVEL__)
675  #endif
676  #define DEPRECATED(msg) __attribute__((deprecated(msg)))
677  #elif GFX_COMPILER == GFX_COMPILER_MIPSPRO
678  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
679  #warning "Compiler: MIPSPRO"
680  #endif
681  #define GFX_COMPILER_NAME "MIPS Pro"
682  #ifdef _SGI_COMPILER_VERSION
683  #define GFX_COMPILER_VERSION_MAJOR ((_SGI_COMPILER_VERSION)/100)
684  #define GFX_COMPILER_VERSION_MINOR (((_SGI_COMPILER_VERSION)/10)%10)
685  #define GFX_COMPILER_VERSION_PATCH ((_SGI_COMPILER_VERSION)%10)
686  #else
687  #define GFX_COMPILER_VERSION_MAJOR ((_COMPILER_VERSION)/100)
688  #define GFX_COMPILER_VERSION_MINOR (((_COMPILER_VERSION)/10)%10)
689  #define GFX_COMPILER_VERSION_PATCH ((_COMPILER_VERSION)%10)
690  #endif
691  #elif GFX_COMPILER == GFX_COMPILER_MIRACLE
692  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
693  #warning "Compiler: MIRACLE"
694  #endif
695  #define GFX_COMPILER_NAME "Miracle C"
696  #elif GFX_COMPILER == GFX_COMPILER_MPW
697  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
698  #warning "Compiler: MPW"
699  #endif
700  #define GFX_COMPILER_NAME "MPW C++"
701  #define GFX_COMPILER_VERSION_MAJOR ((__MRC__)/0x100)
702  #define GFX_COMPILER_VERSION_MINOR ((__MRC__)%0x100)
703  #elif GFX_COMPILER == GFX_COMPILER_NORCROFT
704  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
705  #warning "Compiler: NORCROFT"
706  #endif
707  #define GFX_COMPILER_NAME "Norcroft C"
708  #elif GFX_COMPILER == GFX_COMPILER_NWCC
709  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
710  #warning "Compiler: NWCC"
711  #endif
712  #define GFX_COMPILER_NAME "NWCC"
713  #elif GFX_COMPILER == GFX_COMPILER_OPEN64
714  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
715  #warning "Compiler: OPEN64"
716  #endif
717  #define GFX_COMPILER_NAME "Open64"
718  #define GFX_COMPILER_VERSION_MAJOR (__OPENCC__)
719  #define GFX_COMPILER_VERSION_MINOR (__OPENCC_MINOR__)
720  #elif GFX_COMPILER == GFX_COMPILER_OSS
721  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
722  #warning "Compiler: OSS"
723  #endif
724  #define GFX_COMPILER_NAME "Oracle Solaris Studio"
725  #ifdef __SUNPRO_C >= 0x1000
726  #define GFX_COMPILER_VERSION_MAJOR ((__SUNPRO_C)/0x1000)
727  #define GFX_COMPILER_VERSION_MINOR (((((__SUNPRO_C)/0x100)%0x10)*10) + (((__SUNPRO_C)/0x10)%10))
728  #define GFX_COMPILER_VERSION_PATCH ((__SUNPRO_C)%0x10)
729  #else
730  #define GFX_COMPILER_VERSION_MAJOR ((__SUNPRO_C)/0x100)
731  #define GFX_COMPILER_VERSION_MINOR (((__SUNPRO_C)/0x10)%0x10)
732  #define GFX_COMPILER_VERSION_PATCH ((__SUNPRO_C)%0x10)
733  #endif
734  #elif GFX_COMPILER == GFX_COMPILER_PACIFIC
735  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
736  #warning "Compiler: PACIFIC"
737  #endif
738  #define GFX_COMPILER_NAME "Pacific C"
739  #elif GFX_COMPILER == GFX_COMPILER_PALM
740  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
741  #warning "Compiler: PALM"
742  #endif
743  #define GFX_COMPILER_NAME "Palm C/C++"
744  #define GFX_COMPILER_VERSION_MAJOR ((_PACC_VER)/0x10000000)
745  #define GFX_COMPILER_VERSION_MINOR (((_PACC_VER)/0x100000)%0x100)
746  #define GFX_COMPILER_VERSION_PATCH (((_PACC_VER)/0x1000)%0x100)
747  #define GFX_COMPILER_VERSION_BUILD ((_PACC_VER)%0x1000)
748  #elif GFX_COMPILER == GFX_COMPILER_PELLES
749  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
750  #warning "Compiler: PELLES"
751  #endif
752  #define GFX_COMPILER_NAME "Pelles C"
753  #define GFX_COMPILER_VERSION_MAJOR ((__POCC__)/100)
754  #define GFX_COMPILER_VERSION_MINOR ((__POCC__)%100)
755  #elif GFX_COMPILER == GFX_COMPILER_PGCC
756  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
757  #warning "Compiler: PGCC"
758  #endif
759  #define GFX_COMPILER_NAME "Portland PGCC/PGCPP"
760  #define GFX_COMPILER_VERSION_MAJOR (__PGIC__)
761  #define GFX_COMPILER_VERSION_MINOR (__PGIC_MINOR__)
762  #define GFX_COMPILER_VERSION_PATCH (__PGIC_PATCHLEVEL__)
763  #elif GFX_COMPILER == GFX_COMPILER_RENESAS
764  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
765  #warning "Compiler: RENESAS"
766  #endif
767  #define GFX_COMPILER_NAME "Renesas C/C++"
768  #ifdef __HITACHI_VERSION__
769  #define GFX_COMPILER_VERSION_MAJOR ((__HITACHI_VERSION__)/0x100)
770  #define GFX_COMPILER_VERSION_MINOR ((__HITACHI_VERSION__)%0x100)
771  #elif __RENESAS_VERSION__ < 0x10000
772  #define GFX_COMPILER_VERSION_MAJOR ((__RENESAS_VERSION__)/0x100)
773  #define GFX_COMPILER_VERSION_MINOR ((__RENESAS_VERSION__)%0x100)
774  #else
775  #define GFX_COMPILER_VERSION_MAJOR ((__RENESAS_VERSION__)/0x1000000)
776  #define GFX_COMPILER_VERSION_MINOR (((__RENESAS_VERSION__)/0x10000)%0x100)
777  #define GFX_COMPILER_VERSION_PATCH (((__RENESAS_VERSION__)/0x100)%0x100)
778  #define GFX_COMPILER_VERSION_BUILD ((__RENESAS_VERSION__)%0x100)
779  #endif
780  #elif GFX_COMPILER == GFX_COMPILER_SASC
781  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
782  #warning "Compiler: SASC"
783  #endif
784  #define GFX_COMPILER_NAME "SAS/C"
785  #ifdef __SASC__
786  #define GFX_COMPILER_VERSION_MAJOR ((__SASC__)/100)
787  #define GFX_COMPILER_VERSION_MINOR ((__SASC__)%100)
788  #else
789  #define GFX_COMPILER_VERSION_MAJOR (__VERSION__)
790  #define GFX_COMPILER_VERSION_MINOR (__REVISION__)
791  #endif
792  #elif GFX_COMPILER == GFX_COMPILER_SCO
793  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
794  #warning "Compiler: SCO"
795  #endif
796  #define GFX_COMPILER_NAME "SCO OpenServer"
797  #elif GFX_COMPILER == GFX_COMPILER_SDCC
798  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
799  #warning "Compiler: SDCC"
800  #endif
801  #define GFX_COMPILER_NAME "Small Device C"
802  #define GFX_COMPILER_VERSION_MAJOR ((SDCC)/100)
803  #define GFX_COMPILER_VERSION_MINOR (((SDCC)/10)%10)
804  #define GFX_COMPILER_VERSION_PATCH ((SDCC)%10)
805  #elif GFX_COMPILER == GFX_COMPILER_SN
806  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
807  #warning "Compiler: SN"
808  #endif
809  #define GFX_COMPILER_NAME "SN"
810  #elif GFX_COMPILER == GFX_COMPILER_STRATUS
811  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
812  #warning "Compiler: STRATUS"
813  #endif
814  #define GFX_COMPILER_NAME "Stratus VOS C"
815  #define GFX_COMPILER_VERSION_MAJOR (__VOSC__)
816  #elif GFX_COMPILER == GFX_COMPILER_SYMANTEC
817  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
818  #warning "Compiler: SYMANTEC"
819  #endif
820  #define GFX_COMPILER_NAME "Symantec C++"
821  #define GFX_COMPILER_VERSION_MAJOR ((__SC__)/0x100)
822  #define GFX_COMPILER_VERSION_MINOR ((__SC__)%0x100)
823  #elif GFX_COMPILER == GFX_COMPILER_TENDRA
824  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
825  #warning "Compiler: TENDRA"
826  #endif
827  #define GFX_COMPILER_NAME "TenDRA C/C++"
828  #elif GFX_COMPILER == GFX_COMPILER_THINK
829  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
830  #warning "Compiler: THINK"
831  #endif
832  #define GFX_COMPILER_NAME "Think C"
833  #ifdef THINKC4
834  #define GFX_COMPILER_VERSION_MAJOR (4)
835  #else
836  #define GFX_COMPILER_VERSION_MAJOR (3)
837  #endif
838  #elif GFX_COMPILER == GFX_COMPILER_TI
839  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
840  #warning "Compiler: TI"
841  #endif
842  #define GFX_COMPILER_NAME "Texas Instruments C/C++"
843  #define GFX_COMPILER_VERSION_MAJOR ((SDCC)/1000000)
844  #define GFX_COMPILER_VERSION_MINOR (((SDCC)/1000)%1000)
845  #define GFX_COMPILER_VERSION_PATCH ((SDCC)%1000)
846  #elif GFX_COMPILER == GFX_COMPILER_TINYC
847  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
848  #warning "Compiler: TINYC"
849  #endif
850  #define GFX_COMPILER_NAME "Tiny C"
851  #define GFX_COMPILER_TESTED TRUE
852  #elif GFX_COMPILER == GFX_COMPILER_TURBOC
853  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
854  #warning "Compiler: TURBOC"
855  #endif
856  #define GFX_COMPILER_NAME "Borland Turbo C/C++"
857  #if __TURBOC__ < 0x295 || __TURBOC__ >= 0x400
858  #define GFX_COMPILER_VERSION_MAJOR ((__TURBOC__)/0x100)
859  #define GFX_COMPILER_VERSION_MINOR ((__TURBOC__)%0x100)
860  #elif __TURBOC__ == 0x295
861  #define GFX_COMPILER_VERSION_MAJOR (1)
862  #define GFX_COMPILER_VERSION_MINOR (0)
863  #elif __TURBOC__ == 0x296
864  #define GFX_COMPILER_VERSION_MAJOR (1)
865  #define GFX_COMPILER_VERSION_MINOR (1)
866  #elif __TURBOC__ == 0x297
867  #define GFX_COMPILER_VERSION_MAJOR (2)
868  #define GFX_COMPILER_VERSION_MINOR (0)
869  #endif
870  #elif GFX_COMPILER == GFX_COMPILER_ULTIMATE
871  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
872  #warning "Compiler: ULTIMATE"
873  #endif
874  #define GFX_COMPILER_NAME "Ultimate C/C++"
875  #define GFX_COMPILER_VERSION_MAJOR (_MAJOR_REV)
876  #define GFX_COMPILER_VERSION_MINOR (_MINOR_REV)
877  #elif GFX_COMPILER == GFX_COMPILER_USL
878  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
879  #warning "Compiler: USL"
880  #endif
881  #define GFX_COMPILER_NAME "USL C"
882  #define GFX_COMPILER_VERSION_MAJOR ((__SCO_VERSION__)/100000000)
883  #define GFX_COMPILER_VERSION_MINOR (((__SCO_VERSION__)/1000000)%100)
884  #define GFX_COMPILER_VERSION_BUILD ((__SCO_VERSION__)%1000000)
885  #elif GFX_COMPILER == GFX_COMPILER_VBCC
886  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
887  #warning "Compiler: VBCC"
888  #endif
889  #define GFX_COMPILER_NAME "VBCC"
890  #elif GFX_COMPILER == GFX_COMPILER_VS
891  #define GFX_COMPILER_NAME "Microsoft Visual Studio"
892  #ifdef _MSC_FULL_VER
893  #if _MSC_FULL_VER < 100000000
894  #define GFX_COMPILER_VERSION_MAJOR ((_MSC_FULL_VER)/1000000)
895  #define GFX_COMPILER_VERSION_MINOR (((_MSC_FULL_VER)/10000)%100)
896  #define GFX_COMPILER_VERSION_PATCH (((_MSC_FULL_VER)/10000)%10000)
897  #else
898  #define GFX_COMPILER_VERSION_MAJOR ((_MSC_FULL_VER)/10000000)
899  #define GFX_COMPILER_VERSION_MINOR (((_MSC_FULL_VER)/100000)%100)
900  #define GFX_COMPILER_VERSION_PATCH (((_MSC_FULL_VER)/100000)%10000)
901  #endif
902  #else
903  #define GFX_COMPILER_VERSION_MAJOR ((_MSC_VER)/100)
904  #define GFX_COMPILER_VERSION_MINOR ((_MSC_VER)%100)
905  #endif
906  #ifdef _MSC_BUILD
907  #define GFX_COMPILER_VERSION_BUILD (_MSC_BUILD)
908  #endif
909  #define DEPRECATED(msg) __declspec(deprecated(msg))
910 
911  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_MACRO
912  #define COMPILER_WARNING(desc) __pragma(message(__FILE__ "(" GFXSTRX(__LINE__) "): warning uGFX: " desc))
913  #elif GFX_COMPILER == GFX_COMPILER_WATCOM
914  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
915  #warning "Compiler: WATCOM"
916  #endif
917  #define GFX_COMPILER_NAME "Watcom C"
918  #define GFX_COMPILER_VERSION_MAJOR ((__WATCOMC__)/100)
919  #define GFX_COMPILER_VERSION_MINOR ((__WATCOMC__)%100)
920  #elif GFX_COMPILER == GFX_COMPILER_ZTC
921  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
922  #warning "Compiler: ZTC"
923  #endif
924  #define GFX_COMPILER_NAME "Zortech C++"
925  #define GFX_COMPILER_VERSION_MAJOR ((__ZTC__)/0x100)
926  #define GFX_COMPILER_VERSION_MINOR (((__ZTC__)/0x10)%0x10)
927  #define GFX_COMPILER_VERSION_PATCH ((__ZTC__)%0x10)
928  #endif
929 
930  #ifndef GFX_COMPILER_TESTED
931  #define GFX_COMPILER_TESTED FALSE
932  #endif
933  #ifndef GFX_COMPILER_WARNING_TYPE
934  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_DIRECT
935  #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_GCC
936  #undef GFX_COMPILER_WARNING_TYPE
937  #define GFX_COMPILER_WARNING_TYPE GFX_COMPILER_WARNING_MACRO
938  #define COMPILER_PRAGMA(x) _Pragma(#x)
939  #define COMPILER_WARNING(desc) COMPILER_PRAGMA(GCC warning desc)
940  #endif
941  /************************************ End Compiler Settings *************************/
942 
943  /**
944  * @brief The name of the compiler set or auto-detected
945  * @details Read-Only
946  * @note If you successfully compile ugfx with an unknown compiler
947  * please report back to us via the ugfx forum so that we can add
948  * it to our list of compilers to detect.
949  */
950  #ifndef GFX_COMPILER_NAME
951  #define GFX_COMPILER_NAME "Unknown"
952  #warning "You are using an unknown compiler. Please report this on the ugfx forum"
953  #endif
954  #if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
955  #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
956  COMPILER_WARNING(GFXSTRX(Compiler: GFX_COMPILER_NAME))
957  #endif
958  #endif
959 
960  /**
961  * @brief This compiler is tested with ugfx
962  * @details Read-Only
963  * @note If you successfully compile ugfx with an un-tested compiler
964  * please report back to us via the ugfx forum any compile errors
965  * or warnings so that we can add it to our list of tested compilers.
966  * @note Although the compiler being used may be tested, it may have been
967  * tested with a different compiler version. Please report any problems
968  * on the ugfx forum.
969  */
970  #if !GFX_COMPILER_TESTED && GFX_DISPLAY_RULE_WARNINGS
971  #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
972  #warning "You are using an un-tested compiler. Please report any compile errors or warnings on the ugfx forum"
973  #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
974  COMPILER_WARNING(GFXSTRX(You are using the un-tested GFX_COMPILER_NAME compiler. Please report any compile errors or warnings on the ugfx forum))
975  #endif
976  #endif
977 
978  /**
979  * @brief The major version number of the compiler
980  * @details Read-Only. It will be set to 0 if it can't be automatically detected.
981  * @note If you know how to detect a version number for a compiler and we haven't,
982  * please report this on the ugfx forum.
983  */
984  #ifndef GFX_COMPILER_VERSION_MAJOR
985  #define GFX_COMPILER_VERSION_MAJOR 0
986  #endif
987  /**
988  * @brief The minor version number of the compiler
989  * @details Read-Only. It will be set to 0 if it can't be automatically detected.
990  * @note If you know how to detect a version number for a compiler and we haven't,
991  * please report this on the ugfx forum.
992  */
993  #ifndef GFX_COMPILER_VERSION_MINOR
994  #define GFX_COMPILER_VERSION_MINOR 0
995  #endif
996  /**
997  * @brief The patch version number of the compiler
998  * @details Read-Only. It will be set to 0 if it can't be automatically detected.
999  * @note If you know how to detect a version number for a compiler and we haven't,
1000  * please report this on the ugfx forum.
1001  */
1002  #ifndef GFX_COMPILER_VERSION_PATCH
1003  #define GFX_COMPILER_VERSION_PATCH 0
1004  #endif
1005  /**
1006  * @brief The build number of the compiler
1007  * @details Read-Only. It will be set to 0 if it can't be automatically detected.
1008  * @note If you know how to detect a version number for a compiler and we haven't,
1009  * please report this on the ugfx forum.
1010  */
1011  #ifndef GFX_COMPILER_VERSION_BUILD
1012  #define GFX_COMPILER_VERSION_BUILD 0
1013  #endif
1014 
1015  /**
1016  * @brief Enable CPU specific code
1017  * @details Auto detected by default but it can be overridden in gfxconf.h
1018  * @note This is setting enables optimisations and code options that are CPU specific.
1019  * @note If the CPU can't be auto-detected it is set to GFX_CPU_UNKNOWN
1020  * @note Auto-detection is particularly weak currently particularly for ARM and other
1021  * non-Intel platforms. This doesn't normally matter very much as everything is
1022  * handled with more conservative code. Where you might want to add a manual CPU
1023  * define is for operating systems such as RAW32 that use the generic ugfx thread code
1024  * rather than operating system defined threading routines. For these platforms specifying
1025  * the CPU can make a decent performance improvement.
1026  * @{
1027  */
1028  #ifndef GFX_CPU
1029  #define GFX_CPU GFX_CPU_UNKNOWN
1030  #endif
1031  #define GFX_CPU_UNKNOWN 0 //**< Unknown cpu
1032  #define GFX_CPU_CORTEX_M0 0x01 //**< Cortex M0
1033  #define GFX_CPU_CORTEX_M1 0x02 //**< Cortex M1
1034  #define GFX_CPU_CORTEX_M2 0x03 //**< Cortex M2
1035  #define GFX_CPU_CORTEX_M3 0x04 //**< Cortex M3
1036  #define GFX_CPU_CORTEX_M4 0x05 //**< Cortex M4
1037  #define GFX_CPU_CORTEX_M4_FP 0x06 //**< Cortex M4 with hardware floating point
1038  #define GFX_CPU_CORTEX_M7 0x07 //**< Cortex M7
1039  #define GFX_CPU_CORTEX_M7_FP 0x08 //**< Cortex M7 with hardware floating point
1040  #define GFX_CPU_X86 0x10 //**< Intel x86
1041  #define GFX_CPU_X64 0x11 //**< Intel x64
1042  #define GFX_CPU_IA64 0x12 //**< Intel Itanium
1043  #define GFX_CPU_POWERPC32 0x20 //**< PowerPC
1044  #define GFX_CPU_POWERPC64 0x21 //**< PowerPC
1045  #define GFX_CPU_SPARC 0x22 //**< Sparc
1046  /** @} */
1047 
1048  /************************************ Start CPU Auto-Detection *****************************/
1049  #if GFX_CPU == GFX_CPU_UNKNOWN
1050  #undef GFX_CPU
1051  #if defined(__ia64) || defined(__itanium__) || defined(_M_IA64)
1052  #define GFX_CPU GFX_CPU_IA64
1053  #elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)
1054  #if defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || defined(__64BIT__) || defined(_LP64) || defined(__LP64__)
1055  #define GFX_CPU GFX_CPU_POWERPC64
1056  #else
1057  #define GFX_CPU GFX_CPU_POWERPC32
1058  #endif
1059  #elif defined(__sparc)
1060  #define GFX_CPU GFX_CPU_SPARC
1061  #elif defined(__x86_64__) || defined(_M_X64) || defined(_M_AMD64) || defined(_WIN64)
1062  #define GFX_CPU GFX_CPU_X64
1063  #elif defined(__i386) || defined(_M_IX86) || defined(_WIN32)
1064  #define GFX_CPU GFX_CPU_X86
1065  #else
1066  #define GFX_CPU GFX_CPU_UNKNOWN
1067  #endif
1068  #endif
1069  /************************************ End CPU Auto-Detection *****************************/
1070 
1071  /************************************ Start CPU Settings *****************************/
1072  #if GFX_CPU == GFX_CPU_X86
1073  #undef GFX_CPU_NO_ALIGNMENT_FAULTS
1074  #define GFX_CPU_NO_ALIGNMENT_FAULTS TRUE
1075  #undef GFX_CPU_ENDIAN
1076  #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_LITTLE
1077  #elif GFX_CPU == GFX_CPU_X64
1078  #undef GFX_CPU_ENDIAN
1079  #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_LITTLE
1080  #endif
1081  /************************************ End CPU Settings *****************************/
1082 
1083  /**
1084  * @brief Does this CPU automatically handle alignment faults
1085  * @details Defaults to FALSE
1086  * @note Setting this to TRUE can decrease code size and increase speed but
1087  * it should not be turned on with a CPU that can generate
1088  * alignment segfaults.
1089  * @note If you are unsure leave this as FALSE as that generates
1090  * the more conservative code.
1091  * @note For some CPU's this can be auto-detected.
1092  */
1093  #ifndef GFX_CPU_NO_ALIGNMENT_FAULTS
1094  #define GFX_CPU_NO_ALIGNMENT_FAULTS FALSE
1095  #endif
1096 
1097  /**
1098  * @brief The endianness of the CPU
1099  * @details Auto detected by default but it can be overridden in gfxconf.h
1100  * @note This is setting enables optimisations that are cpu endian specific.
1101  * @note If the endianness can't be auto-detected it is set to GFX_CPU_ENDIAN_UNKNOWN
1102  * and safe (but potentially slow) code is generated
1103  * @{
1104  */
1105  #ifndef GFX_CPU_ENDIAN
1106  #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_UNKNOWN
1107  #endif
1108  #define GFX_CPU_ENDIAN_UNKNOWN 0 //**< Unknown endianness
1109  #define GFX_CPU_ENDIAN_LITTLE 0x03020100 //**< Little endian
1110  #define GFX_CPU_ENDIAN_BIG 0x00010203 //**< Big endian
1111  #define GFX_CPU_ENDIAN_WBDWL 0x02030001 //**< Words are big endian, DWords are little endian eg. Honeywell 316
1112  #define GFX_CPU_ENDIAN_WLDWB 0x01000302 //**< Words are little endian, DWords are big endian eg PDP-11
1113  /** @} */
1114 
1115  /************************************ Start Endianness Auto-Detection *****************************/
1116  #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_UNKNOWN
1117  #undef GFX_CPU_ENDIAN
1118  #if (defined(__BYTE_ORDER__)&&defined(__ORDER_BIG_ENDIAN__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) \
1119  || (defined(__BYTE_ORDER)&&defined(__BIG_ENDIAN)&&(__BYTE_ORDER == __BIG_ENDIAN)) \
1120  || defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN) \
1121  || defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) \
1122  || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(__ARMEB__)
1123  #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_BIG
1124  #elif (defined(__BYTE_ORDER__)&&defined(__ORDER_LITTLE_ENDIAN__)&&(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) \
1125  || (defined(__BYTE_ORDER)&&defined(_LITTLE_ENDIAN)&&(__BYTE_ORDER == _LITTLE_ENDIAN)) \
1126  || defined(__LITTLE_ENDIAN__) || defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN) \
1127  || defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) \
1128  || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(__ARMEL__) \
1129  || defined(__LITTLE_IF_NOT_BIG__)
1130  #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_LITTLE
1131  #else
1132  #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_UNKNOWN
1133  #endif
1134  #endif
1135  /************************************ End Endianness Auto-Detection *****************************/
1136 
1137  /**
1138  * @brief Mark a function as deprecated.
1139  */
1140  #ifndef DEPRECATED
1141  #define DEPRECATED(msg)
1142  #endif
1143 
1144  /**
1145  * @brief Mark a function as inline.
1146  */
1147  #ifndef GFXINLINE
1148  #define GFXINLINE inline
1149  #endif
1150 
1151 /** @} */
1152 
1153 #endif /* _GFX_COMPILERS_H */
1154 /** @} */
1155 
#define GFX_COMPILER_NAME
The name of the compiler set or auto-detected.