Ugly hack to get around ELF garbage

This commit is contained in:
David Anderson 2005-09-18 01:14:44 +00:00
parent 58dd553d00
commit dcf39196d5
3 changed files with 15 additions and 6 deletions

View File

@ -18,7 +18,7 @@ INCLUDE = -I.
ifeq "$(PAWN64)" "true" ifeq "$(PAWN64)" "true"
BINARY = $(NAME)64.so BINARY = $(NAME)64.so
BIN_DIR = Release64 BIN_DIR = Release64
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -Dpc_printf=pc_printf64
else else
BINARY = $(NAME)32.so BINARY = $(NAME)32.so
BIN_DIR = Release32 BIN_DIR = Release32

View File

@ -65,12 +65,16 @@
* purpose messages; errors go through pc_error(). The function is modelled * purpose messages; errors go through pc_error(). The function is modelled
* after printf(). * after printf().
*/ */
#if PAWN_CELL_SIZE==32
#if defined __WIN32__ || defined _WIN32 || defined WIN32 #if defined __WIN32__ || defined _WIN32 || defined WIN32
__declspec (dllexport) __declspec (dllexport)
int pc_printf(const char *message,...) int pc_printf(const char *message,...)
#else #else
extern int pc_printf(const char *message,...) extern int pc_printf(const char *message,...)
#endif #endif
#else
int pc_printf(const char *message, ...)
#endif
{ {
#if PAWN_CELL_SIZE==32 #if PAWN_CELL_SIZE==32
int ret; int ret;

View File

@ -63,6 +63,12 @@
#define PREPROC_TERM '\x7f'/* termination character for preprocessor expressions (the "DEL" code) */ #define PREPROC_TERM '\x7f'/* termination character for preprocessor expressions (the "DEL" code) */
#define sDEF_PREFIX "default.inc" /* default prefix filename */ #define sDEF_PREFIX "default.inc" /* default prefix filename */
#if defined WIN32
#define INVISIBLE
#else
#define INVISIBLE __attribute__((visibility("protected")))
#endif
typedef union { typedef union {
void *pv; /* e.g. a name */ void *pv; /* e.g. a name */
int i; int i;
@ -435,12 +441,16 @@ int pc_enablewarning(int number,int enable);
*/ */
/* general console output */ /* general console output */
#if PAWN_CELL_SIZE==32
#if defined __WIN32__ || defined _WIN32 || defined WIN32 #if defined __WIN32__ || defined _WIN32 || defined WIN32
__declspec (dllexport) __declspec (dllexport)
int pc_printf(const char *message,...); int pc_printf(const char *message,...);
#else #else
extern int pc_printf(const char *message,...); extern int pc_printf(const char *message,...);
#endif #endif
#else
int pc_printf(const char *message, ...) INVISIBLE;
#endif
/* error report function */ /* error report function */
int pc_error(int number,char *message,char *filename,int firstline,int lastline,va_list argptr); int pc_error(int number,char *message,char *filename,int firstline,int lastline,va_list argptr);
@ -629,11 +639,6 @@ 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 */
#if defined WIN32
#define INVISIBLE
#else
#define INVISIBLE __attribute__((visibility("protected")))
#endif
SC_FUNC int error(int number,...) INVISIBLE; SC_FUNC int error(int number,...) INVISIBLE;
SC_FUNC void errorset(int code); SC_FUNC void errorset(int code);