70 Commits

Author SHA1 Message Date
3db718799f Bump version for release.
Former-commit-id: 4e0f69d8421b4d0a421f5960ce8ff77497acfa63
2013-02-14 00:51:48 -08:00
146d77f819 Fixed Windows tsx build.
Former-commit-id: 9ffe0365415ba5cd9fdaa12782c9677f8f1ca951
2013-02-13 03:32:25 -06:00
06a9241bcf Changed my handle.
Former-commit-id: 9b29f183153a23dbf0f830cb4580dc4dd2853143
2013-02-13 03:23:27 -06:00
ce4b23b41a Fixed metamod paths in MSVC projects.
Former-commit-id: c99a90817fb726ee28783d9b1139e4d540daa9fa
2013-02-13 03:22:59 -06:00
3184d1466e Backout changeset aa745bf0c347 (bug 3302) for regression reported in bug 5552.
Former-commit-id: 0d2385b0045e46fdefee4ca2b5f6442397cfbe60
2013-02-13 01:13:18 -08:00
8793d8f8d5 Fix strfind ignoring its last parameter (bug 4070, r=dvander).
Former-commit-id: a31621dd0c08c7bbede41a06d0ebf8abab1b66a5
2013-02-13 00:54:26 -08:00
a26a98cb98 Fix incorrect result for replace_all (bug 5064, r=dvander).
Former-commit-id: e3824c4c87c43734e6c5d4831f2ca7cece0a5147
2013-02-13 00:40:57 -08:00
5e69db511c Made amxxpc_osx executable.
Former-commit-id: ea2a4889fe69274051fa71b1d94308935cdc34e4
2013-02-13 02:32:01 -06:00
468aaba79e Fix last map being duplicated for each blank line in maps file (bug 5005, r=dvander).
Former-commit-id: e0bcbaeac750a494eb700dea78dd7210783d7623
2013-02-13 00:29:54 -08:00
a3aa086375 Fix crash in EngFunc_TraceTexture (bug 4576, r=dvander).
Former-commit-id: c439946a3451dbdfafa2f542e08bc7f83d586165
2013-02-13 00:27:53 -08:00
82ad133d91 Add hamsandwich support for Adrenaile Gamer (bug 4445, r=dvander).
Former-commit-id: e08f1dfccf3b5bfb65687aee06c5d8fdbff94540
2013-02-13 00:25:48 -08:00
250cb89479 Really fixed HLSDK paths in MSVC project files.
Former-commit-id: e04d44c85196034f5deebbf3c46ecc9fc710aeed
2013-02-13 02:08:29 -06:00
121dc75451 Directly kick players rather than use a loopback command (bug 3884, r=dvander).
Former-commit-id: dfe1903ecf4faa49b83b85213aa0fbc083fbb0c2
2013-02-13 00:15:40 -08:00
69c06545ce bug 3553 follow-up fix.
Former-commit-id: 65d97fe5f5bca0c3a3ba8574f7c924d8ba7dc1cd
2013-02-13 00:09:34 -08:00
9e5b5683af Increase the capacity of speech.ini (bug 3553, r=dvander).
Former-commit-id: d10ef5e49419251d3c841148093fb3210bc6d028
2013-02-13 00:08:32 -08:00
f01357aa7a Fixed HLSDK paths in VS 2010 projects files.
Former-commit-id: 32516f18ee3b87c2030ba5fad91f0b3e7a1ec741
2013-02-13 01:22:50 -06:00
7f13ae3e4f Fixed buildbot Perl scripts for Mac OS X build (bug 5601, r=dvander).
Former-commit-id: 375e91c1d22c5cc2a9107bbc804cbc17794421d4
2013-02-13 01:22:40 -06:00
e5b990b8e0 Removed dlsym from Linux package.
Only dlsym64 is completely gone. The dlsym binary must remain to be used by the builder. It just won't appear in the Linux download pacakages anymore.


Former-commit-id: c387cdeff8270d4e2f1dab7e66173f1be76cc71f
2013-02-13 01:22:15 -06:00
99411af951 Updated installer to support new Linux metamod filename and Mac OS X binaries (bug 5601, r=dvander).
Former-commit-id: 0be36403602c16adaddc84881c9613b3f0f9c1ff
2013-02-13 01:20:11 -06:00
b318509687 Added dependencies for the Installer Delphi project.
Former-commit-id: 88173f089cfe2d6b72e987f763ff25c7038528bc
2013-02-13 01:19:36 -06:00
37f7975416 Rebuilt compiler binaries and built new binaries for OS X. 2013-02-13 01:16:41 -06:00
40c1fee55a Added support for Mac OS X and building with clang (bug 5601, r=dvander). 2013-02-13 01:14:37 -06:00
b0fe6c83e2 Fix get_team() sometimes being wrong for dead players (bug 4656, r=dvander). 2013-02-12 23:17:24 -08:00
59fc122986 Triggering build. 2013-02-12 03:38:26 -06:00
3ec6bbc2ce Triggering build. 2013-02-12 03:30:51 -06:00
a431cb420b Triggering build. 2013-02-08 04:07:52 -06:00
5a6c4ea408 Removed amxxpc64 and rebuilt amxxpc binaries. 2013-02-08 03:44:40 -06:00
7d9376a64b Remove SCASM, which was pointless and buggy bloat. 2013-02-08 00:38:35 -08:00
6e4f09366e Ditch amxxpc64. AMXX files will now only contain 32-bit code. 2013-02-08 00:35:59 -08:00
6c22cb171d Synced hamdata.ini. 2013-02-04 18:40:04 -06:00
77e900585a Backed out changeset 41ca53ad9bff 2013-02-04 18:37:37 -06:00
86bfeec554 Synced hamdata.ini 2013-02-04 18:36:18 -06:00
45343e6e27 Updated hamsandwich offsets for HL1 and CS 1.6 beta. 2013-02-04 07:31:33 -06:00
944f608f09 Fixed hamsandwich vtable patching on Linux for newer GCC binaries. 2013-02-04 07:31:32 -06:00
ad960a64e2 Fixed Linux ClientCommand detour crash in cstrike module for beta. 2013-02-02 23:41:45 -06:00
e2a687d96d removed pushbuild.txt test file 2012-07-27 14:56:48 -03:00
53e43b8f31 testing push 2012-07-27 14:45:35 -03:00
da2eb8ea66 Hopefully fixed Windows build. 2011-07-01 21:51:27 -05:00
088f109a64 Added .hgignore file. 2011-06-29 00:59:58 -05:00
9d65198786 Upgraded MSVC project files for VS 2010 and modified build tool to use them. 2011-06-29 00:50:14 -05:00
49e3b748c3 Fix time drift on repeating tasks (bug 3302, r=dvander). 2010-12-12 18:36:59 -08:00
5324c7c620 Fix TrieSetArray reading the wrong parameter (bug 3816, r=dvander). 2010-09-11 23:02:43 -05:00
26d2a4f877 Add documentation to set_view (bug 4065, r=dvander). 2010-12-12 18:24:30 -08:00
76d407b45a Fix menu_create() documentation (bug 4426, r=dvander). 2010-09-11 22:33:57 -05:00
e783c4bfcb Fixed fopen leak in mapsmenu (bug 3957, r=dvander, a=blocking). 2010-04-27 00:40:38 -07:00
afc663a51a Lowered wait time in between threaded queries (bug 3740, r=dvander). 2010-04-27 00:24:50 -07:00
cb500636cc Fixed amx_ban (bug 4159, r=dvander, a=blocking). 2010-04-27 00:21:49 -07:00
e6f4dfbfe2 Added packager. 2010-04-04 18:10:35 -07:00
1bfdda7e71 Fixed more Makefile paths. 2010-04-04 18:00:36 -07:00
330fd1c2ae Fixed Makefile paths for Metamod. 2010-04-04 17:55:37 -07:00
56b676eafb Fixed core build. 2010-04-04 17:37:05 -07:00
73e3e52057 Updated version files for HG. 2010-04-04 17:22:45 -07:00
56b53584d1 Reversed test condition for build failure. 2010-04-04 17:11:11 -07:00
f43fcd6670 Invoke builder.exe correctly. 2010-04-04 17:02:16 -07:00
5984f0d442 Turns out mono eats exit codes. AWESOME. 2010-04-04 16:58:24 -07:00
1b75b0ba92 Fixed exit code from failed builds. 2010-04-04 16:49:12 -07:00
52f5723f4e Another windows bootstrap fix. 2010-04-04 16:42:24 -07:00
eb6ab857fc Fixed bootstrapping on Windows (I hope). 2010-04-04 16:37:28 -07:00
24bfff9cf1 See if a build will run! 2010-04-04 16:32:15 -07:00
1d3f91be43 bootstrap script now builds builder tool. 2010-04-04 16:24:42 -07:00
824d9953d9 Initial import of bootstrapig for buildbot. 2010-04-04 16:07:37 -07:00
b706108ed6 Squashed commit of the following:
commit 011d9b6b07d904ad1e81ef7c747269903e2d47c4
Author: David Anderson <dvander@alliedmods.net>
Date:   Mon Jan 11 00:17:08 2010 -0600

    Initial import from Subversion (amxmodx/trunk rev 3757).
2014-02-06 23:06:54 -08:00
adab9c93a0 Removed filtering on admin vote questions (bug 3356, r=sawce). 2009-02-07 23:44:23 +00:00
0f8c61c1e1 Re-added fflush function (bug 3355, r=sawce). 2009-02-07 23:43:07 +00:00
0b4f28fecf SQL_QuoteString can now be used without a DB handle (bug 3427, r=sawce). 2009-01-08 20:02:09 +00:00
d97ab913cf Fixed zero precision bug in atcprintf (bug 3242, r=sawce). 2009-01-08 20:00:38 +00:00
2249f1e70c Gah 2008-08-20 06:08:27 +00:00
0f4ee9d91d Added some missing testsuite plugins to nsi installer file. This should hopefully be all that's missing. 2008-08-19 18:30:32 +00:00
5cc5ea4006 Added missing fakemeta_util.inc to nsi installer file 2008-08-19 18:12:05 +00:00
2145823971 Updated nsi installer file list; it was missing celltrie.inc 2008-08-19 14:34:12 +00:00
471 changed files with 42088 additions and 17929 deletions

24
.hgignore Normal file
View File

@ -0,0 +1,24 @@
# Binaries
\.dll$
\.exe$
\.so$
# Files generated by Visual Studio
\.aps$
\.ncb$
\.sdf$
\.suo$
\.user$
# Build directories
/Debug.*
/Release.*
/JITDebug.*
/JITRelease.*
# Files generated by Mac OS X Finder
(^|/)\.DS_Store$
# Files generated by Windows Explorer
(^|/)Desktop\.ini$
(^|/)Thumbs\.db$

View File

@ -153,7 +153,7 @@ void CmdMngr::setCmdLink(CmdLink** a, Command* c, bool sorted)
{ {
int i = strcmp(c->getCommand(), (*a)->cmd->getCommand()); int i = strcmp(c->getCommand(), (*a)->cmd->getCommand());
if ((i < 0) || (i == 0) && (strcmp(c->getArgument(), (*a)->cmd->getArgument()) < 0)) if ((i < 0) || ((i == 0) && (strcmp(c->getArgument(), (*a)->cmd->getArgument()) < 0)))
break; break;
a = &(*a)->next; a = &(*a)->next;

View File

@ -144,7 +144,6 @@ public:
class CSPForward class CSPForward
{ {
friend class CForwardMngr; friend class CForwardMngr;
const char *m_FuncName;
int m_NumParams; int m_NumParams;
ForwardParam m_ParamTypes[FORWARD_MAX_PARAMS]; ForwardParam m_ParamTypes[FORWARD_MAX_PARAMS];

View File

@ -35,7 +35,7 @@
#include "format.h" #include "format.h"
#include "amxmod_compat.h" #include "amxmod_compat.h"
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#define _snprintf snprintf #define _snprintf snprintf
#endif #endif
@ -108,7 +108,7 @@ size_t CLangMngr::strip(char *str, char *newstr, bool makelower)
int flag = 0; int flag = 0;
size_t strln = strlen(str); size_t strln = strlen(str);
for (i = strln - 1; i >= 0; i--) for (i = strln - 1; i < strln; i--)
{ {
if (str[i] == '\n' || str[i] == ' ' || str[i] == '\t') if (str[i] == '\n' || str[i] == ' ' || str[i] == '\t')
{ {

View File

@ -111,7 +111,7 @@ void LogEventsMngr::CLogEvent::registerFilter(char* filter)
filters = new LogCond(cmp->pos, aa, filters); filters = new LogCond(cmp->pos, aa, filters);
} }
void LogEventsMngr::setLogString(char* frmt, va_list& vaptr) void LogEventsMngr::setLogString(const char* frmt, va_list& vaptr)
{ {
++logCounter; ++logCounter;
int len = vsnprintf(logString, 255, frmt, vaptr); int len = vsnprintf(logString, 255, frmt, vaptr);
@ -128,7 +128,7 @@ void LogEventsMngr::setLogString(char* frmt, va_list& vaptr)
logArgc = 0; logArgc = 0;
} }
void LogEventsMngr::setLogString(char* frmt, ...) void LogEventsMngr::setLogString(const char* frmt, ...)
{ {
++logCounter; ++logCounter;
va_list logArgPtr; va_list logArgPtr;

View File

@ -141,8 +141,8 @@ public:
CLogEvent* registerLogEvent(CPluginMngr::CPlugin* plugin, int func, int pos); CLogEvent* registerLogEvent(CPluginMngr::CPlugin* plugin, int func, int pos);
inline bool logEventsExist() { return arelogevents; } inline bool logEventsExist() { return arelogevents; }
void setLogString(char* frmt, va_list& vaptr); void setLogString(const char* frmt, va_list& vaptr);
void setLogString(char* frmt, ...); void setLogString(const char* frmt, ...);
void parseLogString(); void parseLogString();
void executeLogEvents(); void executeLogEvents();

View File

@ -342,7 +342,7 @@ public:
} }
} }
m_AuthData[sizeof(m_AuthData)-1]=0; m_AuthData[arraysize(m_AuthData)-1]=0;
}; };
const cell *GetAuthID(void) const const cell *GetAuthID(void) const
@ -361,7 +361,7 @@ public:
} }
} }
m_Password[sizeof(m_Password)-1]=0; m_Password[arraysize(m_Password)-1]=0;
}; };
const cell *GetPass(void) const const cell *GetPass(void) const

View File

@ -220,7 +220,7 @@ bool CModule::queryModule()
m_Handle = DLLOAD(m_Filename.c_str()); // load file m_Handle = DLLOAD(m_Filename.c_str()); // load file
if (!m_Handle) if (!m_Handle)
{ {
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
AMXXLOG_Log("[AMXX] Module \"%s\" failed to load (%s)", m_Filename.c_str(), dlerror()); AMXXLOG_Log("[AMXX] Module \"%s\" failed to load (%s)", m_Filename.c_str(), dlerror());
#endif #endif
m_Status = MODULE_BADLOAD; m_Status = MODULE_BADLOAD;

View File

@ -244,7 +244,7 @@ public:
if (is_space(v[len-1])) if (is_space(v[len-1]))
{ {
for (i=len-1; i>=0; i--) for (i=len-1; i<len; i--)
{ {
if (!is_space(v[i]) if (!is_space(v[i])
|| (is_space(v[i]) && i==0)) || (is_space(v[i]) && i==0))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,18 +1,18 @@
#(C)2004-2005 AMX Mod X Development Team # (C)2004-2013 AMX Mod X Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
HLSDK = ../../hlsdk ###########################################
### EDIT THESE PATHS FOR YOUR OWN SETUP ###
###########################################
HLSDK = ../../hlsdk/multiplayer
MM_ROOT = ../../metamod/metamod MM_ROOT = ../../metamod/metamod
#####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
#####################################
OPT_FLAGS = -O2 -fno-strict-aliasing -funroll-loops -s -fomit-frame-pointer -pipe -DNDEBUG PROJECT = amxmodx
DEBUG_FLAGS = -g -ggdb3
CPP = gcc-4.1
NAME = amxmodx
BIN_SUFFIX_32 = mm_i386.so
BIN_SUFFIX_64 = mm_amd64.so
OBJECTS = meta_api.cpp CFile.cpp CVault.cpp vault.cpp float.cpp file.cpp modules.cpp \ OBJECTS = meta_api.cpp CFile.cpp CVault.cpp vault.cpp float.cpp file.cpp modules.cpp \
CMisc.cpp CTask.cpp string.cpp amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp \ CMisc.cpp CTask.cpp string.cpp amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp \
@ -23,98 +23,125 @@ OBJECTS = meta_api.cpp CFile.cpp CVault.cpp vault.cpp float.cpp file.cpp modules
amxmod_compat.cpp nongpl_matches.cpp CFlagManager.cpp datastructs.cpp \ amxmod_compat.cpp nongpl_matches.cpp CFlagManager.cpp datastructs.cpp \
trie_natives.cpp trie_natives.cpp
LINK = -lgcc -static-libgcc ##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################
INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ C_OPT_FLAGS = -DNDEBUG -O2 -funroll-loops -fomit-frame-pointer -pipe
-I$(MM_ROOT) -Lzlib -I$(HLSDK)/common C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
CPP_OSX = clang
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) LINK = -Lzlib
ifeq "$(GCC_VERSION)" "4" INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared \
OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden -I$(MM_ROOT)
################################################
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
################################################
OS := $(shell uname -s)
ifeq "$(OS)" "Darwin"
OBJECTS += JIT/amxexecn-darwin.o JIT/amxjitsn-darwin.o JIT/natives-darwin-x86.o \
JIT/helpers-darwin-x86.o
CPP = $(CPP_OSX)
LIB_EXT = dylib
LIB_SUFFIX = _mm
CFLAGS += -DOSX
LINK += -dynamiclib -lstdc++ -mmacosx-version-min=10.5 -Wl,-read_only_relocs,suppress -lz-darwin
else
OBJECTS += JIT/amxexecn.o JIT/amxjitsn.o JIT/natives-x86.o JIT/helpers-x86.o
LIB_EXT = so
LIB_SUFFIX = _mm_i386
CFLAGS += -DLINUX
LINK += -shared -lz
endif endif
LINK += -m32 -lm -ldl
CFLAGS += -DAMX_NOPROPLIST -DPAWN_CELL_SIZE=32 -DJIT -DASM32 -DHAVE_STDINT_H -fno-strict-aliasing \
-m32 -Wall -Werror
CPPFLAGS += -fno-exceptions -fno-rtti
BINARY = $(PROJECT)$(LIB_SUFFIX).$(LIB_EXT)
ifeq "$(DEBUG)" "true" ifeq "$(DEBUG)" "true"
BIN_DIR = Debug BIN_DIR = Debug
CFLAGS = $(DEBUG_FLAGS) CFLAGS += $(C_DEBUG_FLAGS)
else else
BIN_DIR = Release BIN_DIR = Release
CFLAGS = $(OPT_FLAGS) CFLAGS += $(C_OPT_FLAGS)
LINK += -s
endif endif
ifeq "$(BINLOG)" "true" ifeq "$(BINLOG)" "true"
NAME := $(NAME)_bl LIB_SUFFIX := _bl$(LIB_SUFFIX)
BIN_DIR := $(BIN_DIR)BinLog BIN_DIR := $(BIN_DIR)BinLog
OBJECTS += binlog.cpp OBJECTS += binlog.cpp
CFLAGS += -DBINLOG_ENABLED CFLAGS += -DBINLOG_ENABLED
endif endif
CFLAGS += -DLINUX -DAMX_NOPROPLIST -Wall -Werror -DHAVE_STDINT_H -static-libgcc -fno-rtti -fno-exceptions IS_CLANG := $(shell $(CPP) --version | head -1 | grep clang > /dev/null && echo "1" || echo "0")
ifeq "$(AMD64)" "true" ifeq "$(IS_CLANG)" "1"
BINARY = $(NAME)_$(BIN_SUFFIX_64) CPP_MAJOR := $(shell $(CPP) --version | grep clang | sed "s/.*version \([0-9]\)*\.[0-9]*.*/\1/")
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -DAMD64 -m64 CPP_MINOR := $(shell $(CPP) --version | grep clang | sed "s/.*version [0-9]*\.\([0-9]\)*.*/\1/")
LINK += -lz64
OBJECTS += JIT/natives-amd64.o
else else
BINARY = $(NAME)_$(BIN_SUFFIX_32) CPP_MAJOR := $(shell $(CPP) -dumpversion >&1 | cut -b1)
OBJECTS += JIT/amxexecn.o JIT/amxjitsn.o JIT/natives-x86.o CPP_MINOR := $(shell $(CPP) -dumpversion >&1 | cut -b3)
OBJECTS += JIT/helpers-x86.o
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
LINK += -lz
OPT_FLAGS += -march=i586
CFLAGS += -m32
endif endif
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o) # Clang || GCC >= 4
ifeq "$(shell expr $(IS_CLANG) \| $(CPP_MAJOR) \>= 4)" "1"
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
# Clang >= 3 || GCC >= 4.7
ifeq "$(shell expr $(IS_CLANG) \& $(CPP_MAJOR) \>= 3 \| $(CPP_MAJOR) \>= 4 \& $(CPP_MINOR) \>= 7)" "1"
CFLAGS += -Wno-delete-non-virtual-dtor
endif
# OS is Linux and not using clang
ifeq "$(shell expr $(OS) \= Linux \& $(IS_CLANG) \= 0)" "1"
LINK += -static-libgcc
endif
OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
# This will break if we include other Makefiles, but is fine for now. It allows
# us to make a copy of this file that uses altered paths (ie. Makefile.mine)
# or other changes without mucking up the original.
MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
$(BIN_DIR)/%.o: %.cpp $(BIN_DIR)/%.o: %.cpp
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $< $(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
all: all:
mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)
$(MAKE) amxmodx $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT)
amd64:
rm -f zlib/libz.a
$(MAKE) all AMD64=true
amd64_debug:
rm -f zlib/libz.a
$(MAKE) all AMD64=true DEBUG=true
amd64_binlog:
rm -f zlib/libz.a
$(MAKE) all AMD64=true BINLOG=true
amd64_binlog_debug:
rm -f zlib/libz.a
$(MAKE) all AMD64=true BINLOG=true DEBUG=true
binlog: binlog:
$(MAKE) all BINLOG=true $(MAKE) -f $(MAKEFILE_NAME) all BINLOG=true
binlog_debug: binlog_debug:
$(MAKE) all BINLOG=true DEBUG=true $(MAKE) -f $(MAKEFILE_NAME) all BINLOG=true DEBUG=true
amxmodx: $(OBJ_LINUX) $(PROJECT): $(OBJ_BIN)
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY) $(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)
debug: debug:
$(MAKE) all DEBUG=true $(MAKE) -f $(MAKEFILE_NAME) all DEBUG=true
default: all default: all
clean: clean:
rm -rf Release/*.o rm -rf $(BIN_DIR)/*.o
rm -rf Release/$(NAME)_$(BIN_SUFFIX_32) rm -f $(BIN_DIR)/$(BINARY)
rm -rf Release/$(NAME)_$(BIN_SUFFIX_64)
rm -rf ReleaseBinLog/*.o
rm -rf ReleaseBinLog/$(NAME)_bl_$(BIN_SUFFIX_32)
rm -rf ReleaseBinLog/$(NAME)_bl_$(BIN_SUFFIX_64)
rm -rf Debug/*.o
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_32)
rm -rf Debug/$(NAME)_$(BIN_SUFFIX_64)
rm -rf DebugBinLog/*.o
rm -rf DebugBinLog/$(NAME)_bl_$(BIN_SUFFIX_32)
rm -rf DebugBinLog/$(NAME)_bl_$(BIN_SUFFIX_64)

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amx.cpp 3707 2008-04-14 19:56:31Z sawce $
*/ */
#define AMX_NODYNALOAD #define AMX_NODYNALOAD
@ -48,7 +48,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "osdefs.h" #include "osdefs.h"
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
@ -436,7 +436,7 @@ int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params)
hdr=(AMX_HEADER *)amx->base; hdr=(AMX_HEADER *)amx->base;
assert(hdr->natives<=hdr->libraries); assert(hdr->natives<=hdr->libraries);
#if defined AMX_NATIVETABLE #if defined AMX_NATIVETABLE
if (index<NULL) { if (index<0) {
assert(-(index+1)<(sizeof(AMX_NATIVETABLE)/sizeof(AMX_NATIVETABLE)[0])); assert(-(index+1)<(sizeof(AMX_NATIVETABLE)/sizeof(AMX_NATIVETABLE)[0]));
f=(AMX_NATIVETABLE)[-(index+1)]; f=(AMX_NATIVETABLE)[-(index+1)];
} else { } else {
@ -932,7 +932,7 @@ int AMXAPI amx_Init(AMX *amx, void *program)
#define ALIGN(addr) (addr) #define ALIGN(addr) (addr)
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
/* Linux already has mprotect() */ /* Linux already has mprotect() */
/* But wants the address aligned! */ /* But wants the address aligned! */
@ -1014,10 +1014,10 @@ int AMXAPI amx_InitJIT(AMX *amx,void *compiled_program,void *reloc_table)
#if defined AMX_CLEANUP #if defined AMX_CLEANUP
int AMXAPI amx_Cleanup(AMX *amx) int AMXAPI amx_Cleanup(AMX *amx)
{ {
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD #if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__) && !defined AMX_NODYNALOAD
#if defined _Windows #if defined _Windows
typedef int (FAR WINAPI *AMX_ENTRY)(AMX FAR *amx); typedef int (FAR WINAPI *AMX_ENTRY)(AMX FAR *amx);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
typedef int (*AMX_ENTRY)(AMX *amx); typedef int (*AMX_ENTRY)(AMX *amx);
#endif #endif
AMX_HEADER *hdr; AMX_HEADER *hdr;
@ -1027,7 +1027,7 @@ int AMXAPI amx_Cleanup(AMX *amx)
#endif #endif
/* unload all extension modules */ /* unload all extension modules */
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD #if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__) && !defined AMX_NODYNALOAD
hdr=(AMX_HEADER *)amx->base; hdr=(AMX_HEADER *)amx->base;
assert(hdr->magic==AMX_MAGIC); assert(hdr->magic==AMX_MAGIC);
numlibraries=NUMENTRIES(hdr,libraries,pubvars); numlibraries=NUMENTRIES(hdr,libraries,pubvars);
@ -1040,14 +1040,14 @@ int AMXAPI amx_Cleanup(AMX *amx)
strcat(funcname,"Cleanup"); strcat(funcname,"Cleanup");
#if defined _Windows #if defined _Windows
libcleanup=(AMX_ENTRY)GetProcAddress((HINSTANCE)lib->address,funcname); libcleanup=(AMX_ENTRY)GetProcAddress((HINSTANCE)lib->address,funcname);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
libcleanup=(AMX_ENTRY)dlsym((void*)lib->address,funcname); libcleanup=(AMX_ENTRY)dlsym((void*)lib->address,funcname);
#endif #endif
if (libcleanup!=NULL) if (libcleanup!=NULL)
libcleanup(amx); libcleanup(amx);
#if defined _Windows #if defined _Windows
FreeLibrary((HINSTANCE)lib->address); FreeLibrary((HINSTANCE)lib->address);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
dlclose((void*)lib->address); dlclose((void*)lib->address);
#endif #endif
} /* if */ } /* if */
@ -3695,7 +3695,7 @@ int AMXAPI amx_GetAddr(AMX *amx,cell amx_addr,cell **phys_addr)
data=(amx->data!=NULL) ? amx->data : amx->base+(int)hdr->dat; data=(amx->data!=NULL) ? amx->data : amx->base+(int)hdr->dat;
assert(phys_addr!=NULL); assert(phys_addr!=NULL);
if (amx_addr>=amx->hea && amx_addr<amx->stk || amx_addr<0 || amx_addr>=amx->stp) { if ((amx_addr>=amx->hea && amx_addr<amx->stk) || amx_addr<0 || amx_addr>=amx->stp) {
*phys_addr=NULL; *phys_addr=NULL;
return AMX_ERR_MEMACCESS; return AMX_ERR_MEMACCESS;
} /* if */ } /* if */
@ -4094,7 +4094,7 @@ int AMXAPI amx_GetLibraries(AMX *amx)
return numLibraries; return numLibraries;
} }
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#define _snprintf snprintf #define _snprintf snprintf
#endif #endif

View File

@ -18,13 +18,13 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amx.h 3006 2006-08-28 11:08:18Z dvander $
*/ */
#if defined FREEBSD && !defined __FreeBSD__ #if defined FREEBSD && !defined __FreeBSD__
#define __FreeBSD__ #define __FreeBSD__
#endif #endif
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#endif #endif
@ -34,7 +34,7 @@
#if defined HAVE_STDINT_H #if defined HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#else #else
#if defined __LCC__ || defined __DMC__ || defined LINUX #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__
#if defined HAVE_INTTYPES_H #if defined HAVE_INTTYPES_H
#include <inttypes.h> #include <inttypes.h>
#else #else
@ -190,7 +190,7 @@ typedef int (AMXAPI *AMX_NATIVE_FILTER)(struct tagAMX *amx, int index);
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -442,7 +442,7 @@ int AMXAPI amx_GetStringOld(char *dest,const cell *source,int use_wchar);
amx_Register((amx), amx_NativeInfo((name),(func)), 1); amx_Register((amx), amx_NativeInfo((name),(func)), 1);
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=reset #pragma options align=reset

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amxcore.cpp 1733 2005-07-25 06:03:43Z dvander $
*/ */
#if defined _UNICODE || defined __UNICODE__ || defined UNICODE #if defined _UNICODE || defined __UNICODE__ || defined UNICODE
# if !defined UNICODE /* for Windows */ # if !defined UNICODE /* for Windows */
@ -180,7 +180,7 @@ static cell AMX_NATIVE_CALL setarg(AMX *amx, cell *params)
/* adjust the address in "value" in case of an array access */ /* adjust the address in "value" in case of an array access */
value+=params[2]*sizeof(cell); value+=params[2]*sizeof(cell);
/* verify the address */ /* verify the address */
if (value<0 || value>=amx->hea && value<amx->stk) if (value<0 || (value>=amx->hea && value<amx->stk))
return 0; return 0;
/* set the value indirectly */ /* set the value indirectly */
* (cell *)(data+(int)value) = params[3]; * (cell *)(data+(int)value) = params[3];

View File

@ -20,7 +20,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amxdbg.cpp 2345 2006-02-10 19:47:09Z faluco $
*/ */
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@ -462,8 +462,8 @@ int AMXAPI dbg_GetVariable(AMX_DBG *amxdbg, const char *symname, ucell scopeaddr
break; break;
/* check the range, keep a pointer to the symbol with the smallest range */ /* check the range, keep a pointer to the symbol with the smallest range */
if (strcmp(amxdbg->symboltbl[index]->name, symname) == 0 if (strcmp(amxdbg->symboltbl[index]->name, symname) == 0
&& (codestart == 0 && codeend == 0 && ((codestart == 0 && codeend == 0)
|| amxdbg->symboltbl[index]->codestart >= codestart && amxdbg->symboltbl[index]->codeend <= codeend)) || (amxdbg->symboltbl[index]->codestart >= codestart && amxdbg->symboltbl[index]->codeend <= codeend)))
{ {
*sym = amxdbg->symboltbl[index]; *sym = amxdbg->symboltbl[index];
codestart = amxdbg->symboltbl[index]->codestart; codestart = amxdbg->symboltbl[index]->codestart;

View File

@ -21,7 +21,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amxdbg.h 2977 2006-08-27 02:17:18Z damagedsoul $
*/ */
#ifndef AMXDBG_H_INCLUDED #ifndef AMXDBG_H_INCLUDED
@ -49,7 +49,7 @@ extern "C" {
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -156,7 +156,7 @@ int AMXAPI dbg_GetArrayDim(AMX_DBG *amxdbg, const AMX_DBG_SYMBOL *sym, const AMX
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=reset #pragma options align=reset

View File

@ -303,14 +303,6 @@
%endif %endif
%endmacro %endmacro
%ifdef WIN32
section .data exec
%else
section .text
%endif
global asm_runJIT, _asm_runJIT global asm_runJIT, _asm_runJIT
global amx_exec_jit, _amx_exec_jit global amx_exec_jit, _amx_exec_jit
global getMaxCodeSize, _getMaxCodeSize global getMaxCodeSize, _getMaxCodeSize
@ -436,15 +428,6 @@ reloc_done:
pop ebp pop ebp
ret ret
; GWMV:
; The code below modifies itself to store the arguments to the Pawn opcodes
; in the compiled code. This is fine, but the .text section in an ELF executable
; is usually marked read-only, that's why this code is in the .data section.
%ifndef WIN32
section .data exec
%endif
OP_LOAD_PRI: OP_LOAD_PRI:
;nop; ;nop;
putval j_load_pri+2 putval j_load_pri+2
@ -1052,7 +1035,7 @@ OP_CALL:
j_call: j_call:
;call 12345678h ; tasm chokes on this out of a sudden ;call 12345678h ; tasm chokes on this out of a sudden
_PUSH 0 _PUSH 0
j_call_e8 j_call_e8:
db 0e8h, 0, 0, 0, 0 db 0e8h, 0, 0, 0, 0
CHECKCODESIZE j_call CHECKCODESIZE j_call
@ -2591,4 +2574,4 @@ _amx_opcodelist_jit:
DD OP_FLOAT_ROUND ; DA DD OP_FLOAT_ROUND ; DA
DD OP_FLOAT_CMP ; DA DD OP_FLOAT_CMP ; DA
END END:

View File

@ -146,7 +146,7 @@ static cell AMX_NATIVE_CALL server_print(AMX *amx, cell *params) /* 1 param */
static cell AMX_NATIVE_CALL engclient_print(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL engclient_print(AMX *amx, cell *params) /* 3 param */
{ {
int len; int len = 0;
char *msg; char *msg;
if (params[1] == 0) if (params[1] == 0)
@ -481,7 +481,7 @@ static cell AMX_NATIVE_CALL is_dedicated_server(AMX *amx, cell *params)
static cell AMX_NATIVE_CALL is_linux_server(AMX *amx, cell *params) static cell AMX_NATIVE_CALL is_linux_server(AMX *amx, cell *params)
{ {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
return 1; return 1;
#else #else
return 0; return 0;
@ -1005,7 +1005,7 @@ static cell AMX_NATIVE_CALL get_user_team(AMX *amx, cell *params) /* 3 param */
if (params[3]) if (params[3])
{ {
char *szTeam = ""; const char *szTeam = "";
switch (iTeam) switch (iTeam)
{ {
@ -3843,7 +3843,7 @@ static cell AMX_NATIVE_CALL amx_mkdir(AMX *amx, cell *params)
char *path = get_amxstring(amx, params[1], 0, len); char *path = get_amxstring(amx, params[1], 0, len);
char *realpath = build_pathname("%s", path); char *realpath = build_pathname("%s", path);
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
return mkdir(realpath, 0700); return mkdir(realpath, 0700);
#else #else
return mkdir(realpath); return mkdir(realpath);

View File

@ -32,7 +32,7 @@
#ifndef AMXMODX_H #ifndef AMXMODX_H
#define AMXMODX_H #define AMXMODX_H
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "sclinux.h" #include "sclinux.h"
@ -86,7 +86,7 @@ extern AMX_NATIVE_INFO vector_Natives[];
extern AMX_NATIVE_INFO g_SortNatives[]; extern AMX_NATIVE_INFO g_SortNatives[];
extern AMX_NATIVE_INFO g_DataStructNatives[]; extern AMX_NATIVE_INFO g_DataStructNatives[];
#ifndef __linux__ #if defined(_WIN32)
#define DLLOAD(path) (DLHANDLE)LoadLibrary(path) #define DLLOAD(path) (DLHANDLE)LoadLibrary(path)
#define DLPROC(m, func) GetProcAddress(m, func) #define DLPROC(m, func) GetProcAddress(m, func)
#define DLFREE(m) FreeLibrary(m) #define DLFREE(m) FreeLibrary(m)
@ -107,14 +107,14 @@ extern AMX_NATIVE_INFO g_DataStructNatives[];
#endif #endif
#endif #endif
#ifndef __linux__ #if defined(_WIN32)
typedef HINSTANCE DLHANDLE; typedef HINSTANCE DLHANDLE;
#else #else
typedef void* DLHANDLE; typedef void* DLHANDLE;
#define INFINITE 0xFFFFFFFF #define INFINITE 0xFFFFFFFF
#endif #endif
#ifndef __linux__ #if defined(_WIN32)
#define PATH_SEP_CHAR '\\' #define PATH_SEP_CHAR '\\'
#define ALT_SEP_CHAR '/' #define ALT_SEP_CHAR '/'
#else #else
@ -139,7 +139,7 @@ int UTIL_ReadFlags(const char* c);
void UTIL_ClientPrint(edict_t *pEntity, int msg_dest, char *msg); void UTIL_ClientPrint(edict_t *pEntity, int msg_dest, char *msg);
void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL); void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL);
void UTIL_GetFlags(char* flags, int flag); void UTIL_GetFlags(char* flags, int flag);
void UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, char *pMessage); void UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, const char *pMessage);
void UTIL_IntToString(int value, char *output); void UTIL_IntToString(int value, char *output);
void UTIL_ShowMOTD(edict_t *client, char *motd, int mlen, const char *name); void UTIL_ShowMOTD(edict_t *client, char *motd, int mlen, const char *name);
void UTIL_ShowMenu(edict_t* pEntity, int slots, int time, char *menu, int mlen); void UTIL_ShowMenu(edict_t* pEntity, int slots, int time, char *menu, int mlen);
@ -276,8 +276,8 @@ void modules_callPluginsUnloaded();
void modules_callPluginsUnloading(); void modules_callPluginsUnloading();
cell* get_amxaddr(AMX *amx, cell amx_addr); cell* get_amxaddr(AMX *amx, cell amx_addr);
char* build_pathname(char *fmt, ...); char* build_pathname(const char *fmt, ...);
char* build_pathname_r(char *buffer, size_t maxlen, char *fmt, ...); char* build_pathname_r(char *buffer, size_t maxlen, const char *fmt, ...);
char* format_amxstring(AMX *amx, cell *params, int parm, int& len); char* format_amxstring(AMX *amx, cell *params, int parm, int& len);
AMX* get_amxscript(int, void**, const char**); AMX* get_amxscript(int, void**, const char**);
const char* get_amxscriptname(AMX* amx); const char* get_amxscriptname(AMX* amx);
@ -292,8 +292,8 @@ int unload_amxscript(AMX* amx, void** program);
void copy_amxmemory(cell* dest, cell* src, int len); void copy_amxmemory(cell* dest, cell* src, int len);
void get_modname(char*); void get_modname(char*);
void print_srvconsole(char *fmt, ...); void print_srvconsole(const char *fmt, ...);
void report_error(int code, char* fmt, ...); void report_error(int code, const char* fmt, ...);
void* alloc_amxmemory(void**, int size); void* alloc_amxmemory(void**, int size);
void free_amxmemory(void **ptr); void free_amxmemory(void **ptr);
// get_localinfo // get_localinfo

View File

@ -3,7 +3,7 @@
* Copyright (c) ITB CompuPhase, 2001-2002 * Copyright (c) ITB CompuPhase, 2001-2002
* This file may be freely used. No warranties of any kind. * This file may be freely used. No warranties of any kind.
* *
* Version: $Id$ * Version: $Id: amxtime.cpp 2511 2006-04-06 12:56:45Z damagedsoul $
*/ */
#include <time.h> #include <time.h>
#include <assert.h> #include <assert.h>

View File

@ -42,7 +42,7 @@
#define PACKED #define PACKED
#endif #endif
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#else #else
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
@ -127,7 +127,7 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
for (mint8_t i = 0; i < m_Bh.numPlugins; i++) for (mint8_t i = 0; i < m_Bh.numPlugins; i++)
{ {
pe = &(m_Bh.plugins[i]); pe = &(m_Bh.plugins[(unsigned)i]);
DATAREAD(&pe->cellsize, sizeof(mint8_t), 1); DATAREAD(&pe->cellsize, sizeof(mint8_t), 1);
DATAREAD(&pe->disksize, sizeof(int32_t), 1); DATAREAD(&pe->disksize, sizeof(int32_t), 1);
DATAREAD(&pe->imagesize, sizeof(int32_t), 1); DATAREAD(&pe->imagesize, sizeof(int32_t), 1);
@ -137,7 +137,7 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
for (mint8_t i = 0; i < m_Bh.numPlugins; i++) for (mint8_t i = 0; i < m_Bh.numPlugins; i++)
{ {
pe = &(m_Bh.plugins[i]); pe = &(m_Bh.plugins[(unsigned)i]);
if (pe->cellsize == m_CellSize) if (pe->cellsize == m_CellSize)
{ {

View File

@ -35,12 +35,12 @@
// 3 = HL Logs // 3 = HL Logs
#include <time.h> #include <time.h>
#ifndef __linux__ #if defined(_WIN32)
#include <io.h> #include <io.h>
#endif #endif
#include "amxmodx.h" #include "amxmodx.h"
#ifndef __linux__ #if defined(_WIN32WIN32)
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#endif #endif
@ -137,7 +137,7 @@ void CLog::MapChange()
{ {
// create dir if not existing // create dir if not existing
char file[256]; char file[256];
#ifdef __linux #if defined(__linux__) || defined(__APPLE__)
mkdir(build_pathname_r(file, sizeof(file)-1, "%s", g_log_dir.c_str()), 0700); mkdir(build_pathname_r(file, sizeof(file)-1, "%s", g_log_dir.c_str()), 0700);
#else #else
mkdir(build_pathname_r(file, sizeof(file)-1, "%s", g_log_dir.c_str())); mkdir(build_pathname_r(file, sizeof(file)-1, "%s", g_log_dir.c_str()));

View File

@ -46,7 +46,7 @@ bool BinLog::Open()
if (!DirExists(path)) if (!DirExists(path))
{ {
mkdir(path mkdir(path
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
, 0755 , 0755
#endif #endif
); );

View File

@ -215,8 +215,7 @@ public:
int ShiftUpFrom(size_t which) int ShiftUpFrom(size_t which)
{ {
// No point shifting this. // No point shifting this.
if (this->count < 0 || if (which > this->count)
which > this->count)
{ {
return 0; return 0;
@ -254,8 +253,7 @@ public:
int Delete(size_t which) int Delete(size_t which)
{ {
// No point shifting this. // No point shifting this.
if (this->count < 0 || if (which >= this->count)
which >= this->count)
{ {
return 0; return 0;
} }

View File

@ -614,9 +614,9 @@ void Debugger::FmtGenericMsg(AMX *amx, int error, char buffer[], size_t maxLengt
if (a) if (a)
filename = (*a).getName(); filename = (*a).getName();
size_t len = strlen(filename); size_t len = strlen(filename);
for (size_t i=len-1; i>=0; i--) for (size_t i=len-1; i<len; i--)
{ {
if (filename[i] == '/' || filename[i] == '\\' && i != len - 1) if ((filename[i] == '/' || filename[i] == '\\') && i != len - 1)
{ {
filename = &(filename[i+1]); filename = &(filename[i+1]);
break; break;

View File

@ -109,6 +109,7 @@ void Client_TeamInfo(void* mValue)
char* msg = (char*)mValue; char* msg = (char*)mValue;
g_players[index].team.assign(msg); g_players[index].team.assign(msg);
g_teamsIds.registerTeam(msg, -1); g_teamsIds.registerTeam(msg, -1);
g_players[index].teamId = g_teamsIds.findTeamId(msg);
break; break;
} }
} }

View File

@ -43,7 +43,7 @@
#endif #endif
// header file for unlink() // header file for unlink()
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#include <unistd.h> #include <unistd.h>
#else #else
#define WINDOWS_LEAN_AND_MEAN #define WINDOWS_LEAN_AND_MEAN
@ -784,7 +784,7 @@ static cell AMX_NATIVE_CALL amx_ungetc(AMX *amx, cell *params)
return ungetc(static_cast<int>(params[2]), fp); return ungetc(static_cast<int>(params[2]), fp);
} }
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
#define _rmdir rmdir #define _rmdir rmdir
#endif #endif
@ -817,7 +817,7 @@ static cell AMX_NATIVE_CALL amx_rename(AMX *amx, cell *params)
snprintf(f_new_r, sizeof(f_new_r)-1, "%s", fnew); snprintf(f_new_r, sizeof(f_new_r)-1, "%s", fnew);
} }
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
return (rename(f_old_r, f_new_r) == 0); return (rename(f_old_r, f_new_r) == 0);
#elif defined WIN32 #elif defined WIN32
return MoveFileA(f_old_r, f_new_r); return MoveFileA(f_old_r, f_new_r);
@ -855,6 +855,13 @@ static cell LoadFileForMe(AMX *amx, cell *params)
return count; return count;
} }
static cell AMX_NATIVE_CALL amx_fflush(AMX *amx, cell *params)
{
FILE *fp = (FILE *)params[1];
return fflush(fp);
}
AMX_NATIVE_INFO file_Natives[] = AMX_NATIVE_INFO file_Natives[] =
{ {
{"delete_file", delete_file}, {"delete_file", delete_file},
@ -891,5 +898,6 @@ AMX_NATIVE_INFO file_Natives[] =
{"fputs", amx_fputs}, {"fputs", amx_fputs},
{"rename_file", amx_rename}, {"rename_file", amx_rename},
{"LoadFileForMe", LoadFileForMe}, {"LoadFileForMe", LoadFileForMe},
{"fflush", amx_fflush},
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -29,6 +29,11 @@
return 0; \ return 0; \
} }
template size_t atcprintf<cell, cell>(cell *, size_t, const cell *, AMX *, cell *, int *);
template size_t atcprintf<char, cell>(char *, size_t, const cell *, AMX *, cell *, int *);
template size_t atcprintf<cell, char>(cell *, size_t, const char *, AMX *, cell *, int *);
template size_t atcprintf<char, char>(char *, size_t, const char *, AMX *, cell *, int *);
THash<String, lang_err> BadLang_Table; THash<String, lang_err> BadLang_Table;
static cvar_t *amx_mldebug = NULL; static cvar_t *amx_mldebug = NULL;
@ -240,7 +245,7 @@ void AddFloat(U **buf_p, size_t &maxlen, double fval, int width, int prec, int f
} }
// write the fraction part // write the fraction part
if (maxlen) if (maxlen && prec)
{ {
*buf++ = '.'; *buf++ = '.';
maxlen--; maxlen--;

View File

@ -43,7 +43,7 @@ _amxx_CpuSupport:
.fail: .fail:
xor eax, eax xor eax, eax
.end .end:
pop ebx pop ebx

View File

@ -185,7 +185,7 @@ unsigned char *MD5::raw_digest(){
char *MD5::hex_digest(){ const char *MD5::hex_digest(){
int i; int i;
char *s= new char[33]; char *s= new char[33];
@ -205,7 +205,7 @@ char *MD5::hex_digest(){
} }
char *MD5::hex_digest(char buffer[33]){ const char *MD5::hex_digest(char buffer[33]){
int i; int i;

View File

@ -59,8 +59,8 @@ public:
// methods to acquire finalized result // methods to acquire finalized result
unsigned char *raw_digest (); // digest as a 16-byte binary array unsigned char *raw_digest (); // digest as a 16-byte binary array
char * hex_digest (); // digest as a 33-byte ascii-hex string const char *hex_digest (); // digest as a 33-byte ascii-hex string
char * hex_digest (char buffer[33]); //same as above, passing buffer const char *hex_digest (char buffer[33]); //same as above, passing buffer

View File

@ -198,7 +198,7 @@ void BuildPluginFileList(const char *initialdir, CStack<String *> & files)
} }
_findclose(handle); _findclose(handle);
#elif defined __linux__ #elif defined(__linux__) || defined(__APPLE__)
build_pathname_r(path, sizeof(path)-1, "%s/", initialdir); build_pathname_r(path, sizeof(path)-1, "%s/", initialdir);
struct dirent *ep; struct dirent *ep;
DIR *dp; DIR *dp;
@ -254,7 +254,7 @@ void LoadExtraPluginsFromDir(const char *initialdir)
// Precache stuff from force consistency calls // Precache stuff from force consistency calls
// or check for pointed files won't be done // or check for pointed files won't be done
int C_PrecacheModel(char *s) int C_PrecacheModel(const char *s)
{ {
if (!g_forcedmodules) if (!g_forcedmodules)
{ {
@ -269,7 +269,7 @@ int C_PrecacheModel(char *s)
RETURN_META_VALUE(MRES_IGNORED, 0); RETURN_META_VALUE(MRES_IGNORED, 0);
} }
int C_PrecacheSound(char *s) int C_PrecacheSound(const char *s)
{ {
if (!g_forcedsounds) if (!g_forcedsounds)
{ {
@ -731,7 +731,7 @@ void C_ServerDeactivate_Post()
time(&td); time(&td);
tm *curTime = localtime(&td); tm *curTime = localtime(&td);
int i = 0; int i = 0;
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")), 0700); mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")), 0700);
#else #else
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx"))); mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")));
@ -740,7 +740,7 @@ void C_ServerDeactivate_Post()
{ {
char buffer[256]; char buffer[256];
sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxmodx"), curTime->tm_mon + 1, curTime->tm_mday, i); sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxmodx"), curTime->tm_mon + 1, curTime->tm_mday, i);
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
mkdir(build_pathname("%s", g_log_dir.c_str()), 0700); mkdir(build_pathname("%s", g_log_dir.c_str()), 0700);
if (mkdir(build_pathname(buffer), 0700) < 0) if (mkdir(build_pathname(buffer), 0700) < 0)
#else #else
@ -1083,7 +1083,7 @@ void C_StartFrame_Post(void)
tm *curTime = localtime(&td); tm *curTime = localtime(&td);
int i = 0; int i = 0;
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")), 0700); mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")), 0700);
#else #else
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx"))); mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")));
@ -1092,7 +1092,7 @@ void C_StartFrame_Post(void)
{ {
char buffer[256]; char buffer[256];
sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxmodx"), curTime->tm_mon + 1, curTime->tm_mday, i); sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxmodx"), curTime->tm_mon + 1, curTime->tm_mday, i);
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
mkdir(build_pathname("%s", g_log_dir.c_str()), 0700); mkdir(build_pathname("%s", g_log_dir.c_str()), 0700);
if (mkdir(build_pathname(buffer), 0700) < 0) if (mkdir(build_pathname(buffer), 0700) < 0)
#else #else
@ -1285,7 +1285,7 @@ void C_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
void C_AlertMessage(ALERT_TYPE atype, char *szFmt, ...) void C_AlertMessage(ALERT_TYPE atype, const char *szFmt, ...)
{ {
if (atype != at_logged) if (atype != at_logged)
{ {
@ -1329,7 +1329,7 @@ void C_AlertMessage(ALERT_TYPE atype, char *szFmt, ...)
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
void C_ChangeLevel(char *map, char *what) void C_ChangeLevel(const char *map, const char *what)
{ {
int ret = executeForwards(FF_ChangeLevel, map); int ret = executeForwards(FF_ChangeLevel, map);
if (ret) if (ret)
@ -1371,7 +1371,7 @@ void C_CvarValue2(const edict_t *pEdict, int requestId, const char *cvar, const
RETURN_META(MRES_HANDLED); RETURN_META(MRES_HANDLED);
} }
C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs)
{ {
gpMetaUtilFuncs = pMetaUtilFuncs; gpMetaUtilFuncs = pMetaUtilFuncs;
*pPlugInfo = &Plugin_info; *pPlugInfo = &Plugin_info;
@ -1535,7 +1535,7 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
return (TRUE); return (TRUE);
} }
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
// linux prototype // linux prototype
C_DLLEXPORT void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals) C_DLLEXPORT void GiveFnptrsToDll(enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals)
{ {

View File

@ -29,8 +29,11 @@
* version. * version.
*/ */
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#if defined(__linux__)
#include <malloc.h> #include <malloc.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "sclinux.h" #include "sclinux.h"
@ -86,7 +89,7 @@ bool DirExists(const char *dir)
return false; return false;
} }
void report_error(int code, char* fmt, ...) void report_error(int code, const char* fmt, ...)
{ {
va_list argptr; va_list argptr;
char string[256]; char string[256];
@ -106,7 +109,7 @@ void report_error(int code, char* fmt, ...)
} }
} }
void print_srvconsole(char *fmt, ...) void print_srvconsole(const char *fmt, ...)
{ {
va_list argptr; va_list argptr;
static char string[384]; static char string[384];
@ -340,11 +343,14 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
if ((err = amx_InitJIT(amx, (void *)rt, (void *)np)) == AMX_ERR_NONE) if ((err = amx_InitJIT(amx, (void *)rt, (void *)np)) == AMX_ERR_NONE)
{ {
//amx->base = (unsigned char FAR *)realloc(np, amx->code_size); //amx->base = (unsigned char FAR *)realloc(np, amx->code_size);
#ifndef __linux__ #if defined(_WIN32)
amx->base = (unsigned char *)VirtualAlloc(NULL, amx->code_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); amx->base = (unsigned char *)VirtualAlloc(NULL, amx->code_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
#else #elif defined(__GNUC__)
//posix_memalign((void **)&(amx->base), sysconf(_SC_PAGESIZE), amx->code_size); # if defined(__APPLE__)
amx->base = (unsigned char *)valloc(amx->code_size);
# else
amx->base = (unsigned char *)memalign(sysconf(_SC_PAGESIZE), amx->code_size); amx->base = (unsigned char *)memalign(sysconf(_SC_PAGESIZE), amx->code_size);
# endif
mprotect((void *)amx->base, amx->code_size, PROT_READ|PROT_WRITE|PROT_EXEC); mprotect((void *)amx->base, amx->code_size, PROT_READ|PROT_WRITE|PROT_EXEC);
#endif #endif
if (amx->base) if (amx->base)
@ -641,7 +647,7 @@ int unload_amxscript(AMX* amx, void** program)
return AMX_ERR_NONE; return AMX_ERR_NONE;
#if defined JIT #if defined JIT
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
if ((flags & AMX_FLAG_JITC) != AMX_FLAG_JITC) if ((flags & AMX_FLAG_JITC) != AMX_FLAG_JITC)
{ {
delete [] prg; delete [] prg;
@ -720,7 +726,7 @@ void get_modname(char* buffer)
strcpy(buffer, g_mod_name.c_str()); strcpy(buffer, g_mod_name.c_str());
} }
char* build_pathname(char *fmt, ...) char* build_pathname(const char *fmt, ...)
{ {
static char string[256]; static char string[256];
int b; int b;
@ -746,7 +752,7 @@ char* build_pathname(char *fmt, ...)
return string; return string;
} }
char *build_pathname_r(char *buffer, size_t maxlen, char *fmt, ...) char *build_pathname_r(char *buffer, size_t maxlen, const char *fmt, ...)
{ {
snprintf(buffer, maxlen, "%s%c", g_mod_name.c_str(), PATH_SEP_CHAR); snprintf(buffer, maxlen, "%s%c", g_mod_name.c_str(), PATH_SEP_CHAR);
@ -771,7 +777,7 @@ char *build_pathname_r(char *buffer, size_t maxlen, char *fmt, ...)
} }
// build pathname based on addons dir // build pathname based on addons dir
char* build_pathname_addons(char *fmt, ...) char* build_pathname_addons(const char *fmt, ...)
{ {
static char string[256]; static char string[256];
@ -875,7 +881,7 @@ bool ConvertModuleName(const char *pathString, String &path)
path.append(PATH_SEP_CHAR); path.append(PATH_SEP_CHAR);
path.append(tmpname); path.append(tmpname);
path.append("_amxx"); path.append("_amxx");
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
#if defined AMD64 || PAWN_CELL_SIZE==64 #if defined AMD64 || PAWN_CELL_SIZE==64
path.append("_amd64"); path.append("_amd64");
#else #else
@ -888,6 +894,8 @@ bool ConvertModuleName(const char *pathString, String &path)
path.append(".dll"); path.append(".dll");
#elif defined __linux__ #elif defined __linux__
path.append(".so"); path.append(".so");
#elif defined __APPLE__
path.append(".dylib");
#endif #endif
return true; return true;
@ -1179,8 +1187,6 @@ void modules_callPluginsUnloading()
// new functions // new functions
int MNF_AddNatives(AMX_NATIVE_INFO* natives) int MNF_AddNatives(AMX_NATIVE_INFO* natives)
{ {
CList<CModule, const char *>::iterator a = g_modules.begin();
if (!g_CurrentlyCalledModule || g_ModuleCallReason != ModuleCall_Attach) if (!g_CurrentlyCalledModule || g_ModuleCallReason != ModuleCall_Attach)
return FALSE; // may only be called from attach return FALSE; // may only be called from attach
@ -1191,8 +1197,6 @@ int MNF_AddNatives(AMX_NATIVE_INFO* natives)
int MNF_AddNewNatives(AMX_NATIVE_INFO *natives) int MNF_AddNewNatives(AMX_NATIVE_INFO *natives)
{ {
CList<CModule, const char *>::iterator a = g_modules.begin();
if (!g_CurrentlyCalledModule || g_ModuleCallReason != ModuleCall_Attach) if (!g_CurrentlyCalledModule || g_ModuleCallReason != ModuleCall_Attach)
return FALSE; // may only be called from attach return FALSE; // may only be called from attach

View File

@ -35,7 +35,7 @@
#include "amx.h" #include "amx.h"
#undef DLLEXPORT #undef DLLEXPORT
#ifndef __linux__ #if defined(_WIN32)
#define DLLEXPORT __declspec(dllexport) #define DLLEXPORT __declspec(dllexport)
#else #else
#define DLLEXPORT __attribute__((visibility("default"))) #define DLLEXPORT __attribute__((visibility("default")))

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2005 # Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx_mm", "amxmodx_mm.vcproj", "{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx_mm", "amxmodx_mm.vcxproj", "{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -0,0 +1,439 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="JITDebugBinLog|Win32">
<Configuration>JITDebugBinLog</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="JITDebug|Win32">
<Configuration>JITDebug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="JITReleaseBinLog|Win32">
<Configuration>JITReleaseBinLog</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="JITRelease|Win32">
<Configuration>JITRelease</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}</ProjectGuid>
<RootNamespace>amxmodx</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\debug/amxmodx.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(METAMOD)\metamod;$(HLSDK)\multiplayer\common;$(HLSDK)\multiplayer\engine;$(HLSDK)\multiplayer\dlls;$(HLSDK)\multiplayer\pm_shared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;PAWN_CELL_SIZE=32;ASM32;JIT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>amxmodx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\jitdebug/amxmodx.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\jitdebug/</AssemblerListingLocation>
<ObjectFileName>.\jitdebug/</ObjectFileName>
<ProgramDataBaseFileName>.\jitdebug/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>..\zlib\zlib.lib;..\JIT\amxjitsn.obj;..\JIT\amxexecn.obj;..\JIT\natives-x86.obj;%(AdditionalDependencies)</AdditionalDependencies>
<Version>0.1</Version>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\extra\lib_win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\jitdebug/amxx_mm.pdb</ProgramDatabaseFile>
<ImportLibrary>.\jitdebug/amxmodx_mm.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\release/amxmodx.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>$(METAMOD)\metamod;$(HLSDK)\multiplayer\common;$(HLSDK)\multiplayer\engine;$(HLSDK)\multiplayer\dlls;$(HLSDK)\multiplayer\pm_shared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT;ASM32;PAWN_CELL_SIZE=32;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>amxmodx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\jitrelease/amxmodx.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\jitrelease/</AssemblerListingLocation>
<ObjectFileName>.\jitrelease/</ObjectFileName>
<ProgramDataBaseFileName>.\jitrelease/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>..\zlib\zlib.lib;..\JIT\amxjitsn.obj;..\JIT\amxexecn.obj;..\JIT\natives-x86.obj;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\extra\lib_win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\jitrelease/amxmodx_mm.pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<ImportLibrary>.\jitrelease/amxmodx_mm.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\debug/amxmodx.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(METAMOD)\metamod;$(HLSDK)\multiplayer\common;$(HLSDK)\multiplayer\engine;$(HLSDK)\multiplayer\dlls;$(HLSDK)\multiplayer\pm_shared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;PAWN_CELL_SIZE=32;ASM32;JIT;BINLOG_ENABLED;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>amxmodx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\jitdebugbinlog/amxmodx.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\jitdebugbinlog/</AssemblerListingLocation>
<ObjectFileName>.\jitdebugbinlog/</ObjectFileName>
<ProgramDataBaseFileName>.\jitdebugbinlog/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>..\zlib\zlib.lib;..\JIT\amxjitsn.obj;..\JIT\amxexecn.obj;..\JIT\natives-x86.obj;%(AdditionalDependencies)</AdditionalDependencies>
<Version>0.1</Version>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\extra\lib_win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\jitdebugbinlog/amxmodx_bl_mm.pdb</ProgramDatabaseFile>
<ImportLibrary>.\jitdebugbinlog/amxmodx_bl_mm.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\release/amxmodx.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>$(METAMOD)\metamod;$(HLSDK)\multiplayer\common;$(HLSDK)\multiplayer\engine;$(HLSDK)\multiplayer\dlls;$(HLSDK)\multiplayer\pm_shared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT;ASM32;PAWN_CELL_SIZE=32;BINLOG_ENABLED;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<IgnoreStandardIncludePath>false</IgnoreStandardIncludePath>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>amxmodx.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\jitreleasebinlog/amxmodx.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\jitreleasebinlog/</AssemblerListingLocation>
<ObjectFileName>.\jitreleasebinlog/</ObjectFileName>
<ProgramDataBaseFileName>.\jitreleasebinlog/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>..\zlib\zlib.lib;..\JIT\amxjitsn.obj;..\JIT\amxexecn.obj;..\JIT\natives-x86.obj;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\extra\lib_win32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBC;LIBCD;LIBCMTD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\jitreleasebinlog/amxmodx_bl_mm.pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<ImportLibrary>.\jitreleasebinlog/amxmodx_bl_mm.lib</ImportLibrary>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\amx.cpp" />
<ClCompile Include="..\amxcore.cpp" />
<ClCompile Include="..\amxdbg.cpp" />
<ClCompile Include="..\amxmod_compat.cpp" />
<ClCompile Include="..\amxmodx.cpp" />
<ClCompile Include="..\amxtime.cpp" />
<ClCompile Include="..\amxxfile.cpp" />
<ClCompile Include="..\amxxlog.cpp" />
<ClCompile Include="..\binlog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\CCmd.cpp" />
<ClCompile Include="..\CEvent.cpp" />
<ClCompile Include="..\CFile.cpp" />
<ClCompile Include="..\CFlagManager.cpp" />
<ClCompile Include="..\CForward.cpp" />
<ClCompile Include="..\CLang.cpp" />
<ClCompile Include="..\CLogEvent.cpp" />
<ClCompile Include="..\CMenu.cpp" />
<ClCompile Include="..\CMisc.cpp" />
<ClCompile Include="..\CModule.cpp" />
<ClCompile Include="..\CPlugin.cpp" />
<ClCompile Include="..\CTask.cpp" />
<ClCompile Include="..\CVault.cpp" />
<ClCompile Include="..\debugger.cpp" />
<ClCompile Include="..\emsg.cpp" />
<ClCompile Include="..\fakemeta.cpp" />
<ClCompile Include="..\file.cpp" />
<ClCompile Include="..\float.cpp" />
<ClCompile Include="..\format.cpp">
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'">AssemblyAndSourceCode</AssemblerOutput>
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">AssemblyAndSourceCode</AssemblerOutput>
</ClCompile>
<ClCompile Include="..\libraries.cpp" />
<ClCompile Include="..\md5.cpp" />
<ClCompile Include="..\messages.cpp" />
<ClCompile Include="..\meta_api.cpp" />
<ClCompile Include="..\modules.cpp" />
<ClCompile Include="..\natives.cpp" />
<ClCompile Include="..\newmenus.cpp" />
<ClCompile Include="..\nongpl_matches.cpp" />
<ClCompile Include="..\optimizer.cpp" />
<ClCompile Include="..\power.cpp" />
<ClCompile Include="..\sorting.cpp" />
<ClCompile Include="..\srvcmd.cpp" />
<ClCompile Include="..\string.cpp">
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'">All</AssemblerOutput>
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">All</AssemblerOutput>
</ClCompile>
<ClCompile Include="..\strptime.cpp" />
<ClCompile Include="..\trie_natives.cpp" />
<ClCompile Include="..\util.cpp" />
<ClCompile Include="..\vault.cpp" />
<ClCompile Include="..\vector.cpp" />
<ClCompile Include="..\datastructs.cpp" />
<ClCompile Include="..\sdk\amxxmodule.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='JITDebugBinLog|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='JITDebug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='JITReleaseBinLog|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='JITRelease|Win32'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\amx.h" />
<ClInclude Include="..\amxdbg.h" />
<ClInclude Include="..\amxmod_compat.h" />
<ClInclude Include="..\amxmodx.h" />
<ClInclude Include="..\amxxfile.h" />
<ClInclude Include="..\amxxlog.h" />
<ClInclude Include="..\binlog.h" />
<ClInclude Include="..\CCmd.h" />
<ClInclude Include="..\CEvent.h" />
<ClInclude Include="..\CFile.h" />
<ClInclude Include="..\CFlagManager.h" />
<ClInclude Include="..\CForward.h" />
<ClInclude Include="..\CLang.h" />
<ClInclude Include="..\CList.h" />
<ClInclude Include="..\CLogEvent.h" />
<ClInclude Include="..\CMenu.h" />
<ClInclude Include="..\CMisc.h" />
<ClInclude Include="..\CModule.h" />
<ClInclude Include="..\CPlugin.h" />
<ClInclude Include="..\CQueue.h" />
<ClInclude Include="..\CString.h" />
<ClInclude Include="..\CTask.h" />
<ClInclude Include="..\CVault.h" />
<ClInclude Include="..\CVector.h" />
<ClInclude Include="..\datastructs.h" />
<ClInclude Include="..\debugger.h" />
<ClInclude Include="..\fakemeta.h" />
<ClInclude Include="..\format.h" />
<ClInclude Include="..\libraries.h" />
<ClInclude Include="..\md5.h" />
<ClInclude Include="..\messages.h" />
<ClInclude Include="..\modules.h" />
<ClInclude Include="..\natives.h" />
<ClInclude Include="..\newmenus.h" />
<ClInclude Include="..\nongpl_matches.h" />
<ClInclude Include="..\optimizer.h" />
<ClInclude Include="..\resource.h" />
<ClInclude Include="..\sh_list.h" />
<ClInclude Include="..\sh_stack.h" />
<ClInclude Include="..\sh_tinyhash.h" />
<ClInclude Include="..\svn_version.h" />
<ClInclude Include="..\trie_natives.h" />
<ClInclude Include="..\zlib\zconf.h" />
<ClInclude Include="..\zlib\zlib.h" />
<ClInclude Include="..\sdk\amxxmodule.h" />
<ClInclude Include="..\sdk\moduleconfig.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\version.rc" />
</ItemGroup>
<ItemGroup>
<None Include="..\amxdefn.asm" />
<None Include="..\amxexecn.asm" />
<None Include="..\amxjitsn.asm" />
<None Include="..\helpers-x86.asm" />
<None Include="..\natives-amd64.asm" />
<None Include="..\natives-x86.asm" />
<None Include="..\..\plugins\include\amxconst.inc" />
<None Include="..\..\plugins\include\amxmisc.inc" />
<None Include="..\..\plugins\include\amxmodx.inc" />
<None Include="..\..\plugins\include\core.inc" />
<None Include="..\..\plugins\include\file.inc" />
<None Include="..\..\plugins\include\float.inc" />
<None Include="..\..\plugins\include\lang.inc" />
<None Include="..\..\plugins\include\message_const.inc" />
<None Include="..\..\plugins\include\message_stocks.inc" />
<None Include="..\..\plugins\include\messages.inc" />
<None Include="..\..\plugins\include\sorting.inc" />
<None Include="..\..\plugins\include\string.inc" />
<None Include="..\..\plugins\include\svn_version.inc" />
<None Include="..\..\plugins\include\time.inc" />
<None Include="..\..\plugins\include\vault.inc" />
<None Include="..\..\plugins\include\vector.inc" />
<None Include="..\..\plugins\include\xs.inc" />
<None Include="..\..\plugins\include\amxmod_compat\amxmod.inc" />
<None Include="..\..\plugins\include\amxmod_compat\maths.inc" />
<None Include="..\..\plugins\include\amxmod_compat\mysql.inc" />
<None Include="..\..\plugins\include\amxmod_compat\translator.inc" />
<None Include="..\..\plugins\include\amxmod_compat\Vexd_Utilities.inc" />
<None Include="..\..\plugins\include\amxmod_compat\VexdUM.inc" />
<None Include="..\..\plugins\include\amxmod_compat\VexdUM_const.inc" />
<None Include="..\..\plugins\include\amxmod_compat\VexdUM_stock.inc" />
<None Include="..\..\plugins\include\amxmod_compat\xtrafun.inc" />
</ItemGroup>
<ItemGroup>
<Object Include="..\Jit\helpers-x86.obj" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,426 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{0d31fe96-c452-4d62-8c7c-0f0f8d69efa8}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{6e1c49c6-6432-4873-bb9a-9d30996955b2}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{721333c3-98b9-4888-a3ec-637a2bd46091}</UniqueIdentifier>
<Extensions>rc</Extensions>
</Filter>
<Filter Include="Assembly">
<UniqueIdentifier>{e347f4b5-ec94-43d6-b45b-85ab3f146a45}</UniqueIdentifier>
</Filter>
<Filter Include="Assembly\Builds">
<UniqueIdentifier>{1cec296a-ddcc-44da-97c4-2a4d0f4d6fc7}</UniqueIdentifier>
</Filter>
<Filter Include="SDK">
<UniqueIdentifier>{bbfaec3e-7d17-45ea-8b84-093fa5714022}</UniqueIdentifier>
</Filter>
<Filter Include="Pawn Includes">
<UniqueIdentifier>{4022451d-eb5f-4f14-b8d8-2ce23fec6e59}</UniqueIdentifier>
</Filter>
<Filter Include="Pawn Includes\AMX Mod Compat">
<UniqueIdentifier>{d4419052-0ddd-415e-bb16-4393b99751be}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\amx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxcore.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxdbg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxmod_compat.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxmodx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxtime.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxxfile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\amxxlog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\binlog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CCmd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CFile.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CFlagManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CForward.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CLang.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CLogEvent.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CMenu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CMisc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CModule.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CPlugin.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CTask.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CVault.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\debugger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\emsg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\fakemeta.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\file.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\float.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\format.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\libraries.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\md5.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\messages.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\meta_api.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\modules.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\natives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\newmenus.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\nongpl_matches.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\optimizer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\power.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\sorting.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\srvcmd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\string.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\strptime.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\trie_natives.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\vault.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\vector.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\datastructs.cpp">
<Filter>Header Files</Filter>
</ClCompile>
<ClCompile Include="..\sdk\amxxmodule.cpp">
<Filter>SDK</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\amx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\amxdbg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\amxmod_compat.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\amxmodx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\amxxfile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\amxxlog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\binlog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CCmd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CEvent.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CFile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CFlagManager.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CForward.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CLang.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CLogEvent.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CMenu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CMisc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CModule.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CPlugin.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CQueue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CString.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CTask.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CVault.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CVector.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\datastructs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\debugger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\fakemeta.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\format.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\libraries.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\md5.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\messages.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\modules.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\natives.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\newmenus.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\nongpl_matches.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\optimizer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\sh_list.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\sh_stack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\sh_tinyhash.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\svn_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\trie_natives.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\zlib\zconf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\zlib\zlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\sdk\amxxmodule.h">
<Filter>SDK</Filter>
</ClInclude>
<ClInclude Include="..\sdk\moduleconfig.h">
<Filter>SDK</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\version.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\amxdefn.asm">
<Filter>Assembly</Filter>
</None>
<None Include="..\amxexecn.asm">
<Filter>Assembly</Filter>
</None>
<None Include="..\amxjitsn.asm">
<Filter>Assembly</Filter>
</None>
<None Include="..\helpers-x86.asm">
<Filter>Assembly</Filter>
</None>
<None Include="..\natives-amd64.asm">
<Filter>Assembly</Filter>
</None>
<None Include="..\natives-x86.asm">
<Filter>Assembly</Filter>
</None>
<None Include="..\..\plugins\include\amxconst.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\amxmisc.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\amxmodx.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\core.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\file.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\float.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\lang.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\message_const.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\message_stocks.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\messages.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\sorting.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\string.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\svn_version.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\time.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\vault.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\vector.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\xs.inc">
<Filter>Pawn Includes</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\amxmod.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\maths.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\mysql.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\translator.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\Vexd_Utilities.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\VexdUM.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\VexdUM_const.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\VexdUM_stock.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
<None Include="..\..\plugins\include\amxmod_compat\xtrafun.inc">
<Filter>Pawn Includes\AMX Mod Compat</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Object Include="..\Jit\helpers-x86.obj">
<Filter>Assembly\Builds</Filter>
</Object>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -35,8 +35,11 @@
#include "libraries.h" #include "libraries.h"
#include "format.h" #include "format.h"
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#if defined(__linux__)
#include <malloc.h> #include <malloc.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "sclinux.h" #include "sclinux.h"
@ -479,12 +482,16 @@ static cell AMX_NATIVE_CALL register_native(AMX *amx, cell *params)
//we'll apply a safety buffer too //we'll apply a safety buffer too
//make our function //make our function
int size = amxx_DynaCodesize(); int size = amxx_DynaCodesize();
#ifndef __linux__ #if defined(_WIN32)
DWORD temp; DWORD temp;
pNative->pfn = new char[size + 10]; pNative->pfn = new char[size + 10];
VirtualProtect(pNative->pfn, size+10, PAGE_EXECUTE_READWRITE, &temp); VirtualProtect(pNative->pfn, size+10, PAGE_EXECUTE_READWRITE, &temp);
#else #elif defined(__GNUC__)
# if defined(__APPLE__)
pNative->pfn = (char *)valloc(size+10);
# else
pNative->pfn = (char *)memalign(sysconf(_SC_PAGESIZE), size+10); pNative->pfn = (char *)memalign(sysconf(_SC_PAGESIZE), size+10);
# endif
mprotect((void *)pNative->pfn, size+10, PROT_READ|PROT_WRITE|PROT_EXEC); mprotect((void *)pNative->pfn, size+10, PROT_READ|PROT_WRITE|PROT_EXEC);
#endif #endif

View File

@ -39,6 +39,10 @@
#include <endian.h> #include <endian.h>
#endif #endif
#if defined __APPLE__
#include <sys/types.h>
#endif
/* Linux NOW has these */ /* Linux NOW has these */
#if !defined BIG_ENDIAN #if !defined BIG_ENDIAN
#define BIG_ENDIAN 4321 #define BIG_ENDIAN 4321

View File

@ -20,10 +20,10 @@
#define stricmp(a,b) strcasecmp(a,b) #define stricmp(a,b) strcasecmp(a,b)
#define strnicmp(a,b,c) strncasecmp(a,b,c) #define strnicmp(a,b,c) strncasecmp(a,b,c)
#if defined __linux__ && !defined _snprintf #if ( defined(__linux__) || defined(__APPLE__) ) && !defined _snprintf
#define _snprintf snprintf #define _snprintf snprintf
#endif #endif
#if defined __linux__ && !defined _vsnprintf #if ( defined(__linux__) || defined(__APPLE__) ) && !defined _vsnprintf
//#define _vsnprintf vsnprintf //#define _vsnprintf vsnprintf
#endif #endif
@ -40,6 +40,10 @@
*/ */
#if !defined __BYTE_ORDER #if !defined __BYTE_ORDER
# include <stdlib.h> # include <stdlib.h>
# if defined __APPLE__
# include <sys/types.h>
# define __BYTE_ORDER BYTE_ORDER
# endif
#endif #endif
#if defined __OpenBSD__ #if defined __OpenBSD__

View File

@ -2240,7 +2240,7 @@ static META_FUNCTIONS g_MetaFunctions_Table =
GetEngineFunctions_Post GetEngineFunctions_Post
}; };
C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) C_DLLEXPORT int Meta_Query(const char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs)
{ {
if ((int) CVAR_GET_FLOAT("developer") != 0) if ((int) CVAR_GET_FLOAT("developer") != 0)
UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n", UTIL_LogPrintf("[%s] dev: called: Meta_Query; version=%s, ours=%s\n",
@ -2334,7 +2334,7 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason)
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
// linux prototype // linux prototype
C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) {
@ -3050,7 +3050,7 @@ char* UTIL_VarArgs( char *format, ... )
// UTIL_LogPrintf - Prints a logged message to console. // UTIL_LogPrintf - Prints a logged message to console.
// Preceded by LOG: ( timestamp ) < message > // Preceded by LOG: ( timestamp ) < message >
//========================================================= //=========================================================
void UTIL_LogPrintf( char *fmt, ... ) void UTIL_LogPrintf( const char *fmt, ... )
{ {
va_list argptr; va_list argptr;
static char string[1024]; static char string[1024];

View File

@ -20,11 +20,16 @@
// DLL Export // DLL Export
#undef DLLEXPORT #undef DLLEXPORT
#ifndef __linux__ #if defined(_WIN32)
#define DLLEXPORT __declspec(dllexport) #define DLLEXPORT __declspec(dllexport)
#else #else
#define DLLEXPORT __attribute__((visibility("default"))) #define DLLEXPORT __attribute__((visibility("default")))
#endif
#if defined(__linux__) && !defined(LINUX)
#define LINUX #define LINUX
#elif defined(__APPLE__) && !defined(OSX)
#define OSX
#endif #endif
#undef C_DLLEXPORT #undef C_DLLEXPORT
@ -66,7 +71,7 @@ struct amxx_module_info_s
#if defined HAVE_STDINT_H #if defined HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#else #else
#if defined __LCC__ || defined __DMC__ || defined LINUX #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__
#if defined HAVE_INTTYPES_H #if defined HAVE_INTTYPES_H
#include <inttypes.h> #include <inttypes.h>
#else #else
@ -308,7 +313,7 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -395,7 +400,7 @@ enum {
}; };
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined __linux__ #if defined(__linux__) || defined(__APPLE__)
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#else #else
#pragma pack(pop) /* reset previous packing */ #pragma pack(pop) /* reset previous packing */
@ -406,7 +411,7 @@ enum {
// ***** declare functions ***** // ***** declare functions *****
#ifdef USE_METAMOD #ifdef USE_METAMOD
void UTIL_LogPrintf( char *fmt, ... ); void UTIL_LogPrintf( const char *fmt, ... );
void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage);
short FixedSigned16( float value, float scale ); short FixedSigned16( float value, float scale );
unsigned short FixedUnsigned16( float value, float scale ); unsigned short FixedUnsigned16( float value, float scale );
@ -833,11 +838,11 @@ int FN_AllowLagCompensation_Post(void);
#ifdef FN_PrecacheModel #ifdef FN_PrecacheModel
int FN_PrecacheModel(char *s); int FN_PrecacheModel(const char *s);
#endif // FN_PrecacheModel #endif // FN_PrecacheModel
#ifdef FN_PrecacheSound #ifdef FN_PrecacheSound
int FN_PrecacheSound(char *s); int FN_PrecacheSound(const char *s);
#endif // FN_PrecacheSound #endif // FN_PrecacheSound
#ifdef FN_SetModel #ifdef FN_SetModel
@ -857,7 +862,7 @@ void FN_SetSize(edict_t *e, const float *rgflMin, const float *rgflMax);
#endif // FN_SetSize #endif // FN_SetSize
#ifdef FN_ChangeLevel #ifdef FN_ChangeLevel
void FN_ChangeLevel(char *s1, char *s2); void FN_ChangeLevel(const char *s1, const char *s2);
#endif // FN_ChangeLevel #endif // FN_ChangeLevel
#ifdef FN_GetSpawnParms #ifdef FN_GetSpawnParms
@ -1261,19 +1266,19 @@ char *FN_GetInfoKeyBuffer(edict_t *e);
#endif // FN_GetInfoKeyBuffer #endif // FN_GetInfoKeyBuffer
#ifdef FN_InfoKeyValue #ifdef FN_InfoKeyValue
char *FN_InfoKeyValue(char *infobuffer, char *key); char *FN_InfoKeyValue(char *infobuffer, const char *key);
#endif // FN_InfoKeyValue #endif // FN_InfoKeyValue
#ifdef FN_SetKeyValue #ifdef FN_SetKeyValue
void FN_SetKeyValue(char *infobuffer, char *key, char *value); void FN_SetKeyValue(char *infobuffer, const char *key, const char *value);
#endif // FN_SetKeyValue #endif // FN_SetKeyValue
#ifdef FN_SetClientKeyValue #ifdef FN_SetClientKeyValue
void FN_SetClientKeyValue(int clientIndex, char *infobuffer, char *key, char *value); void FN_SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value);
#endif // FN_SetClientKeyValue #endif // FN_SetClientKeyValue
#ifdef FN_IsMapValid #ifdef FN_IsMapValid
int FN_IsMapValid(char *filename); int FN_IsMapValid(const char *filename);
#endif // FN_IsMapValid #endif // FN_IsMapValid
#ifdef FN_StaticDecal #ifdef FN_StaticDecal
@ -1281,7 +1286,7 @@ void FN_StaticDecal(const float *origin, int decalIndex, int entityIndex, int mo
#endif // FN_StaticDecal #endif // FN_StaticDecal
#ifdef FN_PrecacheGeneric #ifdef FN_PrecacheGeneric
int FN_PrecacheGeneric(char *s); int FN_PrecacheGeneric(const char *s);
#endif // FN_PrecacheGeneric #endif // FN_PrecacheGeneric
#ifdef FN_GetPlayerUserId #ifdef FN_GetPlayerUserId
@ -1414,11 +1419,11 @@ const char *FN_GetPlayerAuthId(edict_t *e);
#ifdef FN_PrecacheModel_Post #ifdef FN_PrecacheModel_Post
int FN_PrecacheModel_Post(char *s); int FN_PrecacheModel_Post(const char *s);
#endif // FN_PrecacheModel_Post #endif // FN_PrecacheModel_Post
#ifdef FN_PrecacheSound_Post #ifdef FN_PrecacheSound_Post
int FN_PrecacheSound_Post(char *s); int FN_PrecacheSound_Post(const char *s);
#endif // FN_PrecacheSound_Post #endif // FN_PrecacheSound_Post
#ifdef FN_SetModel_Post #ifdef FN_SetModel_Post
@ -1438,7 +1443,7 @@ void FN_SetSize_Post(edict_t *e, const float *rgflMin, const float *rgflMax);
#endif // FN_SetSize_Post #endif // FN_SetSize_Post
#ifdef FN_ChangeLevel_Post #ifdef FN_ChangeLevel_Post
void FN_ChangeLevel_Post(char *s1, char *s2); void FN_ChangeLevel_Post(const char *s1, const char *s2);
#endif // FN_ChangeLevel_Post #endif // FN_ChangeLevel_Post
#ifdef FN_GetSpawnParms_Post #ifdef FN_GetSpawnParms_Post
@ -1842,19 +1847,19 @@ char *FN_GetInfoKeyBuffer_Post(edict_t *e);
#endif // FN_GetInfoKeyBuffer_Post #endif // FN_GetInfoKeyBuffer_Post
#ifdef FN_InfoKeyValue_Post #ifdef FN_InfoKeyValue_Post
char *FN_InfoKeyValue_Post(char *infobuffer, char *key); char *FN_InfoKeyValue_Post(char *infobuffer, const char *key);
#endif // FN_InfoKeyValue_Post #endif // FN_InfoKeyValue_Post
#ifdef FN_SetKeyValue_Post #ifdef FN_SetKeyValue_Post
void FN_SetKeyValue_Post(char *infobuffer, char *key, char *value); void FN_SetKeyValue_Post(char *infobuffer, const char *key, const char *value);
#endif // FN_SetKeyValue_Post #endif // FN_SetKeyValue_Post
#ifdef FN_SetClientKeyValue_Post #ifdef FN_SetClientKeyValue_Post
void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, char *key, char *value); void FN_SetClientKeyValue_Post(int clientIndex, char *infobuffer, const char *key, const char *value);
#endif // FN_SetClientKeyValue_Post #endif // FN_SetClientKeyValue_Post
#ifdef FN_IsMapValid_Post #ifdef FN_IsMapValid_Post
int FN_IsMapValid_Post(char *filename); int FN_IsMapValid_Post(const char *filename);
#endif // FN_IsMapValid_Post #endif // FN_IsMapValid_Post
#ifdef FN_StaticDecal_Post #ifdef FN_StaticDecal_Post
@ -1862,7 +1867,7 @@ void FN_StaticDecal_Post(const float *origin, int decalIndex, int entityIndex, i
#endif // FN_StaticDecal_Post #endif // FN_StaticDecal_Post
#ifdef FN_PrecacheGeneric_Post #ifdef FN_PrecacheGeneric_Post
int FN_PrecacheGeneric_Post(char *s); int FN_PrecacheGeneric_Post(const char *s);
#endif // FN_PrecacheGeneric_Post #endif // FN_PrecacheGeneric_Post
#ifdef FN_GetPlayerUserId_Post #ifdef FN_GetPlayerUserId_Post
@ -2116,7 +2121,7 @@ typedef int (*PFN_ADD_NEW_NATIVES) (const AMX_NATIVE_INFO * /*list*/);
typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...); typedef char * (*PFN_BUILD_PATHNAME) (const char * /*format*/, ...);
typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...); typedef char * (*PFN_BUILD_PATHNAME_R) (char * /*buffer*/, size_t /* maxlen */, const char * /* format */, ...);
typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/); typedef cell * (*PFN_GET_AMXADDR) (AMX * /*amx*/, cell /*offset*/);
typedef void (*PFN_PRINT_SRVCONSOLE) (char * /*format*/, ...); typedef void (*PFN_PRINT_SRVCONSOLE) (const char * /*format*/, ...);
typedef const char * (*PFN_GET_MODNAME) (void); typedef const char * (*PFN_GET_MODNAME) (void);
typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/); typedef const char * (*PFN_GET_AMXSCRIPTNAME) (int /*id*/);
typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/); typedef AMX * (*PFN_GET_AMXSCRIPT) (int /*id*/);
@ -2175,8 +2180,8 @@ typedef void (*PFN_DEALLOCATOR) (const char* /*filename*/, const unsigned i
typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/); typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*index*/);
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/); typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/); typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/); typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/);
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/); typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, const char* /*func name*/, int* /*index*/);
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */); typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */);
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/); typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/); typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);

View File

@ -19,7 +19,7 @@
#endif #endif
#include <new> #include <new>
#include <malloc.h> #include <stdlib.h>
//namespace SourceHook //namespace SourceHook
//{ //{

View File

@ -54,12 +54,12 @@
typedef List<THashNode *> * NodePtr; typedef List<THashNode *> * NodePtr;
public: public:
class const_iterator; class const_iterator;
THash() : m_Buckets(NULL), m_numBuckets(0), m_percentUsed(0.0f), m_items(0) THash() : m_Buckets(NULL), m_numBuckets(0), m_percentUsed(0.0f)
{ {
_Refactor(); _Refactor();
} }
THash(const THash &other) : m_Buckets(new NodePtr[other.m_numBuckets]), THash(const THash &other) : m_Buckets(new NodePtr[other.m_numBuckets]),
m_numBuckets(other.m_numBuckets), m_percentUsed(other.m_percentUsed), m_items(0) m_numBuckets(other.m_numBuckets), m_percentUsed(other.m_percentUsed)
{ {
for (size_t i=0; i<m_numBuckets; i++) for (size_t i=0; i<m_numBuckets; i++)
m_Buckets[i] = NULL; m_Buckets[i] = NULL;
@ -82,10 +82,6 @@
_Clear(); _Clear();
_Refactor(); _Refactor();
} }
size_t size()
{
return m_items;
}
size_t GetBuckets() size_t GetBuckets()
{ {
return m_numBuckets; return m_numBuckets;
@ -122,7 +118,6 @@
delete [] m_Buckets; delete [] m_Buckets;
m_Buckets = NULL; m_Buckets = NULL;
m_numBuckets = 0; m_numBuckets = 0;
m_items = 0;
} }
public: public:
template <typename U> template <typename U>
@ -229,8 +224,6 @@
} }
} }
public: public:
friend class iterator;
friend class const_iterator;
class iterator class iterator
{ {
friend class THash; friend class THash;
@ -304,8 +297,6 @@
*this = tmp; *this = tmp;
// :TODO: Maybe refactor to a lower size if required // :TODO: Maybe refactor to a lower size if required
m_items--;
} }
private: private:
void _Inc() void _Inc()
@ -454,6 +445,8 @@
const THash *hash; const THash *hash;
bool end; bool end;
}; };
friend class iterator;
friend class const_iterator;
public: public:
iterator begin() iterator begin()
{ {

View File

@ -34,7 +34,7 @@
#include <new> #include <new>
#include <string.h> #include <string.h>
#include <malloc.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
enum NodeType enum NodeType

View File

@ -30,6 +30,7 @@
*/ */
#include "amxmodx.h" #include "amxmodx.h"
#include "svn_version.h"
void amx_command() void amx_command()
{ {
@ -200,8 +201,9 @@ void amx_command()
print_srvconsole("Authors:\n\tDavid \"BAILOPAN\" Anderson, Pavol \"PM OnoTo\" Marko\n"); print_srvconsole("Authors:\n\tDavid \"BAILOPAN\" Anderson, Pavol \"PM OnoTo\" Marko\n");
print_srvconsole("\tFelix \"SniperBeamer\" Geyer, Jonny \"Got His Gun\" Bergstrom\n"); print_srvconsole("\tFelix \"SniperBeamer\" Geyer, Jonny \"Got His Gun\" Bergstrom\n");
print_srvconsole("\tLukasz \"SidLuke\" Wlasinski, Christian \"Basic-Master\" Hammacher\n"); print_srvconsole("\tLukasz \"SidLuke\" Wlasinski, Christian \"Basic-Master\" Hammacher\n");
print_srvconsole("\tBorja \"faluco\" Ferrer, Scott \"Damaged Soul\" Ehlert\n"); print_srvconsole("\tBorja \"faluco\" Ferrer, Scott \"DS\" Ehlert\n");
print_srvconsole("Compiled: %s\n", __DATE__ ", " __TIME__); print_srvconsole("Compiled: %s\n", __DATE__ ", " __TIME__);
print_srvconsole("Build ID: %s\n", SVN_BUILD_ID);
#if defined JIT && !defined ASM32 #if defined JIT && !defined ASM32
print_srvconsole("Core mode: JIT Only\n"); print_srvconsole("Core mode: JIT Only\n");
#elif !defined JIT && defined ASM32 #elif !defined JIT && defined ASM32

View File

@ -1035,7 +1035,7 @@ static cell AMX_NATIVE_CALL n_strfind(AMX *amx, cell *params)
if (params[4] > len) if (params[4] > len)
return -1; return -1;
char *find = strstr(str, sub); char *find = strstr(str + params[4], sub);
if (!find) if (!find)
return -1; return -1;

View File

@ -10,7 +10,7 @@
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
#define strnicmp strncasecmp #define strnicmp strncasecmp
#endif #endif
@ -336,8 +336,10 @@ char *strptime(const char *buf, const char *fmt, struct tm *tm, short addthem)
if (0 <= ti.qS) (*defoper) ( &tm->tm_sec , ti.qS ); if (0 <= ti.qS) (*defoper) ( &tm->tm_sec , ti.qS );
if (0 <= ti.qM) (*defoper) ( &tm->tm_min , ti.qM ); //tm->tm_min = ti.qM; if (0 <= ti.qM) (*defoper) ( &tm->tm_min , ti.qM ); //tm->tm_min = ti.qM;
if (0 <= ti.qI) if (0 <= ti.qI)
{
if (0 <= ti.qp) ti.qH = ti.qI % 12 + ti.qp * 12; if (0 <= ti.qp) ti.qH = ti.qI % 12 + ti.qp * 12;
else (*defoper) ( &tm->tm_hour , ti.qI ); //tm->tm_hour = ti.qI; else (*defoper) ( &tm->tm_hour , ti.qI ); //tm->tm_hour = ti.qI;
}
if (0 <= ti.qH) (*defoper) ( &tm->tm_hour , ti.qH ); //tm->tm_hour = ti.qH; if (0 <= ti.qH) (*defoper) ( &tm->tm_hour , ti.qH ); //tm->tm_hour = ti.qH;
if (0 <= ti.qZ) (*defoper) ( &tm->tm_isdst , ti.qZ - 1 ); //tm->tm_isdst = ti.qZ - 1; if (0 <= ti.qZ) (*defoper) ( &tm->tm_isdst , ti.qZ - 1 ); //tm->tm_isdst = ti.qZ - 1;
if (0 <= ti.qy) ti.qY = ti.qy; if (0 <= ti.qy) ti.qY = ti.qy;

View File

@ -1,8 +1,9 @@
#ifndef _INCLUDE_SVN_VERSION_H_ #ifndef _INCLUDE_SVN_VERSION_H_
#define _INCLUDE_SVN_VERSION_H_ #define _INCLUDE_SVN_VERSION_H_
#define SVN_VERSION_STRING "1.8.1.3746" #define SVN_VERSION_STRING "1.8.2-dev"
#define SVN_VERSION_DWORD 1,8,1,3746 #define SVN_VERSION_DWORD 1,8,2,0
#define SVN_VERSION_PRODUCT "1.8.1" #define SVN_VERSION_PRODUCT "1.8.2"
#define SVN_BUILD_ID SVN_VERSION_STRING " 9:7ff502465eae"
#endif //_INCLUDE_SVN_VERSION_H_ #endif //_INCLUDE_SVN_VERSION_H_

View File

@ -1,8 +1,9 @@
#ifndef _INCLUDE_SVN_VERSION_H_ #ifndef _INCLUDE_SVN_VERSION_H_
#define _INCLUDE_SVN_VERSION_H_ #define _INCLUDE_SVN_VERSION_H_
#define SVN_VERSION_STRING "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$" #define SVN_VERSION_STRING "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$"
#define SVN_VERSION_DWORD $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$ #define SVN_VERSION_DWORD $PMAJOR$,$PMINOR$,$PREVISION$,0
#define SVN_VERSION_PRODUCT "$PMAJOR$.$PMINOR$.$PREVISION$" #define SVN_VERSION_PRODUCT "$PMAJOR$.$PMINOR$.$PREVISION$"
#define SVN_BUILD_ID SVN_VERSION_STRING " $BUILD_ID$"
#endif //_INCLUDE_SVN_VERSION_H_ #endif //_INCLUDE_SVN_VERSION_H_

View File

@ -108,7 +108,7 @@ static cell AMX_NATIVE_CALL TrieSetString(AMX *amx, cell *params)
// native TrieSetArray(Trie:handle, const key[], const any:buffer[], buffsize) // native TrieSetArray(Trie:handle, const key[], const any:buffer[], buffsize)
static cell AMX_NATIVE_CALL TrieSetArray(AMX *amx, cell *params) static cell AMX_NATIVE_CALL TrieSetArray(AMX *amx, cell *params)
{ {
celltrie *t = g_TrieHandles.lookup(params[2]); celltrie *t = g_TrieHandles.lookup(params[1]);
if (t == NULL) if (t == NULL)
{ {

View File

@ -32,7 +32,7 @@
#include <time.h> #include <time.h>
#include "amxmodx.h" #include "amxmodx.h"
#if defined __linux__ && !defined _vsnprintf #if ( defined(__linux__) || defined(__APPLE__) ) && !defined _vsnprintf
#define _vsnprintf vsnprintf #define _vsnprintf vsnprintf
#endif #endif
@ -157,8 +157,8 @@ void UTIL_IntToString(int value, char *output)
if (tho) if (tho)
{ {
aaa += sprintf(&output[aaa], words[tho]); aaa += sprintf(&output[aaa], "%s", words[tho]);
aaa += sprintf(&output[aaa], words[29]); aaa += sprintf(&output[aaa], "%s", words[29]);
value = value % 1000; value = value % 1000;
} }
@ -166,8 +166,8 @@ void UTIL_IntToString(int value, char *output)
if (hun) if (hun)
{ {
aaa += sprintf(&output[aaa], words[hun]); aaa += sprintf(&output[aaa], "%s", words[hun]);
aaa += sprintf(&output[aaa], words[28]); aaa += sprintf(&output[aaa], "%s", words[28]);
value = value % 100; value = value % 100;
} }
@ -175,10 +175,10 @@ void UTIL_IntToString(int value, char *output)
int unit = value % 10; int unit = value % 10;
if (ten) if (ten)
aaa += sprintf(&output[aaa], words[(ten > 1) ? (ten + 18) : (unit + 10)]); aaa += sprintf(&output[aaa], "%s", words[(ten > 1) ? (ten + 18) : (unit + 10)]);
if (ten != 1 && (unit || (!value && !hun && !tho))) if (ten != 1 && (unit || (!value && !hun && !tho)))
sprintf(&output[aaa], words[unit]); sprintf(&output[aaa], "%s", words[unit]);
} }
char* UTIL_SplitHudMessage(const char *src) char* UTIL_SplitHudMessage(const char *src)
@ -242,7 +242,7 @@ short FixedSigned16(float value, float scale)
return (short)output; return (short)output;
} }
void UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, char *pMessage) void UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, const char *pMessage)
{ {
if (pEntity) if (pEntity)
MESSAGE_BEGIN(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, NULL, pEntity); MESSAGE_BEGIN(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, NULL, pEntity);

BIN
amxmodx/zlib/libz-darwin.a Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* @(#) $Id$ */ /* @(#) $Id: zconf.h 3734 2008-08-16 09:48:39Z damagedsoul $ */
#ifndef ZCONF_H #ifndef ZCONF_H
#define ZCONF_H #define ZCONF_H

View File

@ -1,46 +1,107 @@
#(C)2004-2005 AMX Mod X Development Team # (C)2004-2013 AMX Mod X Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
#####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
#####################################
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing PROJECT = amxxpc
DEBUG_FLAGS = -g -ggdb3
CPP = gcc-4.1
BINARY = amxxpc
OBJECTS = amx.cpp amxxpc.cpp Binary.cpp OBJECTS = amx.cpp amxxpc.cpp Binary.cpp
LINK = -lz /lib32/libstdc++.a ##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################
INCLUDE = -I. -L. C_OPT_FLAGS = -DNDEBUG -O2 -funroll-loops -fomit-frame-pointer -pipe
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
CPP_OSX = clang
LINK =
INCLUDE = -I.
################################################
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
################################################
OS := $(shell uname -s)
ifeq "$(OS)" "Darwin"
CPP = $(CPP_OSX)
LIB_SUFFIX = _osx
CFLAGS += -DOSX
LINK += -lstdc++ -mmacosx-version-min=10.5 -lz-darwin
else
LIB_SUFFIX =
CFLAGS += -DLINUX
LINK += -lz /lib32/libstdc++.a
endif
LINK += -m32 -lm -ldl -L.
CFLAGS += -DAMX_ANSIONLY -DHAVE_STDINT_H -fno-strict-aliasing \
-m32 -Wall -Werror
CPPFLAGS += -fexceptions -fno-rtti
BINARY = $(PROJECT)$(LIB_SUFFIX)
ifeq "$(DEBUG)" "true" ifeq "$(DEBUG)" "true"
BIN_DIR = Debug BIN_DIR = Debug
CFLAGS = $(DEBUG_FLAGS) CFLAGS += $(C_DEBUG_FLAGS)
else else
BIN_DIR = Release BIN_DIR = Release
CFLAGS = $(OPT_FLAGS) CFLAGS += $(C_OPT_FLAGS)
endif endif
CFLAGS += -DLINUX -DNDEBUG -Wno-deprecated -fexceptions -DHAVE_STDINT_H -DAMX_ANSIONLY -fno-rtti -static-libgcc IS_CLANG := $(shell $(CPP) --version | head -1 | grep clang > /dev/null && echo "1" || echo "0")
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o) ifeq "$(IS_CLANG)" "1"
CPP_MAJOR := $(shell $(CPP) --version | grep clang | sed "s/.*version \([0-9]\)*\.[0-9]*.*/\1/")
CPP_MINOR := $(shell $(CPP) --version | grep clang | sed "s/.*version [0-9]*\.\([0-9]\)*.*/\1/")
else
CPP_MAJOR := $(shell $(CPP) -dumpversion >&1 | cut -b1)
CPP_MINOR := $(shell $(CPP) -dumpversion >&1 | cut -b3)
endif
# Clang || GCC >= 4
ifeq "$(shell expr $(IS_CLANG) \| $(CPP_MAJOR) \>= 4)" "1"
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
# Clang >= 3 || GCC >= 4.7
ifeq "$(shell expr $(IS_CLANG) \& $(CPP_MAJOR) \>= 3 \| $(CPP_MAJOR) \>= 4 \& $(CPP_MINOR) \>= 7)" "1"
CFLAGS += -Wno-delete-non-virtual-dtor
endif
# OS is Linux and not using clang
ifeq "$(shell expr $(OS) \= Linux \& $(IS_CLANG) \= 0)" "1"
LINK += -static-libgcc
endif
OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
# This will break if we include other Makefiles, but is fine for now. It allows
# us to make a copy of this file that uses altered paths (ie. Makefile.mine)
# or other changes without mucking up the original.
MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
$(BIN_DIR)/%.o: %.cpp $(BIN_DIR)/%.o: %.cpp
$(CPP) $(INCLUDE) $(CFLAGS) -m32 -o $@ -c $< $(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
all: all:
mkdir -p $(BIN_DIR) mkdir -p $(BIN_DIR)
$(MAKE) amxxpc $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT)
amxxpc: $(OBJ_LINUX) $(PROJECT): $(OBJ_BIN)
$(CPP) $(INCLUDE) $(CFLAGS) -m32 $(OBJ_LINUX) $(LINK) -ldl -lm -o$(BIN_DIR)/$(BINARY) $(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)
default: all default: all
clean: clean:
rm -rf Release/*.o rm -rf $(BIN_DIR)/*.o
rm -rf Release/$(BINARY) rm -f $(BIN_DIR)/$(BINARY)
rm -rf Debug/*.o
rm -rf Debug/$(BINARY)

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amx.cpp 1728 2005-07-25 00:01:54Z dvander $
*/ */
#if BUILD_PLATFORM == WINDOWS && BUILD_TYPE == RELEASE && BUILD_COMPILER == MSVC && PAWN_CELL_SIZE == 64 #if BUILD_PLATFORM == WINDOWS && BUILD_TYPE == RELEASE && BUILD_COMPILER == MSVC && PAWN_CELL_SIZE == 64
@ -42,7 +42,7 @@
#include <stddef.h> /* for wchar_t */ #include <stddef.h> /* for wchar_t */
#include <string.h> #include <string.h>
#include "osdefs.h" #include "osdefs.h"
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#if !defined AMX_NODYNALOAD #if !defined AMX_NODYNALOAD
#include <dlfcn.h> #include <dlfcn.h>
@ -815,12 +815,12 @@ static void expand(unsigned char *code, long codesize, long memsize)
int AMXAPI amx_Init(AMX *amx,void *program) int AMXAPI amx_Init(AMX *amx,void *program)
{ {
AMX_HEADER *hdr; AMX_HEADER *hdr;
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD #if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__) && !defined AMX_NODYNALOAD
char libname[sNAMEMAX+8]; /* +1 for '\0', +3 for 'amx' prefix, +4 for extension */ char libname[sNAMEMAX+8]; /* +1 for '\0', +3 for 'amx' prefix, +4 for extension */
#if defined _Windows #if defined _Windows
typedef int (FAR WINAPI *AMX_ENTRY)(AMX _FAR *amx); typedef int (FAR WINAPI *AMX_ENTRY)(AMX _FAR *amx);
HINSTANCE hlib; HINSTANCE hlib;
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
typedef int (*AMX_ENTRY)(AMX *amx); typedef int (*AMX_ENTRY)(AMX *amx);
void *hlib; void *hlib;
#endif #endif
@ -965,7 +965,7 @@ int AMXAPI amx_Init(AMX *amx,void *program)
amx_BrowseRelocate(amx); amx_BrowseRelocate(amx);
/* load any extension modules that the AMX refers to */ /* load any extension modules that the AMX refers to */
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD #if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__) && !defined AMX_NODYNALOAD
hdr=(AMX_HEADER *)amx->base; hdr=(AMX_HEADER *)amx->base;
numlibraries=NUMENTRIES(hdr,libraries,pubvars); numlibraries=NUMENTRIES(hdr,libraries,pubvars);
for (i=0; i<numlibraries; i++) { for (i=0; i<numlibraries; i++) {
@ -981,7 +981,7 @@ int AMXAPI amx_Init(AMX *amx,void *program)
if (hlib<=HINSTANCE_ERROR) if (hlib<=HINSTANCE_ERROR)
hlib=NULL; hlib=NULL;
#endif #endif
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
strcat(libname,".so"); strcat(libname,".so");
hlib=dlopen(libname,RTLD_NOW); hlib=dlopen(libname,RTLD_NOW);
#endif #endif
@ -995,7 +995,7 @@ int AMXAPI amx_Init(AMX *amx,void *program)
strcat(funcname,"Init"); strcat(funcname,"Init");
#if defined _Windows #if defined _Windows
libinit=(AMX_ENTRY)GetProcAddress(hlib,funcname); libinit=(AMX_ENTRY)GetProcAddress(hlib,funcname);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
libinit=(AMX_ENTRY)dlsym(hlib,funcname); libinit=(AMX_ENTRY)dlsym(hlib,funcname);
#endif #endif
if (libinit!=NULL) if (libinit!=NULL)
@ -1029,7 +1029,7 @@ int AMXAPI amx_Init(AMX *amx,void *program)
return !VirtualProtect(addr, len, p, &prev); return !VirtualProtect(addr, len, p, &prev);
} }
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
/* Linux already has mprotect() */ /* Linux already has mprotect() */
@ -1104,10 +1104,10 @@ int AMXAPI amx_InitJIT(AMX *amx,void *compiled_program,void *reloc_table)
#if defined AMX_CLEANUP #if defined AMX_CLEANUP
int AMXAPI amx_Cleanup(AMX *amx) int AMXAPI amx_Cleanup(AMX *amx)
{ {
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD #if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__) && !defined AMX_NODYNALOAD
#if defined _Windows #if defined _Windows
typedef int (FAR WINAPI *AMX_ENTRY)(AMX FAR *amx); typedef int (FAR WINAPI *AMX_ENTRY)(AMX FAR *amx);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
typedef int (*AMX_ENTRY)(AMX *amx); typedef int (*AMX_ENTRY)(AMX *amx);
#endif #endif
AMX_HEADER *hdr; AMX_HEADER *hdr;
@ -1117,7 +1117,7 @@ int AMXAPI amx_Cleanup(AMX *amx)
#endif #endif
/* unload all extension modules */ /* unload all extension modules */
#if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__) && !defined AMX_NODYNALOAD #if (defined _Windows || defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__) && !defined AMX_NODYNALOAD
hdr=(AMX_HEADER *)amx->base; hdr=(AMX_HEADER *)amx->base;
assert(hdr->magic==AMX_MAGIC); assert(hdr->magic==AMX_MAGIC);
numlibraries=NUMENTRIES(hdr,libraries,pubvars); numlibraries=NUMENTRIES(hdr,libraries,pubvars);
@ -1130,14 +1130,14 @@ int AMXAPI amx_Cleanup(AMX *amx)
strcat(funcname,"Cleanup"); strcat(funcname,"Cleanup");
#if defined _Windows #if defined _Windows
libcleanup=(AMX_ENTRY)GetProcAddress((HINSTANCE)lib->address,funcname); libcleanup=(AMX_ENTRY)GetProcAddress((HINSTANCE)lib->address,funcname);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
libcleanup=(AMX_ENTRY)dlsym((void*)lib->address,funcname); libcleanup=(AMX_ENTRY)dlsym((void*)lib->address,funcname);
#endif #endif
if (libcleanup!=NULL) if (libcleanup!=NULL)
libcleanup(amx); libcleanup(amx);
#if defined _Windows #if defined _Windows
FreeLibrary((HINSTANCE)lib->address); FreeLibrary((HINSTANCE)lib->address);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
dlclose((void*)lib->address); dlclose((void*)lib->address);
#endif #endif
} /* if */ } /* if */
@ -1666,7 +1666,7 @@ int AMXAPI amx_PushString(AMX *amx, cell *amx_addr, cell **phys_addr, const char
* fast "indirect threaded" interpreter. * fast "indirect threaded" interpreter.
*/ */
#define NEXT(cip) goto **cip++ #define NEXT(cip) goto *(const void *)*cip++
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index) int AMXAPI amx_Exec(AMX *amx, cell *retval, int index)
{ {
@ -1846,14 +1846,14 @@ static const void * const amx_opcodelist[] = {
NEXT(cip); NEXT(cip);
op_load_i: op_load_i:
/* verify address */ /* verify address */
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp) if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
pri= * (cell *)(data+(int)pri); pri= * (cell *)(data+(int)pri);
NEXT(cip); NEXT(cip);
op_lodb_i: op_lodb_i:
GETPARAM(offs); GETPARAM(offs);
/* verify address */ /* verify address */
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp) if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
switch (offs) { switch (offs) {
case 1: case 1:
@ -1919,14 +1919,14 @@ static const void * const amx_opcodelist[] = {
NEXT(cip); NEXT(cip);
op_stor_i: op_stor_i:
/* verify address */ /* verify address */
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp) if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
*(cell *)(data+(int)alt)=pri; *(cell *)(data+(int)alt)=pri;
NEXT(cip); NEXT(cip);
op_strb_i: op_strb_i:
GETPARAM(offs); GETPARAM(offs);
/* verify address */ /* verify address */
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp) if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
switch (offs) { switch (offs) {
case 1: case 1:
@ -1943,7 +1943,7 @@ static const void * const amx_opcodelist[] = {
op_lidx: op_lidx:
offs=pri*sizeof(cell)+alt; offs=pri*sizeof(cell)+alt;
/* verify address */ /* verify address */
if (offs>=hea && offs<stk || (ucell)offs>=(ucell)amx->stp) if ((offs>=hea && offs<stk) || (ucell)offs>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
pri= * (cell *)(data+(int)offs); pri= * (cell *)(data+(int)offs);
NEXT(cip); NEXT(cip);
@ -1951,7 +1951,7 @@ static const void * const amx_opcodelist[] = {
GETPARAM(offs); GETPARAM(offs);
offs=(pri << (int)offs)+alt; offs=(pri << (int)offs)+alt;
/* verify address */ /* verify address */
if (offs>=hea && offs<stk || (ucell)offs>=(ucell)amx->stp) if ((offs>=hea && offs<stk) || (ucell)offs>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
pri= * (cell *)(data+(int)offs); pri= * (cell *)(data+(int)offs);
NEXT(cip); NEXT(cip);
@ -2388,13 +2388,13 @@ static const void * const amx_opcodelist[] = {
/* verify top & bottom memory addresses, for both source and destination /* verify top & bottom memory addresses, for both source and destination
* addresses * addresses
*/ */
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp) if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if ((pri+offs)>hea && (pri+offs)<stk || (ucell)(pri+offs)>(ucell)amx->stp) if (((pri+offs)>hea && (pri+offs)<stk) || (ucell)(pri+offs)>(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp) if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if ((alt+offs)>hea && (alt+offs)<stk || (ucell)(alt+offs)>(ucell)amx->stp) if (((alt+offs)>hea && (alt+offs)<stk) || (ucell)(alt+offs)>(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
memcpy(data+(int)alt, data+(int)pri, (int)offs); memcpy(data+(int)alt, data+(int)pri, (int)offs);
NEXT(cip); NEXT(cip);
@ -2403,22 +2403,22 @@ static const void * const amx_opcodelist[] = {
/* verify top & bottom memory addresses, for both source and destination /* verify top & bottom memory addresses, for both source and destination
* addresses * addresses
*/ */
if (pri>=hea && pri<stk || (ucell)pri>=(ucell)amx->stp) if ((pri>=hea && pri<stk) || (ucell)pri>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if ((pri+offs)>hea && (pri+offs)<stk || (ucell)(pri+offs)>(ucell)amx->stp) if (((pri+offs)>hea && (pri+offs)<stk) || (ucell)(pri+offs)>(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp) if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if ((alt+offs)>hea && (alt+offs)<stk || (ucell)(alt+offs)>(ucell)amx->stp) if (((alt+offs)>hea && (alt+offs)<stk) || (ucell)(alt+offs)>(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
pri=memcmp(data+(int)alt, data+(int)pri, (int)offs); pri=memcmp(data+(int)alt, data+(int)pri, (int)offs);
NEXT(cip); NEXT(cip);
op_fill: op_fill:
GETPARAM(offs); GETPARAM(offs);
/* verify top & bottom memory addresses */ /* verify top & bottom memory addresses */
if (alt>=hea && alt<stk || (ucell)alt>=(ucell)amx->stp) if ((alt>=hea && alt<stk) || (ucell)alt>=(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
if ((alt+offs)>hea && (alt+offs)<stk || (ucell)(alt+offs)>(ucell)amx->stp) if (((alt+offs)>hea && (alt+offs)<stk) || (ucell)(alt+offs)>(ucell)amx->stp)
ABORT(amx,AMX_ERR_MEMACCESS); ABORT(amx,AMX_ERR_MEMACCESS);
for (i=(int)alt; offs>=(int)sizeof(cell); i+=sizeof(cell), offs-=sizeof(cell)) for (i=(int)alt; offs>=(int)sizeof(cell); i+=sizeof(cell), offs-=sizeof(cell))
*(cell *)(data+i) = pri; *(cell *)(data+i) = pri;
@ -3592,7 +3592,7 @@ int AMXAPI amx_GetAddr(AMX *amx,cell amx_addr,cell **phys_addr)
data=(amx->data!=NULL) ? amx->data : amx->base+(int)hdr->dat; data=(amx->data!=NULL) ? amx->data : amx->base+(int)hdr->dat;
assert(phys_addr!=NULL); assert(phys_addr!=NULL);
if (amx_addr>=amx->hea && amx_addr<amx->stk || amx_addr<0 || amx_addr>=amx->stp) { if ((amx_addr>=amx->hea && amx_addr<amx->stk) || amx_addr<0 || amx_addr>=amx->stp) {
*phys_addr=NULL; *phys_addr=NULL;
return AMX_ERR_MEMACCESS; return AMX_ERR_MEMACCESS;
} /* if */ } /* if */

View File

@ -18,13 +18,13 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amx.h 3736 2008-08-16 20:13:12Z damagedsoul $
*/ */
#if defined FREEBSD && !defined __FreeBSD__ #if defined FREEBSD && !defined __FreeBSD__
#define __FreeBSD__ #define __FreeBSD__
#endif #endif
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#endif #endif
@ -34,7 +34,7 @@
#if defined HAVE_STDINT_H #if defined HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#else #else
#if defined __LCC__ || defined __DMC__ || defined LINUX #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__
#if defined HAVE_INTTYPES_H #if defined HAVE_INTTYPES_H
#include <inttypes.h> #include <inttypes.h>
#else #else
@ -188,7 +188,7 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -416,7 +416,7 @@ int AMXAPI amx_UTF8Put(char *string, char **endptr, int maxchars, cell value);
amx_Register((amx), amx_NativeInfo((name),(func)), 1); amx_Register((amx), amx_NativeInfo((name),(func)), 1);
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=reset #pragma options align=reset

View File

@ -21,7 +21,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amxdbg.h 3736 2008-08-16 20:13:12Z damagedsoul $
*/ */
#ifndef AMXDBG_H_INCLUDED #ifndef AMXDBG_H_INCLUDED
@ -49,7 +49,7 @@ extern "C" {
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -156,7 +156,7 @@ int AMXAPI dbg_GetArrayDim(AMX_DBG *amxdbg, const AMX_DBG_SYMBOL *sym, const AMX
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=reset #pragma options align=reset

View File

@ -1,5 +1,5 @@
#include <stdio.h> #include <stdio.h>
#ifdef __linux__ #if defined(__linux__) | defined (__APPLE__)
#include <unistd.h> #include <unistd.h>
#else #else
#include <fcntl.h> #include <fcntl.h>
@ -29,28 +29,29 @@ void WriteBh(BinaryWriter *bw, BinPlugin *bh);
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct abl pl32; struct abl pl32;
struct abl pl64;
#ifdef _DEBUG #ifdef _DEBUG
printf("debug clamp\n"); printf("debug clamp\n");
getchar(); getchar();
#endif #endif
#ifdef __linux__ #if defined(__linux__)
HINSTANCE lib = NULL; HINSTANCE lib = NULL;
if (FileExists("./amxxpc32.so")) if (FileExists("./amxxpc32.so"))
lib = dlmount("./amxxpc32.so"); lib = dlmount("./amxxpc32.so");
else else
lib = dlmount("amxxpc32.so"); lib = dlmount("amxxpc32.so");
#elif defined(__APPLE__)
HINSTANCE lib = dlmount("amxxpc32.dylib");
#else #else
HINSTANCE lib = dlmount("amxxpc32.dll"); HINSTANCE lib = dlmount("amxxpc32.dll");
#endif #endif
if (!lib) if (!lib)
{ {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
printf("32bit compiler failed to instantiate: %s\n", dlerror()); printf("compiler failed to instantiate: %s\n", dlerror());
#else #else
printf("32bit compiler failed to instantiate: %d\n", GetLastError()); printf("compiler failed to instantiate: %d\n", GetLastError());
#endif #endif
exit(0); exit(0);
} }
@ -60,16 +61,16 @@ int main(int argc, char **argv)
if (!sc32 || !pc_printf) if (!sc32 || !pc_printf)
{ {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
printf("32bit compiler failed to link: %p.\n",sc32); printf("compiler failed to link: %p.\n",sc32);
#else #else
printf("32bit compiler failed to link: %d.\n", GetLastError()); printf("compiler failed to link: %d.\n", GetLastError());
#endif #endif
exit(0); exit(0);
} }
pc_printf("Welcome to the AMX Mod X %s Compiler.\n", VERSION_STRING); pc_printf("Welcome to the AMX Mod X %s Compiler.\n", VERSION_STRING);
pc_printf("Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team\n\n"); pc_printf("Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team\n\n");
if (argc < 2) if (argc < 2)
{ {
@ -112,61 +113,12 @@ int main(int argc, char **argv)
unlink(file); unlink(file);
HINSTANCE lib64 = NULL;
#ifdef __linux__
if (FileExists("./amxxpc64.so"))
lib64 = dlmount("./amxxpc64.so");
else
lib64 = dlmount("amxxpc64.so");
#else
lib64 = dlmount("amxxpc64.dll");
#endif
if (!lib64)
{
pc_printf("64bit compiler failed to instantiate.\n");
exit(0);
}
COMPILER sc64 = (COMPILER)dlsym(lib64, "Compile64");
if (!sc64)
{
#ifdef __linux__
pc_printf("64bit compiler failed to link: %s.\n", dlerror());
#else
pc_printf("64bit compiler failed to link: %d.\n", GetLastError());
#endif
exit(0);
}
sc64(argc, argv);
dlclose(lib64);
if (file == NULL)
{
pc_printf("Could not locate the output file on second pass.\n");
exit(0);
} else {
FILE *fp = fopen(file, "rb");
if (fp == NULL)
{
pc_printf("Could not locate output file on second pass (compile failed).\n");
exit(0);
}
ReadFileIntoPl(&pl64, fp);
pl64.cellsize = 8;
fclose(fp);
}
///////////// /////////////
// COMPRSSION // COMPRSSION
///////////// /////////////
CompressPl(&pl32); CompressPl(&pl32);
CompressPl(&pl64);
char *newfile = new char[strlen(file)+3]; char *newfile = new char[strlen(file)+3];
strcpy(newfile, file); strcpy(newfile, file);
if (!strstr(file, ".amxx") && !strstr(file, ".AMXX")) if (!strstr(file, ".amxx") && !strstr(file, ".AMXX"))
@ -179,34 +131,33 @@ int main(int argc, char **argv)
exit(0); exit(0);
} }
BinPlugin bh32, bh64; BinPlugin bh32;
Pl2Bh(&pl32, &bh32); Pl2Bh(&pl32, &bh32);
Pl2Bh(&pl64, &bh64);
try try
{ {
static const int kEntries = 1;
//entry is 4 ints and a byte
static const int kEntrySize = (sizeof(int32_t) * 4) + sizeof(int8_t);
BinaryWriter bw(fp); BinaryWriter bw(fp);
bw.WriteUInt32(MAGIC_HEADER2); bw.WriteUInt32(MAGIC_HEADER2);
bw.WriteUInt16(MAGIC_VERSION); bw.WriteUInt16(MAGIC_VERSION);
bw.WriteUInt8(2); bw.WriteUInt8(kEntries);
//base header //base header
int baseaddr = sizeof(int32_t) + sizeof(int16_t) + sizeof(int8_t); int baseaddr = sizeof(int32_t) + sizeof(int16_t) + sizeof(int8_t);
//entry is 4 ints and a byte //extend this by the entries we have
int entrysize = (sizeof(int32_t) * 4) + sizeof(int8_t); baseaddr += kEntrySize * kEntries;
//extend this by the two entries we have
baseaddr += entrysize * 2;
bh32.offs = baseaddr; bh32.offs = baseaddr;
bh64.offs = bh32.offs + bh32.disksize;
WriteBh(&bw, &bh32); WriteBh(&bw, &bh32);
WriteBh(&bw, &bh64);
bw.WriteChars(pl32.cmp, pl32.cmpsize); bw.WriteChars(pl32.cmp, pl32.cmpsize);
bw.WriteChars(pl64.cmp, pl64.cmpsize);
} catch (...) { } catch (...) {
fclose(fp); fclose(fp);
unlink(file); unlink(file);
@ -293,7 +244,7 @@ char *swiext(const char *file, const char *ext, int isO)
int i = 0, pos = -1, j = 0; int i = 0, pos = -1, j = 0;
int fileLen = strlen(file); int fileLen = strlen(file);
int extLen = strlen(ext); int extLen = strlen(ext);
int max = 0, odirFlag = -1; int odirFlag = -1;
for (i=fileLen-1; i>=0; i--) for (i=fileLen-1; i>=0; i--)
{ {
@ -389,7 +340,7 @@ void show_help()
printf("\t-r[name] write cross reference report to console or to specified file\n"); printf("\t-r[name] write cross reference report to console or to specified file\n");
} }
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
bool FileExists(const char *file) bool FileExists(const char *file)
{ {
FILE *fp = fopen(file, "rb"); FILE *fp = fopen(file, "rb");

View File

@ -5,7 +5,7 @@
#define MAGIC_HEADER2 0x414D5858 #define MAGIC_HEADER2 0x414D5858
#define MAGIC_VERSION 0x0300 #define MAGIC_VERSION 0x0300
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
# include <dlfcn.h> # include <dlfcn.h>
#else #else
# include <windows.h> # include <windows.h>
@ -13,7 +13,7 @@
#include <string.h> #include <string.h>
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
# define dlmount(x) dlopen(x, RTLD_NOW|RTLD_GLOBAL) # define dlmount(x) dlopen(x, RTLD_NOW|RTLD_GLOBAL)
typedef void* HINSTANCE; typedef void* HINSTANCE;
#else #else
@ -65,7 +65,7 @@ struct BinPlugin
int32_t offs; //file offset int32_t offs; //file offset
}; };
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
bool FileExists(const char *file); bool FileExists(const char *file);
#endif #endif

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2005 # Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxxpc", "amxxpc.vcproj", "{39412290-D01C-472F-A439-AB5592A04C08}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxxpc", "amxxpc.vcxproj", "{39412290-D01C-472F-A439-AB5592A04C08}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -1,258 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="amxxpc"
ProjectGUID="{39412290-D01C-472F-A439-AB5592A04C08}"
RootNamespace="amxxpc"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="zlib.lib"
OutputFile="$(OutDir)/amxxpc.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/amxxpc.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
StructMemberAlignment="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="zlib.lib"
OutputFile="$(OutDir)/amxxpc.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\amx.cpp"
>
</File>
<File
RelativePath=".\amxxpc.cpp"
>
</File>
<File
RelativePath=".\Binary.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\amx.h"
>
</File>
<File
RelativePath=".\amxdbg.h"
>
</File>
<File
RelativePath=".\amxxpc.h"
>
</File>
<File
RelativePath=".\Binary.h"
>
</File>
<File
RelativePath=".\osdefs.h"
>
</File>
<File
RelativePath=".\resource.h"
>
</File>
<File
RelativePath=".\resource1.h"
>
</File>
<File
RelativePath=".\sclinux.h"
>
</File>
<File
RelativePath=".\zconf.h"
>
</File>
<File
RelativePath=".\zlib.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\amxxpc1.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{39412290-D01C-472F-A439-AB5592A04C08}</ProjectGuid>
<RootNamespace>amxxpc</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)amxxpc.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<StructMemberAlignment>Default</StructMemberAlignment>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="amx.cpp" />
<ClCompile Include="amxxpc.cpp" />
<ClCompile Include="Binary.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="amx.h" />
<ClInclude Include="amxdbg.h" />
<ClInclude Include="amxxpc.h" />
<ClInclude Include="Binary.h" />
<ClInclude Include="osdefs.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="resource1.h" />
<ClInclude Include="sclinux.h" />
<ClInclude Include="zconf.h" />
<ClInclude Include="zlib.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="amxxpc1.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="amx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="amxxpc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Binary.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="amx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="amxdbg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="amxxpc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Binary.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="osdefs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sclinux.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zconf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="zlib.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="amxxpc1.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -7,7 +7,7 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include "windows.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS

Binary file not shown.

View File

@ -39,6 +39,10 @@
#include <endian.h> #include <endian.h>
#endif #endif
#if defined __APPLE__
#include <sys/types.h>
#endif
/* Linux NOW has these */ /* Linux NOW has these */
#if !defined BIG_ENDIAN #if !defined BIG_ENDIAN
#define BIG_ENDIAN 4321 #define BIG_ENDIAN 4321

View File

@ -32,6 +32,10 @@
*/ */
#if !defined __BYTE_ORDER #if !defined __BYTE_ORDER
# include <stdlib.h> # include <stdlib.h>
# if defined __APPLE__
# include <sys/types.h>
# define __BYTE_ORDER BYTE_ORDER
# endif
#endif #endif
#if defined __OpenBSD__ || defined __FreeBSD__ #if defined __OpenBSD__ || defined __FreeBSD__

View File

@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* @(#) $Id$ */ /* @(#) $Id: zconf.h 3734 2008-08-16 09:48:39Z damagedsoul $ */
#ifndef ZCONF_H #ifndef ZCONF_H
#define ZCONF_H #define ZCONF_H

View File

@ -1,56 +1,108 @@
#(C)2004-2005 AMX Mod X Development Team # (C)2004-2013 AMX Mod X Development Team
# Makefile written by David "BAILOPAN" Anderson # Makefile written by David "BAILOPAN" Anderson
#####################################
### EDIT BELOW FOR OTHER PROJECTS ### ### EDIT BELOW FOR OTHER PROJECTS ###
#####################################
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing -fvisibility=hidden PROJECT = amxxpc32
DEBUG_FLAGS = -g -ggdb3 OBJECTS = sc1.c sc2.c sc3.c sc4.c sc5.c sc6.c sc7.c scvars.c scmemfil.c scstate.c sclist.c sci18n.c \
CPP = gcc-4.1 scexpand.c pawncc.c libpawnc.c prefix.c memfile.c
NAME = amxxpc
OBJECTS = sc1.c sc2.c sc3.c sc4.c sc5.c sc6.c sc7.c scvars.c scmemfil.c \ ##############################################
scstate.c sclist.c sci18n.c scexpand.c pawncc.c libpawnc.c prefix.c \ ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
memfile.c ##############################################
C_OPT_FLAGS = -DNDEBUG -O2 -funroll-loops -fomit-frame-pointer -pipe
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
CPP_OSX = clang
LINK = -lpthread LINK = -lpthread
INCLUDE = -I. INCLUDE = -I.
ifeq "$(PAWN64)" "true" ################################################
BINARY = $(NAME)64.so ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
BIN_DIR = Release64 ################################################
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -Dpc_printf=pc_printf64
OS := $(shell uname -s)
ifeq "$(OS)" "Darwin"
CPP = $(CPP_OSX)
LIB_EXT = dylib
CFLAGS += -DOSX
LINK += -dynamiclib -mmacosx-version-min=10.5
else else
BINARY = $(NAME)32.so LIB_EXT = so
BIN_DIR = Release32 CFLAGS += -DLINUX
CFLAGS += -DPAWN_CELL_SIZE=32 LINK += -shared
endif endif
CFLAGS += -DLINUX -DNDEBUG -DHAVE_STDINT_H -DENABLE_BINRELOC -DNO_MAIN -DPAWNC_DLL -static-libgcc LINK += -m32 -lm -ldl
CFLAGS += $(OPT_FLAGS) CFLAGS += -DENABLE_BINRELOC -DNO_MAIN -DPAWNC_DLL -DHAVE_STDINT_H -fno-strict-aliasing -m32 -Wall \
OBJ_LINUX := $(OBJECTS:%.c=$(BIN_DIR)/%.o) -Werror
CPPFLAGS += -fexceptions -fno-rtti
BINARY = $(PROJECT).$(LIB_EXT)
ifeq "$(DEBUG)" "true"
BIN_DIR = Debug
CFLAGS += $(C_DEBUG_FLAGS)
else
BIN_DIR = Release
CFLAGS += $(C_OPT_FLAGS)
endif
IS_CLANG := $(shell $(CPP) --version | head -1 | grep clang > /dev/null && echo "1" || echo "0")
ifeq "$(IS_CLANG)" "1"
CPP_MAJOR := $(shell $(CPP) --version | grep clang | sed "s/.*version \([0-9]\)*\.[0-9]*.*/\1/")
CPP_MINOR := $(shell $(CPP) --version | grep clang | sed "s/.*version [0-9]*\.\([0-9]\)*.*/\1/")
else
CPP_MAJOR := $(shell $(CPP) -dumpversion >&1 | cut -b1)
CPP_MINOR := $(shell $(CPP) -dumpversion >&1 | cut -b3)
endif
# Clang || GCC >= 4
ifeq "$(shell expr $(IS_CLANG) \| $(CPP_MAJOR) \>= 4)" "1"
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
# Clang >= 3 || GCC >= 4.7
ifeq "$(shell expr $(IS_CLANG) \& $(CPP_MAJOR) \>= 3 \| $(CPP_MAJOR) \>= 4 \& $(CPP_MINOR) \>= 7)" "1"
CFLAGS += -Wno-delete-non-virtual-dtor
endif
# OS is Linux and not using clang
ifeq "$(shell expr $(OS) \= Linux \& $(IS_CLANG) \= 0)" "1"
LINK += -static-libgcc
endif
OBJ_BIN := $(OBJECTS:%.c=$(BIN_DIR)/%.o)
# This will break if we include other Makefiles, but is fine for now. It allows
# us to make a copy of this file that uses altered paths (ie. Makefile.mine)
# or other changes without mucking up the original.
MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
$(BIN_DIR)/%.o: %.c $(BIN_DIR)/%.o: %.c
$(CPP) $(INCLUDE) $(CFLAGS) -m32 -o $@ -c $< $(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
all: all:
mkdir -p Release32 mkdir -p $(BIN_DIR)
mkdir -p Release64 $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT)
$(MAKE) pawn_make
$(MAKE) pawn_make PAWN64=true
pawn_make: $(OBJ_LINUX) $(PROJECT): $(OBJ_BIN)
$(CPP) $(INCLUDE) $(CFLAGS) -m32 $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY) $(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)
debug:
$(MAKE) all DEBUG=true
default: all default: all
clean: clean:
rm -rf Release32/*.o rm -rf $(BIN_DIR)/*.o
rm -rf Release32/$(BINARY) rm -f $(BIN_DIR)/$(BINARY)
rm -rf Release64/*.o
rm -rf Release64/$(BINARY)

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amx.h 3736 2008-08-16 20:13:12Z damagedsoul $
*/ */
#ifdef _MSC_VER #ifdef _MSC_VER
@ -33,7 +33,7 @@
#if defined FREEBSD && !defined __FreeBSD__ #if defined FREEBSD && !defined __FreeBSD__
#define __FreeBSD__ #define __FreeBSD__
#endif #endif
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#endif #endif
@ -43,7 +43,7 @@
#if defined HAVE_STDINT_H #if defined HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#else #else
#if defined __LCC__ || defined __DMC__ || defined LINUX #if defined __LCC__ || defined __DMC__ || defined LINUX || defined __APPLE__
#if defined HAVE_INTTYPES_H #if defined HAVE_INTTYPES_H
#include <inttypes.h> #include <inttypes.h>
#else #else
@ -197,7 +197,7 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -425,7 +425,7 @@ int AMXAPI amx_UTF8Put(char *string, char **endptr, int maxchars, cell value);
amx_Register((amx), amx_NativeInfo((name),(func)), 1); amx_Register((amx), amx_NativeInfo((name),(func)), 1);
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=reset #pragma options align=reset

View File

@ -21,7 +21,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: amxdbg.h 3736 2008-08-16 20:13:12Z damagedsoul $
*/ */
#ifndef AMXDBG_H_INCLUDED #ifndef AMXDBG_H_INCLUDED
@ -49,7 +49,7 @@ extern "C" {
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=mac68k #pragma options align=mac68k
@ -156,7 +156,7 @@ int AMXAPI dbg_GetArrayDim(AMX_DBG *amxdbg, const AMX_DBG_SYMBOL *sym, const AMX
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined LINUX || defined __FreeBSD__ #if defined LINUX || defined __FreeBSD__ || defined __APPLE__
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#elif defined MACOS && defined __MWERKS__ #elif defined MACOS && defined __MWERKS__
#pragma options align=reset #pragma options align=reset

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: dllmain.c 1724 2005-07-24 20:00:55Z dvander $
*/ */
#if defined _UNICODE || defined __UNICODE__ || defined UNICODE #if defined _UNICODE || defined __UNICODE__ || defined UNICODE

View File

@ -20,7 +20,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: libpawnc.c 2969 2006-08-25 00:28:36Z dvander $
*/ */
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@ -30,7 +30,7 @@
#if defined PAWNC_DLL #if defined PAWNC_DLL
#ifndef __linux__ #if !defined(__linux__) && !defined(__APPLE__)
#include "dllmain.c" #include "dllmain.c"
#endif #endif
@ -39,9 +39,6 @@
# define UNUSED_PARAM(p) ((void)(p)) # define UNUSED_PARAM(p) ((void)(p))
# endif # endif
static char *argv[MAX_ARGS];
static int argc;
#if PAWN_CELL_SIZE==32 #if PAWN_CELL_SIZE==32
#define EXCOMPILER Compile32 #define EXCOMPILER Compile32
#else #else

View File

@ -1,24 +1,18 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2005 # Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpc300", "libpc300.vcproj", "{19B72687-080B-437A-917A-12AEB0031635}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpc300", "libpc300.vcxproj", "{19B72687-080B-437A-917A-12AEB0031635}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug32|Win32 = Debug32|Win32 Debug|Win32 = Debug|Win32
Debug64|Win32 = Debug64|Win32 Release|Win32 = Release|Win32
Release32|Win32 = Release32|Win32
Release64|Win32 = Release64|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{19B72687-080B-437A-917A-12AEB0031635}.Debug32|Win32.ActiveCfg = Debug32|Win32 {19B72687-080B-437A-917A-12AEB0031635}.Debug|Win32.ActiveCfg = Debug|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Debug32|Win32.Build.0 = Debug32|Win32 {19B72687-080B-437A-917A-12AEB0031635}.Debug|Win32.Build.0 = Debug|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Debug64|Win32.ActiveCfg = Debug64|Win32 {19B72687-080B-437A-917A-12AEB0031635}.Release|Win32.ActiveCfg = Release|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Debug64|Win32.Build.0 = Debug64|Win32 {19B72687-080B-437A-917A-12AEB0031635}.Release|Win32.Build.0 = Release|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Release32|Win32.ActiveCfg = Release32|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Release32|Win32.Build.0 = Release32|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Release64|Win32.ActiveCfg = Release64|Win32
{19B72687-080B-437A-917A-12AEB0031635}.Release64|Win32.Build.0 = Release64|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -1,443 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="libpc300"
ProjectGUID="{19B72687-080B-437A-917A-12AEB0031635}"
RootNamespace="libpc300"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release32|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBPC300_EXPORTS;PAWNC_DLL;PAWN_CELL_SIZE=32;NO_MAIN;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/amxxpc32.dll"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/libpc300.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release64|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBPC300_EXPORTS;PAWNC_DLL;PAWN_CELL_SIZE=64;NO_MAIN;_CRT_SECURE_NO_DEPRECATE"
RuntimeLibrary="0"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/amxxpc64.dll"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/libpc300.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug32|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBPC300_EXPORTS;PAWNC_DLL;PAWN_CELL_SIZE=32;NO_MAIN;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="1"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/amxxpc32.dll"
LinkIncremental="2"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/libpc300.pdb"
SubSystem="2"
ImportLibrary="$(OutDir)/libpc300.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug64|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBPC300_EXPORTS;PAWNC_DLL;PAWN_CELL_SIZE=64;NO_MAIN;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="1"
RuntimeLibrary="1"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/amxxpc64.dll"
LinkIncremental="2"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/libpc300.pdb"
SubSystem="2"
ImportLibrary="$(OutDir)/libpc300.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\libpawnc.c"
>
</File>
<File
RelativePath=".\memfile.c"
>
</File>
<File
RelativePath=".\sc1.c"
>
</File>
<File
RelativePath=".\sc2.c"
>
</File>
<File
RelativePath=".\sc3.c"
>
</File>
<File
RelativePath=".\sc4.c"
>
</File>
<File
RelativePath=".\sc5.c"
>
</File>
<File
RelativePath=".\sc6.c"
>
</File>
<File
RelativePath=".\sc7.c"
>
</File>
<File
RelativePath=".\scexpand.c"
>
</File>
<File
RelativePath=".\sci18n.c"
>
</File>
<File
RelativePath=".\sclist.c"
>
</File>
<File
RelativePath=".\scmemfil.c"
>
</File>
<File
RelativePath=".\scstate.c"
>
</File>
<File
RelativePath=".\scvars.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\amx.h"
>
</File>
<File
RelativePath=".\memfile.h"
>
</File>
<File
RelativePath=".\sc.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\libpawnc.rc"
>
</File>
<File
RelativePath=".\sc5.scp"
>
</File>
<File
RelativePath=".\sc7.scp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{19B72687-080B-437A-917A-12AEB0031635}</ProjectGuid>
<RootNamespace>libpc300</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">amxxpc32</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">amxxpc32</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBPC300_EXPORTS;PAWNC_DLL;PAWN_CELL_SIZE=32;NO_MAIN;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(OutDir)libpc300.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBPC300_EXPORTS;PAWNC_DLL;PAWN_CELL_SIZE=32;NO_MAIN;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>StackFrameRuntimeCheck</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)libpc300.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(OutDir)libpc300.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="libpawnc.c" />
<ClCompile Include="memfile.c" />
<ClCompile Include="sc1.c" />
<ClCompile Include="sc2.c" />
<ClCompile Include="sc3.c" />
<ClCompile Include="sc4.c" />
<ClCompile Include="sc5.c" />
<ClCompile Include="sc6.c" />
<ClCompile Include="sc7.c" />
<ClCompile Include="scexpand.c" />
<ClCompile Include="sci18n.c" />
<ClCompile Include="sclist.c" />
<ClCompile Include="scmemfil.c" />
<ClCompile Include="scstate.c" />
<ClCompile Include="scvars.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="amx.h" />
<ClInclude Include="memfile.h" />
<ClInclude Include="sc.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="libpawnc.rc" />
</ItemGroup>
<ItemGroup>
<None Include="sc5.scp" />
<None Include="sc7.scp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="libpawnc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="memfile.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc1.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc3.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc4.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc5.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc6.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sc7.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="scexpand.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sci18n.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sclist.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="scmemfil.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="scstate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="scvars.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="amx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="memfile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sc.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="libpawnc.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="sc5.scp">
<Filter>Resource Files</Filter>
</None>
<None Include="sc7.scp">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -10,6 +10,7 @@ memfile_t *memfile_creat(const char *name, size_t init)
mf.size = init; mf.size = init;
mf.base = (char *)malloc(init); mf.base = (char *)malloc(init);
mf.usedoffs = 0; mf.usedoffs = 0;
mf.name = NULL;
if (!mf.base) if (!mf.base)
{ {
return NULL; return NULL;

View File

@ -9,7 +9,7 @@
#endif #endif
#endif #endif
#include <malloc.h> #include <stdlib.h>
typedef struct memfile_s typedef struct memfile_s
{ {

View File

@ -41,6 +41,10 @@
#include <endian.h> #include <endian.h>
#endif #endif
#if defined __APPLE__
#include <sys/types.h>
#endif
/* Linux NOW has these */ /* Linux NOW has these */
#if !defined BIG_ENDIAN #if !defined BIG_ENDIAN
#define BIG_ENDIAN 4321 #define BIG_ENDIAN 4321

View File

@ -20,7 +20,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: pawncc.c 1724 2005-07-24 20:00:55Z dvander $
*/ */
#include "sc.h" #include "sc.h"

View File

@ -25,7 +25,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc.h 3460 2007-04-24 13:36:36Z sawce $
*/ */
#ifndef SC_H_INCLUDED #ifndef SC_H_INCLUDED
#define SC_H_INCLUDED #define SC_H_INCLUDED
@ -63,7 +63,7 @@
#define PREPROC_TERM '\x7f'/* termination character for preprocessor expressions (the "DEL" code) */ #define PREPROC_TERM '\x7f'/* termination character for preprocessor expressions (the "DEL" code) */
#define sDEF_PREFIX "default.inc" /* default prefix filename */ #define sDEF_PREFIX "default.inc" /* default prefix filename */
#if defined WIN32 #if defined WIN32 || defined __clang__
#define INVISIBLE #define INVISIBLE
#else #else
#define INVISIBLE __attribute__((visibility("protected"))) #define INVISIBLE __attribute__((visibility("protected")))

View File

@ -20,7 +20,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc1.c 3460 2007-04-24 13:36:36Z sawce $
*/ */
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
@ -35,9 +35,10 @@
#include <io.h> #include <io.h>
#endif #endif
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#include <prefix.h> /* from BinReloc, see www.autopackage.org */ #include <prefix.h> /* from BinReloc, see www.autopackage.org */
#include <unistd.h>
#endif #endif
#if defined FORTIFY #if defined FORTIFY
@ -421,7 +422,7 @@ int pc_compile(int argc, char *argv[])
void *inpfmark; void *inpfmark;
int lcl_packstr,lcl_needsemicolon,lcl_tabsize; int lcl_packstr,lcl_needsemicolon,lcl_tabsize;
#if !defined SC_LIGHT #if !defined SC_LIGHT
int hdrsize; int hdrsize=0;
#endif #endif
/* set global variables to their initial value */ /* set global variables to their initial value */
@ -1248,9 +1249,9 @@ static void setconfig(char *root)
/* add the default "include" directory */ /* add the default "include" directory */
#if defined __WIN32__ || defined _WIN32 #if defined __WIN32__ || defined _WIN32
GetModuleFileName(NULL,path,_MAX_PATH); GetModuleFileName(NULL,path,_MAX_PATH);
#elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #elif defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
/* see www.autopackage.org for the BinReloc module */ /* see www.autopackage.org for the BinReloc module */
ptr = SELFPATH; ptr = (char *)SELFPATH;
if (!ptr) if (!ptr)
ptr = root; ptr = root;
strncpy(path,ptr,sizeof path); strncpy(path,ptr,sizeof path);
@ -1922,7 +1923,7 @@ static int declloc(int fstatic)
int dim[sDIMEN_MAX]; int dim[sDIMEN_MAX];
int numdim; int numdim;
int fconst; int fconst;
int staging_start; int staging_start=0;
fconst=matchtoken(tCONST); fconst=matchtoken(tCONST);
do { do {
@ -1948,7 +1949,7 @@ static int declloc(int fstatic)
* level might indicate a bug. * level might indicate a bug.
* NOTE - don't bother with the error if there's no valid function! * NOTE - don't bother with the error if there's no valid function!
*/ */
if ((sym=findloc(name))!=NULL && sym->compound!=nestlevel || findglb(name)!=NULL) if (((sym=findloc(name))!=NULL && sym->compound!=nestlevel) || findglb(name)!=NULL)
if (curfunc!=NULL && (curfunc->usage & uNATIVE)) if (curfunc!=NULL && (curfunc->usage & uNATIVE))
error(219,name); /* variable shadows another symbol */ error(219,name); /* variable shadows another symbol */
while (matchtoken('[')){ while (matchtoken('[')){
@ -2863,7 +2864,7 @@ static int operatoradjust(int opertok,symbol *sym,char *opername,int resulttag)
error(62); /* number or placement of the operands does not fit the operator */ error(62); /* number or placement of the operands does not fit the operator */
} /* switch */ } /* switch */
if (tags[0]==0 && (opertok!='=' && tags[1]==0 || opertok=='=' && resulttag==0)) if (tags[0]==0 && ((opertok!='=' && tags[1]==0) || (opertok=='=' && resulttag==0)))
error(64); /* cannot change predefined operators */ error(64); /* cannot change predefined operators */
/* change the operator name */ /* change the operator name */
@ -3045,7 +3046,7 @@ static void funcstub(int native)
tok=lex(&val,&str); tok=lex(&val,&str);
if (native) { if (native) {
if (tok==tPUBLIC || tok==tSTOCK || tok==tSTATIC || tok==tSYMBOL && *str==PUBLIC_CHAR) if (tok==tPUBLIC || tok==tSTOCK || tok==tSTATIC || (tok==tSYMBOL && *str==PUBLIC_CHAR))
error(42); /* invalid combination of class specifiers */ error(42); /* invalid combination of class specifiers */
} else { } else {
if (tok==tPUBLIC || tok==tSTOCK || tok==tSTATIC) if (tok==tPUBLIC || tok==tSTOCK || tok==tSTATIC)
@ -3166,7 +3167,7 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stoc
tag= (firsttag>=0) ? firsttag : pc_addtag(NULL); tag= (firsttag>=0) ? firsttag : pc_addtag(NULL);
tok=lex(&val,&str); tok=lex(&val,&str);
assert(!fpublic); assert(!fpublic);
if (tok==tNATIVE || tok==tPUBLIC && stock) if (tok==tNATIVE || (tok==tPUBLIC && stock))
error(42); /* invalid combination of class specifiers */ error(42); /* invalid combination of class specifiers */
if (tok==tOPERATOR) { if (tok==tOPERATOR) {
opertok=operatorname(symbolname); opertok=operatorname(symbolname);
@ -3512,7 +3513,7 @@ static int declargs(symbol *sym)
error(10); /* illegal function or declaration */ error(10); /* illegal function or declaration */
} /* switch */ } /* switch */
} while (tok=='&' || tok==tLABEL || tok==tCONST } while (tok=='&' || tok==tLABEL || tok==tCONST
|| tok!=tELLIPS && matchtoken(',')); /* more? */ || (tok!=tELLIPS && matchtoken(','))); /* more? */
/* if the next token is not ",", it should be ")" */ /* if the next token is not ",", it should be ")" */
needtoken(')'); needtoken(')');
} /* if */ } /* if */
@ -3873,7 +3874,7 @@ static void make_report(symbol *root,FILE *log,char *sourcefile)
continue; continue;
if ((sym->usage & uREAD)==0) if ((sym->usage & uREAD)==0)
continue; continue;
fprintf(log,"\t\t<member name=\"T:%s\" value=\"%ld\">\n",funcdisplayname(symname,sym->name),sym->addr); fprintf(log,"\t\t<member name=\"T:%s\" value=\"%ld\">\n",funcdisplayname(symname,sym->name),(long)sym->addr);
if (sym->tag!=0) { if (sym->tag!=0) {
tagsym=find_tag_byval(sym->tag); tagsym=find_tag_byval(sym->tag);
assert(tagsym!=NULL); assert(tagsym!=NULL);
@ -3883,7 +3884,7 @@ static void make_report(symbol *root,FILE *log,char *sourcefile)
if ((enumroot=sym->dim.enumlist)!=NULL) { if ((enumroot=sym->dim.enumlist)!=NULL) {
enumroot=enumroot->next; /* skip root */ enumroot=enumroot->next; /* skip root */
while (enumroot!=NULL) { while (enumroot!=NULL) {
fprintf(log,"\t\t\t<member name=\"C:%s\" value=\"%ld\">\n",funcdisplayname(symname,enumroot->name),enumroot->value); fprintf(log,"\t\t\t<member name=\"C:%s\" value=\"%ld\">\n",funcdisplayname(symname,enumroot->name),(long)enumroot->value);
/* find the constant with this name and get the tag */ /* find the constant with this name and get the tag */
ref=findglb(enumroot->name); ref=findglb(enumroot->name);
if (ref!=NULL) { if (ref!=NULL) {
@ -3919,7 +3920,7 @@ static void make_report(symbol *root,FILE *log,char *sourcefile)
continue; continue;
if ((sym->usage & uREAD)==0 || (sym->usage & (uENUMFIELD | uENUMROOT))!=0) if ((sym->usage & uREAD)==0 || (sym->usage & (uENUMFIELD | uENUMROOT))!=0)
continue; continue;
fprintf(log,"\t\t<member name=\"C:%s\" value=\"%ld\">\n",funcdisplayname(symname,sym->name),sym->addr); fprintf(log,"\t\t<member name=\"C:%s\" value=\"%ld\">\n",funcdisplayname(symname,sym->name),(long)sym->addr);
if (sym->tag!=0) { if (sym->tag!=0) {
tagsym=find_tag_byval(sym->tag); tagsym=find_tag_byval(sym->tag);
assert(tagsym!=NULL); assert(tagsym!=NULL);
@ -4039,7 +4040,7 @@ static void make_report(symbol *root,FILE *log,char *sourcefile)
for (arg=0; sym->dim.arglist[arg].ident!=0; arg++) { for (arg=0; sym->dim.arglist[arg].ident!=0; arg++) {
int dim,paraminfo; int dim,paraminfo;
char *outer_start,*inner_start; char *outer_start,*inner_start;
int outer_length,inner_length; int outer_length=0,inner_length=0;
if (sym->dim.arglist[arg].ident==iVARARGS) if (sym->dim.arglist[arg].ident==iVARARGS)
fprintf(log,"\t\t\t<param name=\"...\">\n"); fprintf(log,"\t\t\t<param name=\"...\">\n");
else else
@ -5248,7 +5249,7 @@ static void doreturn(void)
if ((rettype & uRETVALUE)!=0) { if ((rettype & uRETVALUE)!=0) {
int retarray=(ident==iARRAY || ident==iREFARRAY); int retarray=(ident==iARRAY || ident==iREFARRAY);
/* there was an earlier "return" statement in this function */ /* there was an earlier "return" statement in this function */
if (sub==NULL && retarray || sub!=NULL && !retarray) if ((sub==NULL && retarray) || (sub!=NULL && !retarray))
error(79); /* mixing "return array;" and "return value;" */ error(79); /* mixing "return array;" and "return value;" */
} /* if */ } /* if */
rettype|=uRETVALUE; /* function returns a value */ rettype|=uRETVALUE; /* function returns a value */
@ -5257,7 +5258,7 @@ static void doreturn(void)
if (!matchtag(curfunc->tag,tag,TRUE)) if (!matchtag(curfunc->tag,tag,TRUE))
error(213); /* tagname mismatch */ error(213); /* tagname mismatch */
if (ident==iARRAY || ident==iREFARRAY) { if (ident==iARRAY || ident==iREFARRAY) {
int dim[sDIMEN_MAX],numdim; int dim[sDIMEN_MAX],numdim=0;
cell arraysize; cell arraysize;
assert(sym!=NULL); assert(sym!=NULL);
if (sub!=NULL) { if (sub!=NULL) {

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc2.c 3318 2007-02-16 18:49:21Z sawce $
*/ */
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@ -27,7 +27,7 @@
#include <ctype.h> #include <ctype.h>
#include <math.h> #include <math.h>
#include "sc.h" #include "sc.h"
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#endif #endif
@ -198,7 +198,7 @@ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths)
char path[_MAX_PATH]; char path[_MAX_PATH];
strncpy(path,ptr,sizeof path); strncpy(path,ptr,sizeof path);
path[sizeof path - 1]='\0'; /* force '\0' termination */ path[sizeof path - 1]='\0'; /* force '\0' termination */
strncat(path,name,sizeof(path)-strlen(path)); strncat(path,name,sizeof(path) - strlen(path) - 1);
path[sizeof path - 1]='\0'; path[sizeof path - 1]='\0';
result=plungequalifiedfile(path); result=plungequalifiedfile(path);
} /* while */ } /* while */
@ -408,7 +408,7 @@ static void stripcom(unsigned char *line)
#if !defined SC_LIGHT #if !defined SC_LIGHT
/* collect the comment characters in a string */ /* collect the comment characters in a string */
if (icomment==2) { if (icomment==2) {
if (skipstar && (*line!='\0' && *line<=' ' || *line=='*')) { if (skipstar && ((*line!='\0' && *line<=' ') || *line=='*')) {
/* ignore leading whitespace and '*' characters */ /* ignore leading whitespace and '*' characters */
} else if (commentidx<COMMENT_LIMIT+COMMENT_MARGIN-1) { } else if (commentidx<COMMENT_LIMIT+COMMENT_MARGIN-1) {
comment[commentidx++]=(char)((*line!='\n') ? *line : ' '); comment[commentidx++]=(char)((*line!='\n') ? *line : ' ');
@ -585,22 +585,9 @@ static int htoi(cell *val,const unsigned char *curptr)
} }
#if defined __GNUC__ #if defined __GNUC__
static double pow10(int value) static double pow10(double d)
{ {
double res=1.0; return pow(10, d);
while (value>=4) {
res*=10000.0;
value-=5;
} /* while */
while (value>=2) {
res*=100.0;
value-=2;
} /* while */
while (value>=1) {
res*=10.0;
value-=1;
} /* while */
return res;
} }
#endif #endif
@ -1210,7 +1197,7 @@ static int command(void)
sym=findloc(str); sym=findloc(str);
if (sym==NULL) if (sym==NULL)
sym=findglb(str); sym=findglb(str);
if (sym==NULL || sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0) { if (sym==NULL || (sym->ident!=iFUNCTN && sym->ident!=iREFFUNC && (sym->usage & uDEFINE)==0)) {
error(17,str); /* undefined symbol */ error(17,str); /* undefined symbol */
} else { } else {
outval(sym->addr,FALSE); outval(sym->addr,FALSE);
@ -1644,7 +1631,7 @@ static void substallpatterns(unsigned char *line,int buffersize)
if (strncmp((char*)start,"defined",7)==0 && !isalpha((char)*(start+7))) { if (strncmp((char*)start,"defined",7)==0 && !isalpha((char)*(start+7))) {
start+=7; /* skip "defined" */ start+=7; /* skip "defined" */
/* skip white space & parantheses */ /* skip white space & parantheses */
while (*start<=' ' && *start!='\0' || *start=='(') while ((*start<=' ' && *start!='\0') || *start=='(')
start++; start++;
/* skip the symbol behind it */ /* skip the symbol behind it */
while (isalpha(*start) || isdigit(*start) || *start=='_') while (isalpha(*start) || isdigit(*start) || *start=='_')
@ -1946,7 +1933,7 @@ SC_FUNC int lex(cell *lexvalue,char **lexsym)
error(220); error(220);
} /* if */ } /* if */
} /* if */ } /* if */
} else if (*lptr=='\"' || *lptr==sc_ctrlchar && *(lptr+1)=='\"') } else if (*lptr=='\"' || (*lptr==sc_ctrlchar && *(lptr+1)=='\"'))
{ /* unpacked string literal */ { /* unpacked string literal */
_lextok=tSTRING; _lextok=tSTRING;
stringflags= (*lptr==sc_ctrlchar) ? RAWMODE : 0; stringflags= (*lptr==sc_ctrlchar) ? RAWMODE : 0;
@ -1959,9 +1946,9 @@ SC_FUNC int lex(cell *lexvalue,char **lexsym)
lptr+=1; /* skip final quote */ lptr+=1; /* skip final quote */
else else
error(37); /* invalid (non-terminated) string */ error(37); /* invalid (non-terminated) string */
} else if (*lptr=='!' && *(lptr+1)=='\"' } else if ((*lptr=='!' && *(lptr+1)=='\"')
|| *lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"' || (*lptr=='!' && *(lptr+1)==sc_ctrlchar && *(lptr+2)=='\"')
|| *lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"') || (*lptr==sc_ctrlchar && *(lptr+1)=='!' && *(lptr+2)=='\"'))
{ /* packed string literal */ { /* packed string literal */
_lextok=tSTRING; _lextok=tSTRING;
stringflags= (*lptr==sc_ctrlchar || *(lptr+1)==sc_ctrlchar) ? RAWMODE : 0; stringflags= (*lptr==sc_ctrlchar || *(lptr+1)==sc_ctrlchar) ? RAWMODE : 0;
@ -2053,7 +2040,7 @@ SC_FUNC int matchtoken(int token)
int tok; int tok;
tok=lex(&val,&str); tok=lex(&val,&str);
if (tok==token || token==tTERM && (tok==';' || tok==tENDEXPR)) { if (tok==token || (token==tTERM && (tok==';' || tok==tENDEXPR))) {
return 1; return 1;
} else if (!sc_needsemicolon && token==tTERM && (_lexnewline || !freading)) { } else if (!sc_needsemicolon && token==tTERM && (_lexnewline || !freading)) {
/* Push "tok" back, because it is the token following the implicit statement /* Push "tok" back, because it is the token following the implicit statement
@ -2418,7 +2405,7 @@ SC_FUNC void delete_symbols(symbol *root,int level,int delete_labels,int delete_
{ {
symbol *sym,*parent_sym; symbol *sym,*parent_sym;
constvalue *stateptr; constvalue *stateptr;
int mustdelete; int mustdelete=0;
/* erase only the symbols with a deeper nesting level than the /* erase only the symbols with a deeper nesting level than the
* specified nesting level */ * specified nesting level */

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc3.c 3522 2007-05-22 01:29:18Z sawce $
*/ */
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@ -929,7 +929,7 @@ static int hier14(value *lval1)
} /* if */ } /* if */
if (lval3.sym->dim.array.level!=level) if (lval3.sym->dim.array.level!=level)
return error(48); /* array dimensions must match */ return error(48); /* array dimensions must match */
else if (ltlength<val || exactmatch && ltlength>val || val==0) else if (ltlength<val || (exactmatch && ltlength>val) || val==0)
return error(47); /* array sizes must match */ return error(47); /* array sizes must match */
else if (lval3.ident!=iARRAYCELL && !matchtag(lval3.sym->x.idxtag,idxtag,TRUE)) else if (lval3.ident!=iARRAYCELL && !matchtag(lval3.sym->x.idxtag,idxtag,TRUE))
error(229,(lval2.sym!=NULL) ? lval2.sym->name : lval3.sym->name); /* index tag mismatch */ error(229,(lval2.sym!=NULL) ? lval2.sym->name : lval3.sym->name); /* index tag mismatch */
@ -1124,7 +1124,7 @@ static int hier2(value *lval)
int tag,paranthese; int tag,paranthese;
cell val; cell val;
char *st; char *st;
symbol *sym; symbol *sym=NULL;
int saveresult; int saveresult;
tok=lex(&val,&st); tok=lex(&val,&st);
@ -1247,7 +1247,7 @@ static int hier2(value *lval)
lval->constval=1; /* preset */ lval->constval=1; /* preset */
if (sym->ident==iARRAY || sym->ident==iREFARRAY) { if (sym->ident==iARRAY || sym->ident==iREFARRAY) {
int level; int level;
symbol *idxsym; symbol *idxsym=NULL;
for (level=0; matchtoken('['); level++) { for (level=0; matchtoken('['); level++) {
idxsym=NULL; idxsym=NULL;
if (level==sym->dim.array.level && matchtoken(tSYMBOL)) { if (level==sym->dim.array.level && matchtoken(tSYMBOL)) {
@ -1293,7 +1293,7 @@ static int hier2(value *lval)
} /* if */ } /* if */
if (sym->ident==iARRAY || sym->ident==iREFARRAY) { if (sym->ident==iARRAY || sym->ident==iREFARRAY) {
int level; int level;
symbol *idxsym; symbol *idxsym=NULL;
for (level=0; matchtoken('['); level++) { for (level=0; matchtoken('['); level++) {
idxsym=NULL; idxsym=NULL;
if (level==sym->dim.array.level && matchtoken(tSYMBOL)) { if (level==sym->dim.array.level && matchtoken(tSYMBOL)) {
@ -1462,7 +1462,7 @@ restart:
} /* if */ } /* if */
if (close==']') { if (close==']') {
/* normal array index */ /* normal array index */
if (lval2.constval<0 || sym->dim.array.length!=0 && sym->dim.array.length<=lval2.constval) if (lval2.constval<0 || (sym->dim.array.length!=0 && sym->dim.array.length<=lval2.constval))
error(32,sym->name); /* array index out of bounds */ error(32,sym->name); /* array index out of bounds */
if (lval2.constval!=0) { if (lval2.constval!=0) {
/* don't add offsets for zero subscripts */ /* don't add offsets for zero subscripts */
@ -1479,8 +1479,8 @@ restart:
} /* if */ } /* if */
} else { } else {
/* character index */ /* character index */
if (lval2.constval<0 || sym->dim.array.length!=0 if (lval2.constval<0 || (sym->dim.array.length!=0
&& sym->dim.array.length*((8*sizeof(cell))/sCHARBITS)<=(ucell)lval2.constval) && sym->dim.array.length*((8*sizeof(cell))/sCHARBITS)<=(ucell)lval2.constval))
error(32,sym->name); /* array index out of bounds */ error(32,sym->name); /* array index out of bounds */
if (lval2.constval!=0) { if (lval2.constval!=0) {
/* don't add offsets for zero subscripts */ /* don't add offsets for zero subscripts */
@ -2035,8 +2035,8 @@ static int nesting=0;
* function argument; a literal string may be smaller than * function argument; a literal string may be smaller than
* the function argument. * the function argument.
*/ */
if (lval.constval>0 && arg[argidx].dim[0]!=lval.constval if ((lval.constval>0 && arg[argidx].dim[0]!=lval.constval)
|| lval.constval<0 && arg[argidx].dim[0] < -lval.constval) || (lval.constval<0 && arg[argidx].dim[0] < -lval.constval))
error(47); /* array sizes must match */ error(47); /* array sizes must match */
} /* if */ } /* if */
} /* if */ } /* if */

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc4.c 1724 2005-07-24 20:00:55Z dvander $
*/ */
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
@ -235,7 +235,7 @@ SC_FUNC void begdseg(void)
SC_FUNC void setline(int chkbounds) SC_FUNC void setline(int chkbounds)
{ {
if ((sc_debug & sSYMBOLIC)!=0 || chkbounds && (sc_debug & sCHKBOUNDS)!=0) { if ((sc_debug & sSYMBOLIC)!=0 || (chkbounds && (sc_debug & sCHKBOUNDS)!=0)) {
/* generate a "break" (start statement) opcode rather than a "line" opcode /* generate a "break" (start statement) opcode rather than a "line" opcode
* because earlier versions of Small/Pawn have an incompatible version of the * because earlier versions of Small/Pawn have an incompatible version of the
* line opcode * line opcode
@ -719,7 +719,7 @@ SC_FUNC void ffcall(symbol *sym,const char *label,int numargs)
stgwrite(sym->name); stgwrite(sym->name);
} /* if */ } /* if */
if (sc_asmfile if (sc_asmfile
&& (label!=NULL || !isalpha(sym->name[0]) && sym->name[0]!='_' && sym->name[0]!=sc_ctrlchar)) && (label!=NULL || (!isalpha(sym->name[0]) && sym->name[0]!='_' && sym->name[0]!=sc_ctrlchar)))
{ {
stgwrite("\t; "); stgwrite("\t; ");
stgwrite(symname); stgwrite(symname);

View File

@ -19,13 +19,13 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc5.c 1724 2005-07-24 20:00:55Z dvander $
*/ */
#include <assert.h> #include <assert.h>
#if defined __WIN32__ || defined _WIN32 || defined __MSDOS__ #if defined __WIN32__ || defined _WIN32 || defined __MSDOS__
#include <io.h> #include <io.h>
#endif #endif
#if defined LINUX || defined __GNUC__ #if defined LINUX || defined __APPLE__ || defined __GNUC__
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -132,7 +132,7 @@ static short lastfile;
} /* if */ } /* if */
va_end(argptr); va_end(argptr);
if (number>=100 && number<200 || errnum>25){ if ((number>=100 && number<200) || errnum>25){
if (strlen(errfname)==0) { if (strlen(errfname)==0) {
va_start(argptr,number); va_start(argptr,number);
pc_error(0,"\nCompilation aborted.",NULL,0,0,argptr); pc_error(0,"\nCompilation aborted.",NULL,0,0,argptr);

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc5.scp 2167 2005-11-19 09:16:27Z dvander $
*/ */
SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned char pairtable[128][2]); SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned char pairtable[128][2]);

View File

@ -18,7 +18,7 @@
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
* *
* Version: $Id$ * Version: $Id: sc6.c 2018 2005-09-06 21:34:33Z dvander $
*/ */
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
@ -30,7 +30,7 @@
#endif #endif
#include "sc.h" #include "sc.h"
#include "amxdbg.h" #include "amxdbg.h"
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__
#include <sclinux.h> #include <sclinux.h>
#endif #endif
@ -895,7 +895,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
instr=skipwhitespace(line); instr=skipwhitespace(line);
/* ignore empty lines and labels (labels have a special syntax, so these /* ignore empty lines and labels (labels have a special syntax, so these
* must be parsed separately) */ * must be parsed separately) */
if (*instr=='\0' || tolower(*instr)=='l' && *(instr+1)=='.') if (*instr=='\0' || (tolower(*instr)=='l' && *(instr+1)=='.'))
continue; continue;
/* get to the end of the instruction (make use of the '\n' that fgets() /* get to the end of the instruction (make use of the '\n' that fgets()
* added at the end of the line; this way we will *always* drop on a * added at the end of the line; this way we will *always* drop on a

Some files were not shown because too many files have changed in this diff Show More