Added support for GCC-4.1's symbol optimizations

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40278
This commit is contained in:
David Anderson 2006-08-14 07:59:45 +00:00
parent ea40637b37
commit 66b36c0fe4
3 changed files with 13 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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