Initial import of amxxpc
This commit is contained in:
@ -249,11 +249,9 @@ typedef struct tagAMX {
|
||||
cell reset_stk PACKED;
|
||||
cell reset_hea PACKED;
|
||||
cell sysreq_d PACKED; /* relocated address/value for the SYSREQ.D opcode */
|
||||
#if defined JIT
|
||||
/* support variables for the JIT */
|
||||
int reloc_size PACKED; /* required temporary buffer for relocations */
|
||||
long code_size PACKED; /* estimated memory footprint of the native code */
|
||||
#endif
|
||||
/* support variables for the JIT */
|
||||
int reloc_size PACKED; /* required temporary buffer for relocations */
|
||||
long code_size PACKED; /* estimated memory footprint of the native code */
|
||||
} PACKED AMX;
|
||||
|
||||
/* The AMX_HEADER structure is both the memory format as the file format. The
|
||||
@ -279,13 +277,8 @@ typedef struct tagAMX_HEADER {
|
||||
int32_t nametable PACKED; /* name table */
|
||||
} PACKED AMX_HEADER;
|
||||
|
||||
#if PAWN_CELL_SIZE==16
|
||||
#define AMX_MAGIC 0xf1e2
|
||||
#elif PAWN_CELL_SIZE==32
|
||||
#define AMX_MAGIC 0xf1e0
|
||||
#elif PAWN_CELL_SIZE==64
|
||||
#define AMX_MAGIC 0xf1e1
|
||||
#endif
|
||||
//This is always the same for us
|
||||
#define AMX_MAGIC 0xf1e0
|
||||
|
||||
enum {
|
||||
AMX_ERR_NONE,
|
||||
|
@ -56,48 +56,13 @@
|
||||
|
||||
# if defined __WIN32__ || defined _WIN32 || defined WIN32 || defined __NT__
|
||||
__declspec (dllexport)
|
||||
void EXCOMPILER(HWND hwnd, HINSTANCE hinst, LPSTR lpCommandLine, int nCmdShow)
|
||||
void EXCOMPILER(int argc, char **argv)
|
||||
# else
|
||||
void extern EXCOMPILER(HWND hwnd, HINSTANCE hinst, LPSTR lpCommandLine, int nCmdShow)
|
||||
void extern EXCOMPILER(int argc, char **argv)
|
||||
# endif
|
||||
{
|
||||
char RootPath[_MAX_PATH];
|
||||
LPSTR ptr;
|
||||
|
||||
/* RUNDLL32 may have passed us a HWND and a HINSTANCE, but we can hardly
|
||||
* trust these. They may not contain values that we can use.
|
||||
*/
|
||||
|
||||
/* the root path in argv[0] */
|
||||
GetModuleFileName(hinstDLL, RootPath, sizeof RootPath);
|
||||
argv[argc++]=RootPath;
|
||||
|
||||
/* all other options */
|
||||
assert(lpCommandLine!=NULL);
|
||||
ptr=dll_skipwhite(lpCommandLine);
|
||||
while (*ptr!='\0') {
|
||||
if (*ptr=='"') {
|
||||
argv[argc++]=ptr+1;
|
||||
while (*ptr!='"' && *ptr!='\0')
|
||||
ptr++;
|
||||
} else {
|
||||
argv[argc++]=ptr;
|
||||
while (*ptr>' ')
|
||||
ptr++;
|
||||
} /* if */
|
||||
if (*ptr!='\0')
|
||||
*ptr++='\0';
|
||||
ptr=dll_skipwhite(ptr);
|
||||
} /* while */
|
||||
pc_compile(argc,argv);
|
||||
UNUSED_PARAM(hwnd);
|
||||
UNUSED_PARAM(hinst);
|
||||
UNUSED_PARAM(nCmdShow);
|
||||
pc_compile(argc, argv);
|
||||
}
|
||||
|
||||
#else /* PAWNC_DLL */
|
||||
|
||||
|
||||
#endif /* PAWNC_DLL */
|
||||
|
||||
|
||||
|
@ -258,6 +258,9 @@
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\amx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\sc.h">
|
||||
</File>
|
||||
|
@ -409,16 +409,18 @@ SC_FUNC stringlist *insert_dbgline(int linenr)
|
||||
char string[40];
|
||||
if (linenr>0)
|
||||
linenr--; /* line numbers are zero-based in the debug information */
|
||||
#if PAWN_CELL_SIZE==32
|
||||
sprintf(string,"L:%08lx %04x",(long)code_idx,linenr);
|
||||
#elif PAWN_CELL_SIZE==64
|
||||
sprintf(string,"L:%08Lx %04x",(long)code_idx,linenr);
|
||||
#endif
|
||||
return insert_string(&dbgstrings,string);
|
||||
} /* if */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#define LONGCAST long
|
||||
#else
|
||||
#define LONGCAST cell
|
||||
#endif
|
||||
|
||||
SC_FUNC stringlist *insert_dbgsymbol(symbol *sym)
|
||||
{
|
||||
if (sc_status==statWRITE && (sc_debug & sSYMBOLIC)!=0) {
|
||||
@ -440,10 +442,10 @@ SC_FUNC stringlist *insert_dbgsymbol(symbol *sym)
|
||||
symname,sym->codeaddr,code_idx,sym->ident,sym->vclass);
|
||||
#elif PAWN_CELL_SIZE==64
|
||||
if (sym->ident==iFUNCTN)
|
||||
sprintf(string,"S:%08Lx %x:%s %08Lx %08Lx %x %x",sym->addr,sym->tag,
|
||||
sprintf(string,"S:%08Lx %x:%s %08Lx %08Lx %x %x",(LONGCAST)sym->addr,sym->tag,
|
||||
symname,sym->addr,sym->codeaddr,sym->ident,sym->vclass);
|
||||
else
|
||||
sprintf(string,"S:%08Lx %x:%s %08Lx %08Lx %x %x",sym->addr,sym->tag,
|
||||
sprintf(string,"S:%08Lx %x:%s %08Lx %08Lx %x %x",(LONGCAST)sym->addr,sym->tag,
|
||||
symname,sym->codeaddr,code_idx,sym->ident,sym->vclass);
|
||||
#endif
|
||||
if (sym->ident==iARRAY || sym->ident==iREFARRAY) {
|
||||
|
Reference in New Issue
Block a user