diff --git a/amxmodx/JIT/jits.asm b/amxmodx/JIT/jits.asm index 459a5e7f..455f90d2 100755 --- a/amxmodx/JIT/jits.asm +++ b/amxmodx/JIT/jits.asm @@ -108,7 +108,7 @@ ; ; GWMV: to generate LINE opcode, %define ALLOWOPLINE ; -%undef ALLOWOPLINE +%define ALLOWOPLINE ; ; If this is set to 1 the JIT generates relocatable code for case tables, too. @@ -164,8 +164,9 @@ _alt: resd 1 _reset_stk: resd 1 _reset_hea: resd 1 _syscall_d: resd 1 -; the two fields below are for the JIT; they do not exist in -; the non-JIT version of the abstract machine +; the two fields below are for the JIT +; they are included in the non-JIT version for AMX Mod X +; this is to make sure that the structs match universally! _reloc_size: resd 1 ; memory block for relocations _code_size: resd 1 ; memory size of the native code endstruc diff --git a/amxmodx/JIT/jits.o b/amxmodx/JIT/jits.o index 468efa42..f15a1b5f 100755 Binary files a/amxmodx/JIT/jits.o and b/amxmodx/JIT/jits.o differ diff --git a/amxmodx/Makefile.pl b/amxmodx/Makefile.pl index a51e60c8..b503304c 100755 --- a/amxmodx/Makefile.pl +++ b/amxmodx/Makefile.pl @@ -75,14 +75,14 @@ while ($cmd = shift) $gcc = `$gccf --version`; if ($gcc =~ /2\.9/) { - if ($OPTIONS{"jit"}) - { - push(@CPP_SOURCE_FILES, "amx.cpp"); - $OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2"; - } else { + #if ($OPTIONS{"jit"}) + #{ +# push(@CPP_SOURCE_FILES, "amx.cpp"); +# $OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2"; +# } else { `ln -s amx.cpp amx.c`; push(@C_SOURCE_FILES, "amx.c"); - } +# } } else { if ($OPTIONS{"amd64"}) { diff --git a/amxmodx/amx.cpp b/amxmodx/amx.cpp index d33669c7..df5f108f 100755 --- a/amxmodx/amx.cpp +++ b/amxmodx/amx.cpp @@ -480,8 +480,12 @@ int AMXAPI amx_Debug(AMX *amx) } #if defined JIT +#if defined WIN32 || __cplusplus extern "C" int AMXAPI getMaxCodeSize(void); extern "C" int AMXAPI asm_runJIT(void *sourceAMXbase, void *jumparray, void *compiledAMXbase); +#else + extern int AMXAPI getMaxCodeSize(void); + extern int AMXAPI asm_runJIT(void *sourceAMXbase, void *jumparray, void *compiledAMXbase); #endif #if SMALL_CELL_SIZE==16 @@ -2728,17 +2732,26 @@ static void *amx_opcodelist_nodebug[] = { #endif #elif defined __GNUC__ /* force "cdecl" by adding an "attribute" to the declaration */ + #if defined __cplusplus + extern "C" cell amx_exec_asm(cell *regs,cell *retval,cell stp,cell hea) __attribute__((cdecl)); + #else extern cell amx_exec_asm(cell *regs,cell *retval,cell stp,cell hea) __attribute__((cdecl)); + #endif #else /* force "cdecl" by specifying it as a "function class" with the "__cdecl" keyword */ - extern cell __cdecl amx_exec_asm(cell *regs,cell *retval,cell stp,cell hea); + extern "C" cell __cdecl amx_exec_asm(cell *regs,cell *retval,cell stp,cell hea); #endif #endif #if defined ASM32 || defined JIT +#if defined WIN32 || defined __cplusplus + extern "C" void *amx_opcodelist[]; + extern "C" void *amx_opcodelist_nodebug[]; +#else extern void *amx_opcodelist[]; extern void *amx_opcodelist_nodebug[]; #endif +#endif int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...) {