From 51d54a96ff0ffa187ccb95b855d3e7e0f0c7d87d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 30 Jul 2005 00:35:47 +0000 Subject: [PATCH] Added pc_printf to exports --- compiler/libpc300/libpawnc.c | 12 ++++++++---- compiler/libpc300/sc.h | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/compiler/libpc300/libpawnc.c b/compiler/libpc300/libpawnc.c index 3f087a20..cc2110fb 100755 --- a/compiler/libpc300/libpawnc.c +++ b/compiler/libpc300/libpawnc.c @@ -65,7 +65,12 @@ * purpose messages; errors go through pc_error(). The function is modelled * after printf(). */ +#if defined __WIN32__ || defined _WIN32 || defined WIN32 + __declspec (dllexport) int pc_printf(const char *message,...) +#else +extern int pc_printf(const char *message,...) +#endif { #if PAWN_CELL_SIZE==32 int ret; @@ -105,12 +110,11 @@ static char *prefix[3]={ "error", "fatal error", "warning" }; pre=prefix[number/100]; if (firstline>=0) - fprintf(stderr,"%s(%d -- %d) : %s %03d: ",filename,firstline,lastline,pre,number); + pc_printf("%s(%d -- %d) : %s %03d: ",filename,firstline,lastline,pre,number); else - fprintf(stderr,"%s(%d) : %s %03d: ",filename,lastline,pre,number); + pc_printf("%s(%d) : %s %03d: ",filename,lastline,pre,number); } /* if */ - vfprintf(stderr,message,argptr); - fflush(stderr); + vprintf(message,argptr); #endif return 0; } diff --git a/compiler/libpc300/sc.h b/compiler/libpc300/sc.h index 325eb0bc..7051de4a 100755 --- a/compiler/libpc300/sc.h +++ b/compiler/libpc300/sc.h @@ -435,7 +435,12 @@ int pc_enablewarning(int number,int enable); */ /* general console output */ +#if defined __WIN32__ || defined _WIN32 || defined WIN32 + __declspec (dllexport) int pc_printf(const char *message,...); +#else +extern int pc_printf(const char *message,...); +#endif /* error report function */ int pc_error(int number,char *message,char *filename,int firstline,int lastline,va_list argptr);