From 849369cceccfa3b9d70257306a8a93cfb852263e Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 12 Nov 2015 18:43:20 +1000 Subject: Fix compiler detection for Keil uVision V5 --- gfx.h | 4 ++-- src/gos/gos_x_threads.c | 4 ++-- src/gwin/gwin_class.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gfx.h b/gfx.h index aeced09e..53c9b94f 100644 --- a/gfx.h +++ b/gfx.h @@ -286,7 +286,7 @@ #define GFX_COMPILER GFX_COMPILER_MINGW64 #elif defined(__CYGWIN__) #define GFX_COMPILER GFX_COMPILER_CYGWIN - #elif defined(__KEIL__) || defined(__C51__) + #elif defined(__KEIL__) || defined(__C51__) || (defined(__CC_ARM) && defined(__EDG__)) #define GFX_COMPILER GFX_COMPILER_KEIL #elif defined(__clang__) #define GFX_COMPILER GFX_COMPILER_CLANG @@ -392,7 +392,7 @@ #if GFX_NO_INLINE #define GFXINLINE #else - #if defined(__KEIL__) || defined(__C51__) + #if GFX_COMPILER == GFX_COMILER_KEIL #define GFXINLINE __inline #else #define GFXINLINE inline diff --git a/src/gos/gos_x_threads.c b/src/gos/gos_x_threads.c index 8a781b21..bdb61ab9 100644 --- a/src/gos/gos_x_threads.c +++ b/src/gos/gos_x_threads.c @@ -203,12 +203,12 @@ static thread mainthread; // The main thread context * If they don't exist compile them to be the standard setjmp() function. * Similarly for longjmp(). */ - #if (!defined(setjmp) && !defined(_setjmp)) || defined(__KEIL__) || defined(__C51__) + #if (!defined(setjmp) && !defined(_setjmp)) || GFX_COMPILER == GFX_COMILER_KEIL #define CXT_SAVE setjmp #else #define CXT_SAVE _setjmp #endif - #if (!defined(longjmp) && !defined(_longjmp)) || defined(__KEIL__) || defined(__C51__) + #if (!defined(longjmp) && !defined(_longjmp)) || GFX_COMPILER == GFX_COMILER_KEIL #define CXT_RESTORE longjmp #else #define CXT_RESTORE _longjmp diff --git a/src/gwin/gwin_class.h b/src/gwin/gwin_class.h index 7946a839..ac89f672 100644 --- a/src/gwin/gwin_class.h +++ b/src/gwin/gwin_class.h @@ -23,7 +23,7 @@ #if GFX_USE_GWIN || defined(__DOXYGEN__) -#if defined(__KEIL__) || defined(__C51__) +#if GFX_COMPILER == GFX_COMILER_KEIL #pragma anon_unions #endif -- cgit v1.2.3