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);