1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-18 11:54:14 +01:00

Linux compatibility for no-STL

--HG--
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40107
This commit is contained in:
David Anderson 2005-09-13 20:20:49 +00:00
parent e2aa8d06a0
commit 2917c2c751
3 changed files with 24 additions and 4 deletions

View File

@ -24,7 +24,7 @@
#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."
//#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__

View File

@ -9,13 +9,13 @@ SRCDS = ~/srcds_l
OPT_FLAGS = -O3 -fno-rtti -funroll-loops -s -pipe
DEBUG_FLAGS = -g -ggdb3
CPP = g++
CPP = gcc
BINARY = server_i486.so
OBJECTS = oslink.cpp util.cpp convar.cpp concommands.cpp \
CSmmAPI.cpp sourcemm.cpp CPlugin.cpp sourcehook.cpp
LINK = vstdlib_i486.so tier0_i486.so
LINK = vstdlib_i486.so tier0_i486.so -static-libgcc
HL2PUB = $(HL2SDK)/public
@ -30,7 +30,7 @@ else
CFLAGS = $(OPT_FLAGS)
endif
CFLAGS += -fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -fPIC -Wno-deprecated
CFLAGS += -fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -fPIC -Wno-deprecated -fno-exceptions -fno-rtti
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)

View File

@ -466,3 +466,23 @@ bool CServerGameDLL::LevelInit( char const *pMapName, char const *pMapEntities,
return m_pOrig->LevelInit(pMapName, pMapEntities, pOldLevel, pLandmarkName, loadGame, background);
}
#if defined __GNUC__ && (__GNUC__ == 3)
void * ::operator new(size_t size) {
return(calloc(1, size));
}
void * ::operator new[](size_t size) {
return(calloc(1, size));
}
void ::operator delete(void * ptr) {
if(ptr)
free(ptr);
}
void ::operator delete[](void * ptr) {
if(ptr)
free(ptr);
}
#endif