mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
quick fixes before adding debugger again
This commit is contained in:
parent
4609cb409b
commit
09a08fd2f6
@ -45,6 +45,7 @@
|
||||
#include <stddef.h> /* for wchar_t */
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "osdefs.h"
|
||||
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
|
||||
#include <sclinux.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
|
||||
|
@ -18,6 +18,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
// this file does not include amxmodx.h, so we have to include the memory manager here
|
||||
#ifdef MEMORY_TEST
|
||||
#include "mmgr/mmgr.h"
|
||||
|
@ -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<CScript,AMX*>::iterator a = g_loadedscripts.find( amx );
|
||||
if ( a ) a.remove();
|
||||
char *prg = (char *)*program;
|
||||
delete[] *prg;
|
||||
delete[] prg;
|
||||
*program = 0;
|
||||
return AMX_ERR_NONE;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
* This file may be freely used. No warranties of any kind.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
// this file does not include amxmodx.h, so we have to include the memory manager here
|
||||
#ifdef MEMORY_TEST
|
||||
#include "mmgr/mmgr.h"
|
||||
|
Loading…
Reference in New Issue
Block a user