Skip to content

Commit

Permalink
Fix more issues compiling on GCC 5+.
Browse files Browse the repository at this point in the history
  • Loading branch information
psychonic committed Nov 9, 2016
1 parent 4684671 commit 760126e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 21 deletions.
6 changes: 0 additions & 6 deletions core/ISmmAPI.h
Expand Up @@ -49,12 +49,6 @@ class ConCommandBase;
#include <ISmmPlugin.h>
#include <ISmmPluginExt.h>

#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 */
Expand Down
6 changes: 1 addition & 5 deletions core/ISmmPlugin.h
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion core/metamod_oslink.cpp
Expand Up @@ -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);
}
Expand Down
6 changes: 1 addition & 5 deletions core/metamod_oslink.h
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions loader/loader.cpp
Expand Up @@ -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 *
Expand Down

0 comments on commit 760126e

Please sign in to comment.