summaryrefslogtreecommitdiffstats
path: root/innbbsd/bbslib.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-05 13:30:02 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-05 13:30:02 +0800
commit980df4d9684121dca6964247784ea7983f6ea4c4 (patch)
tree0c5fb0ec3002b8395d82de47a514bf314ab35e65 /innbbsd/bbslib.c
parent332d5e7882804269784b976f1cb468d69c21af37 (diff)
downloadpttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar
pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.gz
pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.bz2
pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.lz
pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.xz
pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.tar.zst
pttbbs-980df4d9684121dca6964247784ea7983f6ea4c4.zip
replace varvars.h by stdarg.h
(because gcc 3.3 no longer support varvars.h) git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@821 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/bbslib.c')
-rw-r--r--innbbsd/bbslib.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/innbbsd/bbslib.c b/innbbsd/bbslib.c
index 0dc808c3..c0177e87 100644
--- a/innbbsd/bbslib.c
+++ b/innbbsd/bbslib.c
@@ -1,9 +1,9 @@
#if defined( LINUX )
# include "innbbsconf.h"
# include "bbslib.h"
-# include <varargs.h>
+# include <stdarg.h>
#else
-# include <varargs.h>
+# include <stdarg.h>
# include "innbbsconf.h"
# include "bbslib.h"
#endif
@@ -76,17 +76,15 @@ setverboseoff()
}
}
-verboselog(va_alist)
-va_dcl
+verboselog(char *fmt, ...)
{
va_list ap;
- register char* fmt;
char datebuf[40];
time_t now;
if (verboseFlag == 0) return;
- va_start(ap);
+ va_start(ap, fmt);
time(&now);
strftime(datebuf, sizeof(datebuf), "%b %d %X ", localtime(&now));
@@ -97,8 +95,10 @@ va_dcl
else
bbslogfp = fdopen(1, "a");
}
- if (bbslogfp == NULL) { va_end(ap); return; }
- fmt = va_arg(ap, char *) ;
+ if (bbslogfp == NULL) {
+ va_end(ap);
+ return;
+ }
fprintf(bbslogfp,"%s[%d] ",datebuf, getpid());
vfprintf(bbslogfp, fmt, ap);
fflush(bbslogfp);
@@ -106,18 +106,16 @@ va_dcl
}
#ifdef PalmBBS
-xbbslog(va_alist)
+xbbslog(char *fmt, ...)
#else
-bbslog(va_alist)
+bbslog(char *fmt, ...)
#endif
-va_dcl
{
va_list ap;
- register char* fmt;
char datebuf[40];
time_t now;
- va_start(ap);
+ va_start(ap, fmt);
time(&now);
strftime(datebuf, sizeof(datebuf), "%b %d %X ", localtime(&now));
@@ -125,8 +123,10 @@ va_dcl
if (bbslogfp == NULL) {
bbslogfp = fopen(LOGFILE, "a");
}
- if (bbslogfp == NULL) { va_end(ap); return; }
- fmt = va_arg(ap, char *) ;
+ if (bbslogfp == NULL) {
+ va_end(ap);
+ return;
+ }
fprintf(bbslogfp,"%s[%d] ",datebuf,getpid());
vfprintf(bbslogfp, fmt, ap);
fflush(bbslogfp);