Merge from sourcemod-1.1 branch.

This commit is contained in:
David Anderson
2008-12-28 03:23:45 -05:00
79 changed files with 1133 additions and 470 deletions
+12 -5
View File
@@ -27,7 +27,7 @@ C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc-4.1
CPP = gcc
override ENGSET = false
ifeq "$(ENGINE)" "original"
@@ -73,7 +73,7 @@ else
INCLUDE += -I. -I.. -Isdk -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(MMSOURCE17)/core/sourcehook
endif
LINK += lib_linux/libpcre.a -static-libgcc
LINK += -m32 -ldl -lm
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -mfpmath=sse \
@@ -96,14 +96,21 @@ ifeq "$(USEMETA)" "true"
BIN_DIR := $(BIN_DIR).$(ENGINE)
endif
OS := $(shell uname -s)
ifeq "$(OS)" "Darwin"
LINK += lib_darwin_x86/libpcre.a -dynamiclib
BINARY = $(PROJECT).ext.dylib
else
LINK += lib_linux/libpcre.a -static-libgcc -shared
BINARY = $(PROJECT).ext.so
endif
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
ifeq "$(GCC_VERSION)" "4"
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
BINARY = $(PROJECT).ext.so
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
$(BIN_DIR)/%.o: %.cpp
@@ -124,7 +131,7 @@ check:
fi
extension: check $(OBJ_LINUX)
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -o $(BIN_DIR)/$(BINARY)
debug:
$(MAKE) -f Makefile all DEBUG=true
+10 -3
View File
@@ -30,7 +30,7 @@
*/
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include "smsdk_ext.h"
/**
@@ -94,6 +94,9 @@ ITextParsers *textparsers = NULL;
#if defined SMEXT_ENABLE_USERMSGS
IUserMessages *usermsgs = NULL;
#endif
#if defined SMEXT_ENABLE_TRANSLATOR
ITranslator *translator = NULL;
#endif
/** Exports the main interface */
PLATFORM_EXTERN_C IExtensionInterface *GetSMExtAPI()
@@ -179,6 +182,9 @@ bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error,
#if defined SMEXT_ENABLE_USERMSGS
SM_GET_IFACE(USERMSGS, usermsgs);
#endif
#if defined SMEXT_ENABLE_TRANSLATOR
SM_GET_IFACE(TRANSLATOR, translator);
#endif
if (SDK_OnLoad(error, maxlength, late))
{
@@ -311,7 +317,7 @@ bool SDKExtension::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen,
{
PLUGIN_SAVEVARS();
#if defined METAMOD_PLAPI_VERSION
#if !defined METAMOD_PLAPI_VERSION
GET_V_IFACE_ANY(serverFactory, gamedll, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
GET_V_IFACE_CURRENT(engineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
#else
@@ -428,7 +434,7 @@ bool SDKExtension::SDK_OnMetamodPauseChange(bool paused, char *error, size_t max
#endif
/* Overload a few things to prevent libstdc++ linking */
#if defined __linux__
#if defined __linux__ || defined __APPLE__
extern "C" void __cxa_pure_virtual(void)
{
}
@@ -453,3 +459,4 @@ void operator delete[](void * ptr)
free(ptr);
}
#endif