Added pc_printf to exports

This commit is contained in:
David Anderson 2005-07-30 00:35:47 +00:00
parent df982ceb79
commit 51d54a96ff
2 changed files with 13 additions and 4 deletions

View File

@ -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;
}

View File

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