From f8d0fc08b2c23f31d830241b335b1b953785722b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 9 Aug 2006 01:52:49 +0000 Subject: [PATCH] Added GCC-4.1 compatibility --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40248 --- sourcemm/CPlugin.cpp | 2 +- sourcemm/CSmmAPI.cpp | 2 +- sourcemm/CSmmAPI.h | 2 +- sourcemm/Makefile | 4 ++-- sourcemm/sourcemm.cpp | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sourcemm/CPlugin.cpp b/sourcemm/CPlugin.cpp index 66a3cac..c1d005b 100644 --- a/sourcemm/CPlugin.cpp +++ b/sourcemm/CPlugin.cpp @@ -338,7 +338,7 @@ CPluginManager::CPlugin *CPluginManager::_Load(const char *file, PluginId source snprintf(error, maxlen, "%s", dlerror()); pl->m_Status = Pl_Error; } else { - CreateInterfaceFn pfn = reinterpret_cast(dlsym(pl->m_Lib, PL_EXPOSURE_C)); + CreateInterfaceFn pfn = (CreateInterfaceFn)(dlsym(pl->m_Lib, PL_EXPOSURE_C)); if (!pfn) { if (error) diff --git a/sourcemm/CSmmAPI.cpp b/sourcemm/CSmmAPI.cpp index 4847c51..f63eb31 100644 --- a/sourcemm/CSmmAPI.cpp +++ b/sourcemm/CSmmAPI.cpp @@ -204,7 +204,7 @@ void *CSmmAPI::MetaFactory(const char *iface, int *_ret, PluginId *id) #define ENGINEW32_OFFS 38 #define IA32_CALL 0xE8 -bool vcmp(void *_addr1, void *_addr2, size_t len) +bool vcmp(const void *_addr1, const void *_addr2, size_t len) { unsigned char *addr1 = (unsigned char *)_addr1; unsigned char *addr2 = (unsigned char *)_addr2; diff --git a/sourcemm/CSmmAPI.h b/sourcemm/CSmmAPI.h index eed291f..a14433b 100644 --- a/sourcemm/CSmmAPI.h +++ b/sourcemm/CSmmAPI.h @@ -25,7 +25,7 @@ namespace SourceMM class CSmmAPI : public ISmmAPI { public: - CSmmAPI::CSmmAPI(); + CSmmAPI(); public: void LogMsg(ISmmPlugin *pl, const char *msg, ...); public: diff --git a/sourcemm/Makefile b/sourcemm/Makefile index 4bb924d..725a80f 100644 --- a/sourcemm/Makefile +++ b/sourcemm/Makefile @@ -1,9 +1,9 @@ #(C)2004-2005 SourceMM Development Team # Makefile written by David "BAILOPAN" Anderson -HL2SDK = ../../hl2sdk +HL2SDK = ../hl2sdk SMM_ROOT = .. -SRCDS = ~/srcds_l +SRCDS = ~/srcds ### EDIT BELOW FOR OTHER PROJECTS ### diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index a1a9909..079bf52 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -686,21 +686,21 @@ bool LevelInit_handler(char const *pMapName, char const *pMapEntities, char cons RETURN_META_VALUE(MRES_IGNORED, false); } -#if defined __GNUC__ && (__GNUC__ == 3) -void * ::operator new(size_t size) { +#if defined __GNUC__ && (__GNUC__ == 3 || __GNUC__ == 4) +void * operator new(size_t size) { return(calloc(1, size)); } -void * ::operator new[](size_t size) { +void * operator new[](size_t size) { return(calloc(1, size)); } -void ::operator delete(void * ptr) { +void operator delete(void * ptr) { if(ptr) free(ptr); } -void ::operator delete[](void * ptr) { +void operator delete[](void * ptr) { if(ptr) free(ptr); }