From ee4f064073664f394f48480ab4030a6da12527c2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 24 Aug 2006 22:44:57 +0000 Subject: [PATCH] Initial bump to GCC-4.1 --- dlls/cstrike/Makefile | 10 ++++++++-- dlls/cstrike/amxxmodule.h | 14 +++++++++++--- dlls/csx/source/Makefile | 10 ++++++++-- dlls/csx/source/amxxmodule.h | 14 +++++++++++--- dlls/dod2/dodfun/Makefile | 10 ++++++++-- dlls/dod2/dodfun/amxxmodule.h | 14 +++++++++++--- dlls/dod2/dodx/Makefile | 10 ++++++++-- dlls/dod2/dodx/amxxmodule.h | 14 +++++++++++--- dlls/engine/Makefile | 10 ++++++++-- dlls/engine/amxxmodule.h | 14 +++++++++++--- dlls/fakemeta/Makefile | 15 +++++++++++---- dlls/fakemeta/sdk/amxxmodule.h | 14 +++++++++++--- dlls/fun/Makefile | 10 ++++++++-- dlls/geoip/Makefile | 12 +++++++++--- dlls/geoip/amxxmodule.h | 14 +++++++++++--- dlls/mysqlx/Makefile | 10 ++++++++-- dlls/mysqlx/sdk/amxxmodule.h | 2 +- dlls/ns/ns/Makefile | 12 +++++++++--- dlls/ns/ns/amxxmodule.h | 14 +++++++++++--- dlls/nvault/Makefile | 12 +++++++++--- dlls/nvault/amxxmodule.h | 14 +++++++++++--- dlls/regex/Makefile | 12 +++++++++--- dlls/regex/amxxmodule.h | 26 +++++++++++++++++++------- dlls/sockets/Makefile | 12 +++++++++--- dlls/sockets/amxxmodule.h | 26 +++++++++++++++++++------- dlls/sqlite/Makefile | 12 +++++++++--- dlls/sqlite/sdk/amxxmodule.h | 2 +- dlls/tfc/tfcx/Makefile | 10 ++++++++-- dlls/tfc/tfcx/amxxmodule.h | 26 +++++++++++++++++++------- dlls/ts/tsfun/Makefile | 10 ++++++++-- dlls/ts/tsfun/amxxmodule.h | 26 +++++++++++++++++++------- dlls/ts/tsx/Makefile | 10 ++++++++-- dlls/ts/tsx/amxxmodule.h | 26 +++++++++++++++++++------- 33 files changed, 341 insertions(+), 106 deletions(-) diff --git a/dlls/cstrike/Makefile b/dlls/cstrike/Makefile index 385a699f..e29cdb65 100755 --- a/dlls/cstrike/Makefile +++ b/dlls/cstrike/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = cstrike BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/cstrike/amxxmodule.h b/dlls/cstrike/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/cstrike/amxxmodule.h +++ b/dlls/cstrike/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/csx/source/Makefile b/dlls/csx/source/Makefile index 1f944f6f..e0ca5359 100755 --- a/dlls/csx/source/Makefile +++ b/dlls/csx/source/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -Wall -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = csx BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/csx/source/amxxmodule.h b/dlls/csx/source/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/csx/source/amxxmodule.h +++ b/dlls/csx/source/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/dod2/dodfun/Makefile b/dlls/dod2/dodfun/Makefile index 1ea4c66c..5419fa93 100755 --- a/dlls/dod2/dodfun/Makefile +++ b/dlls/dod2/dodfun/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = dodfun BIN_SUFFIX = amxx_i386.so @@ -20,6 +20,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/dod2/dodfun/amxxmodule.h b/dlls/dod2/dodfun/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/dod2/dodfun/amxxmodule.h +++ b/dlls/dod2/dodfun/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/dod2/dodx/Makefile b/dlls/dod2/dodx/Makefile index b7247b0a..1ebf7c29 100755 --- a/dlls/dod2/dodx/Makefile +++ b/dlls/dod2/dodx/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = dodx BIN_SUFFIX = amxx_i386.so @@ -20,6 +20,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/dod2/dodx/amxxmodule.h b/dlls/dod2/dodx/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/dod2/dodx/amxxmodule.h +++ b/dlls/dod2/dodx/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/engine/Makefile b/dlls/engine/Makefile index e082ff2b..a2d9bea6 100755 --- a/dlls/engine/Makefile +++ b/dlls/engine/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = engine BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/engine/amxxmodule.h b/dlls/engine/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/engine/amxxmodule.h +++ b/dlls/engine/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/fakemeta/Makefile b/dlls/fakemeta/Makefile index 21851671..b94d5c14 100755 --- a/dlls/fakemeta/Makefile +++ b/dlls/fakemeta/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = fakemeta BIN_SUFFIX_32 = amxx_i386.so @@ -22,6 +22,13 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common -I$(HLSDK)/pm_shared +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) @@ -30,7 +37,7 @@ else CFLAGS = $(OPT_FLAGS) endif -CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -static-libgcc -fno-rtti +CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -fno-exceptions -DHAVE_STDINT_H -static-libgcc -fno-rtti -Wno-invalid-offsetof ifeq "$(AMD64)" "true" BINARY = $(NAME)_$(BIN_SUFFIX_64) @@ -71,4 +78,4 @@ clean: rm -rf Debug/*.o rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32) rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64) - \ No newline at end of file + diff --git a/dlls/fakemeta/sdk/amxxmodule.h b/dlls/fakemeta/sdk/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/fakemeta/sdk/amxxmodule.h +++ b/dlls/fakemeta/sdk/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/fun/Makefile b/dlls/fun/Makefile index 2bb13544..ebe14a1f 100755 --- a/dlls/fun/Makefile +++ b/dlls/fun/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = fun BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/geoip/Makefile b/dlls/geoip/Makefile index 6e1e47a3..ea6f57d6 100755 --- a/dlls/geoip/Makefile +++ b/dlls/geoip/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = geoip BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) @@ -68,4 +74,4 @@ clean: rm -rf Debug/*.o rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32) rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64) - \ No newline at end of file + diff --git a/dlls/geoip/amxxmodule.h b/dlls/geoip/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/geoip/amxxmodule.h +++ b/dlls/geoip/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/mysqlx/Makefile b/dlls/mysqlx/Makefile index 612d359d..97612df8 100755 --- a/dlls/mysqlx/Makefile +++ b/dlls/mysqlx/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = mysql #MYSQL_DIR = ../../../mysql-5.0.22 MYSQL_DIR = ../../../mysql-5.0 @@ -26,6 +26,12 @@ INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_share -I$(MM_ROOT) -I$(HLSDK)/common -I$(MYSQL_DIR)/include -L$(MYSQL_DIR)/lib -Ithread \ -Imysql -Isdk +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/mysqlx/sdk/amxxmodule.h b/dlls/mysqlx/sdk/amxxmodule.h index aec781f1..1136e594 100755 --- a/dlls/mysqlx/sdk/amxxmodule.h +++ b/dlls/mysqlx/sdk/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif diff --git a/dlls/ns/ns/Makefile b/dlls/ns/ns/Makefile index 85646a76..a6627464 100755 --- a/dlls/ns/ns/Makefile +++ b/dlls/ns/ns/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = ns BIN_SUFFIX = amxx_i386.so @@ -20,6 +20,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common -I$(HLSDK)/pm_shared +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) @@ -57,4 +63,4 @@ clean: rm -rf Release/$(NAME)_$(BIN_SUFFIX) rm -rf Debug/*.o rm -rf Debug/$(NAME)_$(BIN_SUFFIX) - \ No newline at end of file + diff --git a/dlls/ns/ns/amxxmodule.h b/dlls/ns/ns/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/ns/ns/amxxmodule.h +++ b/dlls/ns/ns/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/nvault/Makefile b/dlls/nvault/Makefile index 8320430a..67193370 100755 --- a/dlls/nvault/Makefile +++ b/dlls/nvault/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = nvault BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = /lib/libgcc_eh.a /lib/libstdc++.a INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) @@ -68,4 +74,4 @@ clean: rm -rf Debug/*.o rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32) rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64) - \ No newline at end of file + diff --git a/dlls/nvault/amxxmodule.h b/dlls/nvault/amxxmodule.h index 986e0eb4..1136e594 100755 --- a/dlls/nvault/amxxmodule.h +++ b/dlls/nvault/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,8 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2253,6 +2255,8 @@ extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2320,8 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2396,6 +2402,8 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives #define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/regex/Makefile b/dlls/regex/Makefile index 505ab14d..961d0e2e 100755 --- a/dlls/regex/Makefile +++ b/dlls/regex/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = regex BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = -lpcre INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) @@ -70,4 +76,4 @@ clean: rm -rf Debug/*.o rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32) rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64) - \ No newline at end of file + diff --git a/dlls/regex/amxxmodule.h b/dlls/regex/amxxmodule.h index a84443b5..1136e594 100755 --- a/dlls/regex/amxxmodule.h +++ b/dlls/regex/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,7 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); +typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2251,6 +2254,9 @@ extern PFN_FINDLIBRARY g_fn_FindLibrary; extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; +extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2318,7 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } +const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2388,10 +2397,13 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_PlayerPropAddr g_fn_PlayerPropAddr #define MF_RegAuthFunc g_fn_RegAuthFunc #define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary; -#define MF_AddLibraries g_fn_AddLibraries; -#define MF_RemoveLibraries g_fn_RemoveLibraries; -#define MF_OverrideNatives g_fn_OverrideNatives; +#define MF_FindLibrary g_fn_FindLibrary +#define MF_AddLibraries g_fn_AddLibraries +#define MF_RemoveLibraries g_fn_RemoveLibraries +#define MF_OverrideNatives g_fn_OverrideNatives +#define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/sockets/Makefile b/dlls/sockets/Makefile index 79a4675f..e8d64b82 100755 --- a/dlls/sockets/Makefile +++ b/dlls/sockets/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = sockets BIN_SUFFIX_32 = amxx_i386.so @@ -21,6 +21,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) @@ -68,4 +74,4 @@ clean: rm -rf Debug/*.o rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32) rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64) - \ No newline at end of file + diff --git a/dlls/sockets/amxxmodule.h b/dlls/sockets/amxxmodule.h index a84443b5..1136e594 100755 --- a/dlls/sockets/amxxmodule.h +++ b/dlls/sockets/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,7 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); +typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2251,6 +2254,9 @@ extern PFN_FINDLIBRARY g_fn_FindLibrary; extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; +extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2318,7 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } +const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2388,10 +2397,13 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_PlayerPropAddr g_fn_PlayerPropAddr #define MF_RegAuthFunc g_fn_RegAuthFunc #define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary; -#define MF_AddLibraries g_fn_AddLibraries; -#define MF_RemoveLibraries g_fn_RemoveLibraries; -#define MF_OverrideNatives g_fn_OverrideNatives; +#define MF_FindLibrary g_fn_FindLibrary +#define MF_AddLibraries g_fn_AddLibraries +#define MF_RemoveLibraries g_fn_RemoveLibraries +#define MF_OverrideNatives g_fn_OverrideNatives +#define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/sqlite/Makefile b/dlls/sqlite/Makefile index fa5c79c4..13e0ca21 100755 --- a/dlls/sqlite/Makefile +++ b/dlls/sqlite/Makefile @@ -6,10 +6,10 @@ MM_ROOT = ../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fomit-frame-pointer -fno-strict-aliasing DEBUG_FLAGS = -g -ggdb3 -CPP = gcc -CC = cc +CPP = gcc-4.1 +CC = gcc-4.1 NAME = sqlite SQL = sqlite-source @@ -36,6 +36,12 @@ LINK = -static-libgcc -lpthread /lib/libgcc_eh.a /lib/libstdc++.a INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common -I$(SQL) -I./sqlitepp -I./sdk -I./thread +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/sqlite/sdk/amxxmodule.h b/dlls/sqlite/sdk/amxxmodule.h index aec781f1..1136e594 100755 --- a/dlls/sqlite/sdk/amxxmodule.h +++ b/dlls/sqlite/sdk/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif diff --git a/dlls/tfc/tfcx/Makefile b/dlls/tfc/tfcx/Makefile index b1176355..70d6fbae 100755 --- a/dlls/tfc/tfcx/Makefile +++ b/dlls/tfc/tfcx/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = tfcx BIN_SUFFIX = amxx_i386.so @@ -20,6 +20,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/tfc/tfcx/amxxmodule.h b/dlls/tfc/tfcx/amxxmodule.h index a84443b5..1136e594 100755 --- a/dlls/tfc/tfcx/amxxmodule.h +++ b/dlls/tfc/tfcx/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,7 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); +typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2251,6 +2254,9 @@ extern PFN_FINDLIBRARY g_fn_FindLibrary; extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; +extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2318,7 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } +const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2388,10 +2397,13 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_PlayerPropAddr g_fn_PlayerPropAddr #define MF_RegAuthFunc g_fn_RegAuthFunc #define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary; -#define MF_AddLibraries g_fn_AddLibraries; -#define MF_RemoveLibraries g_fn_RemoveLibraries; -#define MF_OverrideNatives g_fn_OverrideNatives; +#define MF_FindLibrary g_fn_FindLibrary +#define MF_AddLibraries g_fn_AddLibraries +#define MF_RemoveLibraries g_fn_RemoveLibraries +#define MF_OverrideNatives g_fn_OverrideNatives +#define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/ts/tsfun/Makefile b/dlls/ts/tsfun/Makefile index 7b96b2d8..b900f010 100755 --- a/dlls/ts/tsfun/Makefile +++ b/dlls/ts/tsfun/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O3 -funroll-loops -s -pipe +OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = tsfun BIN_SUFFIX = amxx_i386.so @@ -20,6 +20,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/ts/tsfun/amxxmodule.h b/dlls/ts/tsfun/amxxmodule.h index a84443b5..1136e594 100755 --- a/dlls/ts/tsfun/amxxmodule.h +++ b/dlls/ts/tsfun/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,7 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); +typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2251,6 +2254,9 @@ extern PFN_FINDLIBRARY g_fn_FindLibrary; extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; +extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2318,7 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } +const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2388,10 +2397,13 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_PlayerPropAddr g_fn_PlayerPropAddr #define MF_RegAuthFunc g_fn_RegAuthFunc #define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary; -#define MF_AddLibraries g_fn_AddLibraries; -#define MF_RemoveLibraries g_fn_RemoveLibraries; -#define MF_OverrideNatives g_fn_OverrideNatives; +#define MF_FindLibrary g_fn_FindLibrary +#define MF_AddLibraries g_fn_AddLibraries +#define MF_RemoveLibraries g_fn_RemoveLibraries +#define MF_OverrideNatives g_fn_OverrideNatives +#define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/ diff --git a/dlls/ts/tsx/Makefile b/dlls/ts/tsx/Makefile index bef87582..43f15f8b 100755 --- a/dlls/ts/tsx/Makefile +++ b/dlls/ts/tsx/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../../../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -pipe +OPT_FLAGS = -O2 -funroll-loops -s -pipe -fno-strict-aliasing -fomit-frame-pointer DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = tsx BIN_SUFFIX = amxx_i386.so @@ -22,6 +22,12 @@ LINK = INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/dlls/ts/tsx/amxxmodule.h b/dlls/ts/tsx/amxxmodule.h index a84443b5..1136e594 100755 --- a/dlls/ts/tsx/amxxmodule.h +++ b/dlls/ts/tsx/amxxmodule.h @@ -22,7 +22,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else -#define DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) #define LINUX #endif @@ -2179,7 +2179,10 @@ typedef void (*PFN_UNREG_AUTH_FUNC) (AUTHORIZEFUNC); typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); -typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/, const char * /*myname*/); +typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); +typedef int (*PFN_AMX_REREGISTER) (AMX * /*amx*/, AMX_NATIVE_INFO * /*list*/, int /*list*/); +typedef void * (*PFN_REGISTERFUNCTIONEX) (void * /*pfn*/, const char * /*desc*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2251,6 +2254,9 @@ extern PFN_FINDLIBRARY g_fn_FindLibrary; extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; +extern PFN_GETLOCALINFO g_fn_GetLocalInfo; +extern PFN_AMX_REREGISTER g_fn_AmxReRegister; +extern PFN_REGISTERFUNCTIONEX g_fn_RegisterFunctionEx; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2318,7 +2324,10 @@ void MF_UnregAuthFunc (AUTHORIZEFUNC fn) { } int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } -void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +void MF_OverrideNatives (AMX_NATIVE_INFO *natives, const char *myname) { } +const char * MF_GetLocalInfo (const char *name, const char *def) { } +int MF_AmxReRegister (AMX *amx, AMX_NATIVE_INFO *list, int number) { return 0; } +void * MF_RegisterFunctionEx (void *pfn, const char *description) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2388,10 +2397,13 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_PlayerPropAddr g_fn_PlayerPropAddr #define MF_RegAuthFunc g_fn_RegAuthFunc #define MF_UnregAuthFunc g_fn_UnregAuthFunc -#define MF_FindLibrary g_fn_FindLibrary; -#define MF_AddLibraries g_fn_AddLibraries; -#define MF_RemoveLibraries g_fn_RemoveLibraries; -#define MF_OverrideNatives g_fn_OverrideNatives; +#define MF_FindLibrary g_fn_FindLibrary +#define MF_AddLibraries g_fn_AddLibraries +#define MF_RemoveLibraries g_fn_RemoveLibraries +#define MF_OverrideNatives g_fn_OverrideNatives +#define MF_GetLocalInfo g_fn_GetLocalInfo +#define MF_AmxReRegister g_fn_AmxReRegister +#define MF_RegisterFunctionEx g_fn_RegisterFunctionEx #ifdef MEMORY_TEST /*** Memory ***/