freebsd-ports/databases/msql/files/patch-bc
Pav Lucistnik 27571ccca6 - Fix build on gcc 3.3
PR:		ports/66250
Submitted by:	Andrey Slusar <vasallia@ukr.net>
2004-05-04 20:48:38 +00:00

68 lines
1.3 KiB
Plaintext

--- src/msql/libmsql.c.bak Wed Aug 22 04:17:08 2001
+++ src/msql/libmsql.c Thu Sep 11 11:02:19 2003
@@ -31,6 +31,7 @@
# include <stdlib.h>
# include <string.h>
+#define ANSI_ARGS
#if defined(_OS_WIN32)
# include <winsock.h>
@@ -88,11 +88,11 @@
RETSIGTYPE pipeHandler(int);
#endif
-#if defined(_OS_OS2) || defined (_OS_WIN32)
-static void msqlDebug( int module, ... );
+#if defined(_OS_OS2) || defined (_OS_WIN32) || defined(ANSI_ARGS)
+static void msqlDebug( int module, char *fmt, ... );
#endif
-#if defined(_OS_UNIX)
+#if defined(_OS_UNIX) && !defined(ANSI_ARGS)
static void msqlDebug();
#endif
@@ -216,23 +216,24 @@
*/
#ifdef ANSI_ARGS
-static void msqlDebug(int module, ...)
+static void msqlDebug(int module, char *fmt, ...)
#else
static void msqlDebug(va_alist)
va_dcl
#endif
{
va_list args;
- char msg[1024],
- *fmt;
+ char msg[1024];
#ifdef ANSI_ARGS
- va_start(args, module);
+ va_start(args, fmt);
#else
int module;
+ char *fmt;
va_start(args);
module = (int) va_arg(args, int );
+ fmt = (char *)va_arg(args, char *);
#endif
if (! (module & debugLevel))
@@ -241,9 +242,10 @@
return;
}
- fmt = (char *)va_arg(args, char *);
- if (!fmt)
+ if (!fmt) {
+ va_end(args);
return;
+ }
(void)vsprintf(msg,fmt,args);
va_end(args);
fprintf(stderr,"[libmsql] %s",msg);