From 29bfd81b365f305098dd1c3167b513f7ab7a84bd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 18 Aug 2005 06:32:59 +0000 Subject: [PATCH] New SDK for gcc-3 compilation --- dlls/fun/Makefile | 4 ++-- dlls/fun/amxxmodule.cpp | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/fun/Makefile b/dlls/fun/Makefile index 5bc265cf..41b02e28 100755 --- a/dlls/fun/Makefile +++ b/dlls/fun/Makefile @@ -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 = fun_amxx @@ -26,7 +26,7 @@ else CFLAGS = $(OPT_FLAGS) endif -CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H +CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -fno-rtti -static-libgcc ifeq "$(AMD64)" "true" BINARY = $(NAME)_amd64.so diff --git a/dlls/fun/amxxmodule.cpp b/dlls/fun/amxxmodule.cpp index 9dfe57be..43ded3bf 100755 --- a/dlls/fun/amxxmodule.cpp +++ b/dlls/fun/amxxmodule.cpp @@ -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 *************/