diff --git a/amxmodx/amx.cpp b/amxmodx/amx.cpp index 32271968..870c32ab 100755 --- a/amxmodx/amx.cpp +++ b/amxmodx/amx.cpp @@ -45,6 +45,7 @@ #include /* for wchar_t */ #include #include +#include #include "osdefs.h" #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #include diff --git a/amxmodx/amx.h b/amxmodx/amx.h index 480e75bf..1264528e 100755 --- a/amxmodx/amx.h +++ b/amxmodx/amx.h @@ -96,14 +96,6 @@ extern "C" { #endif -#if PAWN_CELL_SIZE==32 - #define REAL float -#elif PAWN_CELL_SIZE==64 - #define REAL double -#else - #error Unsupported cell size -#endif - #if defined PAWN_DLL #if !defined AMX_NATIVE_CALL #define AMX_NATIVE_CALL __stdcall @@ -157,9 +149,11 @@ extern "C" { #elif PAWN_CELL_SIZE==32 typedef uint32_t ucell; typedef int32_t cell; +#define REAL float #elif PAWN_CELL_SIZE==64 typedef uint64_t ucell; typedef int64_t cell; +#define REAL double #else #error Unsupported cell size (PAWN_CELL_SIZE) #endif @@ -246,6 +240,8 @@ typedef struct tagAMX { int flags PACKED; /* current status, see amx_Flags() */ /* user data */ long usertags[AMX_USERNUM] PACKED; + //okay userdata[3] in AMX Mod X is for the CPlugin * pointer + //we're also gonna set userdata[2] to a special debug structure void _FAR *userdata[AMX_USERNUM] PACKED; /* native functions can raise an error */ int error PACKED; @@ -338,6 +334,12 @@ enum { #define AMX_COMPACTMARGIN 64 #endif +struct AMX_DBGINFO +{ + void *pDebug; //Pointer to debug data + int error; //non-amx_Exec() error setting +}; + /* for native functions that use floating point parameters, the following * two macros are convenient for casting a "cell" into a "float" type _without_ * changing the bit pattern diff --git a/amxmodx/amxtime.cpp b/amxmodx/amxtime.cpp index 8c4464e6..9e7c2241 100755 --- a/amxmodx/amxtime.cpp +++ b/amxmodx/amxtime.cpp @@ -18,6 +18,8 @@ # endif #endif +#include + // this file does not include amxmodx.h, so we have to include the memory manager here #ifdef MEMORY_TEST #include "mmgr/mmgr.h" diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index 9c3291bf..05a16f1c 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -205,7 +205,7 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64 delete[] np; delete[] rt; char *prg = (char *)(*program); - delete[] *prg; + delete[] prg; (*program) = amx->base; if ( *program == 0 ){ strcpy(error,"Failed to allocate memory"); @@ -358,7 +358,7 @@ int unload_amxscript(AMX* amx, void** program) CList::iterator a = g_loadedscripts.find( amx ); if ( a ) a.remove(); char *prg = (char *)*program; - delete[] *prg; + delete[] prg; *program = 0; return AMX_ERR_NONE; } diff --git a/amxmodx/power.cpp b/amxmodx/power.cpp index 7fd68c4e..0dfb2431 100755 --- a/amxmodx/power.cpp +++ b/amxmodx/power.cpp @@ -6,6 +6,7 @@ * This file may be freely used. No warranties of any kind. */ +#include // this file does not include amxmodx.h, so we have to include the memory manager here #ifdef MEMORY_TEST #include "mmgr/mmgr.h"