From 9772bf6c4311ce905cdee7df07eafb96cbc7e4af Mon Sep 17 00:00:00 2001 From: Robear Selwans Date: Mon, 31 Jan 2022 19:19:41 +0200 Subject: [PATCH] Updated EV_WARNING_* Signed-off-by: Robear Selwans --- ev_macros.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ev_macros.h b/ev_macros.h index 4b436f1..c80e0b6 100644 --- a/ev_macros.h +++ b/ev_macros.h @@ -40,13 +40,16 @@ #define EV_PRAGMA(...) _Pragma(EV_STRINGIZE(__VA_ARGS__)) #if ( EV_CC_MSVC ) -# define EV_WARNING_DISABLE(...) EV_UNIMPLEMENTED() -# define EV_WARNING_PUSH() EV_UNIMPLEMENTED() -# define EV_WARNING_POP() EV_UNIMPLEMENTED() +# define EV_WARNING_DISABLE_MSVC(w) EV_PRAGMA(warning(disable:w)) +# define EV_WARNING_PUSH() EV_PRAGMA(warning(push)) +# define EV_WARNING_POP() EV_PRAGMA(warning(pop)) # define EV_EXPORT __declspec(dllexport) # define EV_IMPORT __declspec(dllimport) # define EV_UNUSED # define EV_FORCEINLINE __forceinline + +# define EV_WARNING_DISABLE_CLANG(...) +# define EV_WARNING_DISABLE_GCC(...) #elif ( EV_CC_GCC || EV_CC_CLANG ) # define EV_EXPORT __attribute__((visibility("default"))) # define EV_IMPORT @@ -54,12 +57,15 @@ # define EV_FORCEINLINE inline __attribute__((always_inline)) # if ( EV_CC_GCC ) # define EV_PRAGMA_CC_NAME GCC +# define EV_WARNING_DISABLE_GCC(w) EV_PRAGMA(EV_PRAGMA_CC_NAME diagnostic ignored "-W"w) # elif ( EV_CC_CLANG ) # define EV_PRAGMA_CC_NAME clang +# define EV_WARNING_DISABLE_CLANG(w) EV_PRAGMA(EV_PRAGMA_CC_NAME diagnostic ignored "-W"w) # endif -# define EV_WARNING_DISABLE(w) EV_PRAGMA(EV_PRAGMA_CC_NAME diagnostic ignored "-W"w) # define EV_WARNING_PUSH() EV_PRAGMA(EV_PRAGMA_CC_NAME diagnostic push) # define EV_WARNING_POP() EV_PRAGMA(EV_PRAGMA_CC_NAME diagnostic pop) + +#define EV_WARNING_DISABLE_MSVC() #else # error "Unknown Compiler" #endif