From 760126ea8c33be78dcb00c2695875d90e904508c Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Wed, 9 Nov 2016 18:08:26 -0500 Subject: [PATCH] Fix more issues compiling on GCC 5+. --- core/ISmmAPI.h | 6 ------ core/ISmmPlugin.h | 6 +----- core/metamod_oslink.cpp | 2 +- core/metamod_oslink.h | 6 +----- loader/loader.cpp | 4 ---- 5 files changed, 3 insertions(+), 21 deletions(-) diff --git a/core/ISmmAPI.h b/core/ISmmAPI.h index 65a01fd..5b134cf 100644 --- a/core/ISmmAPI.h +++ b/core/ISmmAPI.h @@ -49,12 +49,6 @@ class ConCommandBase; #include #include -#if defined __GNUC__ -#if ((__GNUC__ == 3) && (__GNUC_MINOR__ < 4)) || (__GNUC__ < 3) -#error "You must compile with at least GCC 3.4! If you know what you are doing, you can remove this message." -#endif //version check -#endif //__GNUC__ - #define MMIFACE_SOURCEHOOK "ISourceHook" /**< ISourceHook Pointer */ #define MMIFACE_PLMANAGER "IPluginManager" /**< SourceMM Plugin Functions */ #define MMIFACE_SH_HOOKMANAUTOGEN "IHookManagerAutoGen" /**< SourceHook::IHookManagerAutoGen Pointer */ diff --git a/core/ISmmPlugin.h b/core/ISmmPlugin.h index 12a0665..e77e2c5 100644 --- a/core/ISmmPlugin.h +++ b/core/ISmmPlugin.h @@ -484,11 +484,7 @@ using namespace SourceMM; #if defined __WIN32__ || defined _WIN32 || defined WIN32 #define SMM_API extern "C" __declspec(dllexport) #elif defined __GNUC__ - #if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) - #define SMM_API extern "C" __attribute__ ((visibility("default"))) - #else - #define SMM_API extern "C" - #endif + #define SMM_API extern "C" __attribute__ ((visibility("default"))) #endif #endif //!defined SMM_API diff --git a/core/metamod_oslink.cpp b/core/metamod_oslink.cpp index 2ec065d..a100ea7 100644 --- a/core/metamod_oslink.cpp +++ b/core/metamod_oslink.cpp @@ -94,7 +94,7 @@ bool GetFileOfAddress(void *pAddr, char *buffer, size_t maxlength) return true; } -#if defined __GNUC__ && (__GNUC__ == 3 || __GNUC__ == 4) +#if defined __GNUC__ void * operator new(size_t size) { return malloc(size); } diff --git a/core/metamod_oslink.h b/core/metamod_oslink.h index 03b6764..78c6e20 100644 --- a/core/metamod_oslink.h +++ b/core/metamod_oslink.h @@ -90,11 +90,7 @@ bool GetFileOfAddress(void *pAddr, char *buffer, size_t maxlength); #if defined __WIN32__ || defined _WIN32 || defined WIN32 #define SMM_API extern "C" __declspec(dllexport) #elif defined __GNUC__ - #if (__GNUC__ == 4) - #define SMM_API extern "C" __attribute__ ((visibility("default"))) - #else - #define SMM_API extern "C" - #endif + #define SMM_API extern "C" __attribute__ ((visibility("default"))) #endif #if defined __WIN32__ || defined _WIN32 || defined WIN32 diff --git a/loader/loader.cpp b/loader/loader.cpp index 8d7c95f..601faff 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -146,11 +146,7 @@ mm_UnloadMetamodLibrary() #if defined _WIN32 #define EXPORT extern "C" __declspec(dllexport) #elif defined __GNUC__ -#if __GNUC__ >= 4 #define EXPORT extern "C" __attribute__ ((visibility("default"))) -#else -#define EXPORT extern "C" -#endif #endif EXPORT void *