From dcf39196d57c108affc5d79b81649808fb012e19 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 18 Sep 2005 01:14:44 +0000 Subject: [PATCH] Ugly hack to get around ELF garbage --- compiler/libpc300/Makefile | 2 +- compiler/libpc300/libpawnc.c | 4 ++++ compiler/libpc300/sc.h | 15 ++++++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/compiler/libpc300/Makefile b/compiler/libpc300/Makefile index b60fe7b0..3f307e9f 100755 --- a/compiler/libpc300/Makefile +++ b/compiler/libpc300/Makefile @@ -18,7 +18,7 @@ INCLUDE = -I. ifeq "$(PAWN64)" "true" BINARY = $(NAME)64.so BIN_DIR = Release64 - CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 + CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -Dpc_printf=pc_printf64 else BINARY = $(NAME)32.so BIN_DIR = Release32 diff --git a/compiler/libpc300/libpawnc.c b/compiler/libpc300/libpawnc.c index cc2110fb..92fa7c8b 100755 --- a/compiler/libpc300/libpawnc.c +++ b/compiler/libpc300/libpawnc.c @@ -65,12 +65,16 @@ * purpose messages; errors go through pc_error(). The function is modelled * after printf(). */ +#if PAWN_CELL_SIZE==32 #if defined __WIN32__ || defined _WIN32 || defined WIN32 __declspec (dllexport) int pc_printf(const char *message,...) #else extern int pc_printf(const char *message,...) #endif +#else +int pc_printf(const char *message, ...) +#endif { #if PAWN_CELL_SIZE==32 int ret; diff --git a/compiler/libpc300/sc.h b/compiler/libpc300/sc.h index 0c36990c..099c8cd6 100755 --- a/compiler/libpc300/sc.h +++ b/compiler/libpc300/sc.h @@ -63,6 +63,12 @@ #define PREPROC_TERM '\x7f'/* termination character for preprocessor expressions (the "DEL" code) */ #define sDEF_PREFIX "default.inc" /* default prefix filename */ +#if defined WIN32 +#define INVISIBLE +#else +#define INVISIBLE __attribute__((visibility("protected"))) +#endif + typedef union { void *pv; /* e.g. a name */ int i; @@ -435,12 +441,16 @@ int pc_enablewarning(int number,int enable); */ /* general console output */ +#if PAWN_CELL_SIZE==32 #if defined __WIN32__ || defined _WIN32 || defined WIN32 __declspec (dllexport) int pc_printf(const char *message,...); #else extern int pc_printf(const char *message,...); #endif +#else +int pc_printf(const char *message, ...) INVISIBLE; +#endif /* error report function */ 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); /* 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 void errorset(int code);