diff --git a/sourcemm/ISmmPlugin.h b/sourcemm/ISmmPlugin.h index ac59685..b54f7be 100644 --- a/sourcemm/ISmmPlugin.h +++ b/sourcemm/ISmmPlugin.h @@ -240,7 +240,11 @@ public: #if defined __WIN32__ || defined _WIN32 || defined WIN32 #define SMM_API extern "C" __declspec(dllexport) #elif defined __GNUC__ - #define SMM_API extern "C" + #if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) + #define SMM_API extern "C" __attribute__ ((visibility("default"))) + #else + #define SMM_API extern "C" + #endif #endif #endif //!defined SMM_API diff --git a/sourcemm/Makefile b/sourcemm/Makefile index fc2a952..e5af1a3 100644 --- a/sourcemm/Makefile +++ b/sourcemm/Makefile @@ -7,9 +7,9 @@ SRCDS = ~/srcds ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fvisibility=hidden DEBUG_FLAGS = -g -ggdb3 -CPP = gcc-3.4 +CPP = gcc-4.1 BINARY = server_i486.so OBJECTS = oslink.cpp util.cpp convar.cpp concommands.cpp \ @@ -60,4 +60,4 @@ clean: rm -rf Release/$(BINARY) rm -rf Debug/*.o rm -rf Debug/$(BINARY) - \ No newline at end of file + diff --git a/sourcemm/oslink.h b/sourcemm/oslink.h index 03d7af5..1b655fc 100644 --- a/sourcemm/oslink.h +++ b/sourcemm/oslink.h @@ -61,7 +61,11 @@ 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__ - #define SMM_API extern "C" + #if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 1) + #define SMM_API extern "C" __attribute__ ((visibility("default"))) + #else + #define SMM_API extern "C" + #endif #endif #if defined __WIN32__ || defined _WIN32 || defined WIN32