New SDK for gcc-3 compilations

This commit is contained in:
David Anderson 2005-08-18 06:34:34 +00:00
parent 29bfd81b36
commit fa64bef511
6 changed files with 57 additions and 7 deletions

View File

@ -274,3 +274,4 @@ void CmdMngr::clearBufforedInfo() {
}
int CmdMngr::Command::uniqueid = 0;

View File

@ -6,7 +6,7 @@ MM_ROOT = ../metamod/metamod
### EDIT BELOW FOR OTHER PROJECTS ###
OPT_FLAGS = -O3 -fno-rtti -funroll-loops -s -pipe
OPT_FLAGS = -O3 -funroll-loops -s -pipe
DEBUG_FLAGS = -g -ggdb3
CPP = gcc
NAME = amxmodx_mm
@ -15,7 +15,7 @@ OBJECTS = meta_api.cpp CFile.cpp CVault.cpp vault.cpp float.cpp file.cpp modules
CMisc.cpp CTask.cpp string.cpp amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp \
srvcmd.cpp strptime.cpp amxcore.cpp amxtime.cpp power.cpp amxxlog.cpp fakemeta.cpp \
amxxfile.cpp CLang.cpp md5.cpp emsg.cpp CForward.cpp CPlugin.cpp CModule.cpp \
CMenu.cpp util.cpp amx.cpp amxdbg.cpp natives.cpp newmenus.cpp mmgr/mmgr.cpp
CMenu.cpp util.cpp amx.cpp amxdbg.cpp natives.cpp newmenus.cpp
LINK = -lz
@ -31,10 +31,11 @@ else
endif
ifeq "$(MMGR)" "true"
OBJECTS += MMGR/MMGR.CPP
OBJECTS += mmgr/mmgr.cpp
CFLAGS += -DMEMORY_TEST
endif
CFLAGS += -DLINUX -DNDEBUG -fPIC -Wno-deprecated -DHAVE_STDINT_H -DMEMORY_TEST
CFLAGS += -DLINUX -DNDEBUG -fPIC -Wno-deprecated -DHAVE_STDINT_H -static-libgcc -fno-rtti -fno-exceptions
ifeq "$(AMD64)" "true"
BINARY = $(NAME)_amd64.so

View File

@ -313,3 +313,4 @@ void Client_ResetHUD(void* mValue)
}
*/

View File

@ -1756,3 +1756,24 @@ void *Module_ReqFnptr(const char *funcName)
return NULL;
}
#ifndef MEMORY_TEST
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

View File

@ -2909,6 +2909,28 @@ void operator delete[](void *reportedAddress)
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
}
#else
#if !defined NO_ALLOC_OVERRIDES && !defined MEMORY_TEST
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
#endif //MEMORY_TEST
/************* stuff from dlls/util.cpp *************/

View File

@ -27,6 +27,10 @@
// be careful of default constructors using new/malloc!
// #define MEMORY_TEST
// Unless you use STL or exceptions, keep this commented.
// It allows you to compile without libstdc++.so as a dependency
// #define NO_ALLOC_OVERRIDES
// - AMXX Init functions
// Also consider using FN_META_*
// AMXX query