µGFX library fork

gfx_compilers.h 47KB

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