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 <stddef.h> /* for wchar_t */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "osdefs.h"
|
#include "osdefs.h"
|
||||||
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
|
#if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__
|
||||||
#include <sclinux.h>
|
#include <sclinux.h>
|
||||||
|
|
|
@ -96,14 +96,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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 PAWN_DLL
|
||||||
#if !defined AMX_NATIVE_CALL
|
#if !defined AMX_NATIVE_CALL
|
||||||
#define AMX_NATIVE_CALL __stdcall
|
#define AMX_NATIVE_CALL __stdcall
|
||||||
|
@ -157,9 +149,11 @@ extern "C" {
|
||||||
#elif PAWN_CELL_SIZE==32
|
#elif PAWN_CELL_SIZE==32
|
||||||
typedef uint32_t ucell;
|
typedef uint32_t ucell;
|
||||||
typedef int32_t cell;
|
typedef int32_t cell;
|
||||||
|
#define REAL float
|
||||||
#elif PAWN_CELL_SIZE==64
|
#elif PAWN_CELL_SIZE==64
|
||||||
typedef uint64_t ucell;
|
typedef uint64_t ucell;
|
||||||
typedef int64_t cell;
|
typedef int64_t cell;
|
||||||
|
#define REAL double
|
||||||
#else
|
#else
|
||||||
#error Unsupported cell size (PAWN_CELL_SIZE)
|
#error Unsupported cell size (PAWN_CELL_SIZE)
|
||||||
#endif
|
#endif
|
||||||
|
@ -246,6 +240,8 @@ typedef struct tagAMX {
|
||||||
int flags PACKED; /* current status, see amx_Flags() */
|
int flags PACKED; /* current status, see amx_Flags() */
|
||||||
/* user data */
|
/* user data */
|
||||||
long usertags[AMX_USERNUM] PACKED;
|
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;
|
void _FAR *userdata[AMX_USERNUM] PACKED;
|
||||||
/* native functions can raise an error */
|
/* native functions can raise an error */
|
||||||
int error PACKED;
|
int error PACKED;
|
||||||
|
@ -338,6 +334,12 @@ enum {
|
||||||
#define AMX_COMPACTMARGIN 64
|
#define AMX_COMPACTMARGIN 64
|
||||||
#endif
|
#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
|
/* for native functions that use floating point parameters, the following
|
||||||
* two macros are convenient for casting a "cell" into a "float" type _without_
|
* two macros are convenient for casting a "cell" into a "float" type _without_
|
||||||
* changing the bit pattern
|
* changing the bit pattern
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
// this file does not include amxmodx.h, so we have to include the memory manager here
|
// this file does not include amxmodx.h, so we have to include the memory manager here
|
||||||
#ifdef MEMORY_TEST
|
#ifdef MEMORY_TEST
|
||||||
#include "mmgr/mmgr.h"
|
#include "mmgr/mmgr.h"
|
||||||
|
|
|
@ -205,7 +205,7 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
||||||
delete[] np;
|
delete[] np;
|
||||||
delete[] rt;
|
delete[] rt;
|
||||||
char *prg = (char *)(*program);
|
char *prg = (char *)(*program);
|
||||||
delete[] *prg;
|
delete[] prg;
|
||||||
(*program) = amx->base;
|
(*program) = amx->base;
|
||||||
if ( *program == 0 ){
|
if ( *program == 0 ){
|
||||||
strcpy(error,"Failed to allocate memory");
|
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 );
|
CList<CScript,AMX*>::iterator a = g_loadedscripts.find( amx );
|
||||||
if ( a ) a.remove();
|
if ( a ) a.remove();
|
||||||
char *prg = (char *)*program;
|
char *prg = (char *)*program;
|
||||||
delete[] *prg;
|
delete[] prg;
|
||||||
*program = 0;
|
*program = 0;
|
||||||
return AMX_ERR_NONE;
|
return AMX_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
* This file may be freely used. No warranties of any kind.
|
* 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
|
// this file does not include amxmodx.h, so we have to include the memory manager here
|
||||||
#ifdef MEMORY_TEST
|
#ifdef MEMORY_TEST
|
||||||
#include "mmgr/mmgr.h"
|
#include "mmgr/mmgr.h"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user