Changes for linux compatibility

This commit is contained in:
David Anderson 2005-08-02 19:05:51 +00:00
parent d472d5d309
commit 96c9fc8bc8
4 changed files with 14 additions and 5 deletions

View File

@ -99,6 +99,7 @@ int main(int argc, char **argv)
fclose(fp); fclose(fp);
} }
dlclose(lib);
unlink(file); unlink(file);
HINSTANCE lib64 = 0; HINSTANCE lib64 = 0;
@ -107,7 +108,8 @@ int main(int argc, char **argv)
#else #else
lib64 = dlmount("amxxpc64.dll"); lib64 = dlmount("amxxpc64.dll");
#endif #endif
if (!lib64) pc_printf = (PRINTF)dlsym(lib64, "pc_printf");
if (!lib64 || !pc_printf)
{ {
pc_printf("64bit compiler failed to instantiate.\n"); pc_printf("64bit compiler failed to instantiate.\n");
exit(0); exit(0);
@ -127,8 +129,6 @@ int main(int argc, char **argv)
sc64(argc, argv); sc64(argc, argv);
dlclose(lib64);
if (file == NULL) if (file == NULL)
{ {
pc_printf("Could not locate the output file on second pass.\n"); pc_printf("Could not locate the output file on second pass.\n");
@ -207,7 +207,7 @@ int main(int argc, char **argv)
pc_printf("Done.\n"); pc_printf("Done.\n");
dlclose(lib); dlclose(lib64);
exit(0); exit(0);
} }

View File

@ -42,6 +42,9 @@ all:
pawn_make: $(OBJ_LINUX) pawn_make: $(OBJ_LINUX)
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY) $(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
pawn64:
$(MAKE) pawn_make PAWN64=true
debug: debug:
$(MAKE) all DEBUG=true $(MAKE) all DEBUG=true

View File

@ -629,7 +629,11 @@ SC_FUNC void jmp_eq0(int number);
SC_FUNC void outval(cell val,int newline); SC_FUNC void outval(cell val,int newline);
/* function prototypes in SC5.C */ /* function prototypes in SC5.C */
SC_FUNC int error(int number,...); #ifdef __linux__
SC_FUNC int error(int number,...) __attribute__((visibility("internal")));
#else
SC_FUNC int error(int number,...)
#endif
SC_FUNC void errorset(int code); SC_FUNC void errorset(int code);
/* function prototypes in SC6.C */ /* function prototypes in SC6.C */

View File

@ -654,6 +654,7 @@ cleanup:
int flag_exceed=0; int flag_exceed=0;
if (sc_amxlimit > 0 && (long)(hdrsize+code_idx+glb_declared*sizeof(cell)+sc_stksize*sizeof(cell)) >= sc_amxlimit) if (sc_amxlimit > 0 && (long)(hdrsize+code_idx+glb_declared*sizeof(cell)+sc_stksize*sizeof(cell)) >= sc_amxlimit)
flag_exceed=1; flag_exceed=1;
#if PAWN_CELL_SIZE==32
if ((sc_debug & sSYMBOLIC)!=0 || verbosity>=2 || stacksize+32>=(long)sc_stksize || flag_exceed) { if ((sc_debug & sSYMBOLIC)!=0 || verbosity>=2 || stacksize+32>=(long)sc_stksize || flag_exceed) {
pc_printf("Header size: %8ld bytes\n", (long)hdrsize); pc_printf("Header size: %8ld bytes\n", (long)hdrsize);
pc_printf("Code size: %8ld bytes\n", (long)code_idx); pc_printf("Code size: %8ld bytes\n", (long)code_idx);
@ -665,6 +666,7 @@ cleanup:
pc_printf("estimated max. usage=%ld cells (%ld bytes)\n",stacksize,stacksize*sizeof(cell)); pc_printf("estimated max. usage=%ld cells (%ld bytes)\n",stacksize,stacksize*sizeof(cell));
pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)sc_stksize*sizeof(cell)); pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)sc_stksize*sizeof(cell));
} /* if */ } /* if */
#endif
if (flag_exceed) if (flag_exceed)
error(106,sc_amxlimit); /* this causes a jump back to label "cleanup" */ error(106,sc_amxlimit); /* this causes a jump back to label "cleanup" */
} /* if */ } /* if */