From: Eric Mullins Date: Mon, 12 Oct 2009 00:39:24 +0000 (-0600) Subject: Maintainence to support all compilers. X-Git-Tag: v4.4.1.20091019~26 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=7734c79f4d6e76e3d80f7ff42aea9e891102bc99 Maintainence to support all compilers. --- diff --git a/backend.c b/backend.c index a112d57..549fb9d 100644 --- a/backend.c +++ b/backend.c @@ -77,6 +77,7 @@ #if STDC_HEADERS # include # include +# include #else /* not STDC_HEADERS */ # if HAVE_STRING_H # include @@ -1423,12 +1424,14 @@ KeepAlive() /* added routine for printf style output to ics */ void ics_printf(char *format, ...) { - char buffer[MSG_SIZ], *args; - - args = (char *)&format + sizeof(format); - vsnprintf(buffer, sizeof(buffer), format, args); - buffer[sizeof(buffer)-1] = '\0'; - SendToICS(buffer); + char buffer[MSG_SIZ]; + va_list args; + + va_start(args, format); + vsnprintf(buffer, sizeof(buffer), format, args); + buffer[sizeof(buffer)-1] = '\0'; + SendToICS(buffer); + va_end(args); } void diff --git a/winboard/config.h b/winboard/config.h index f6542c4..5eeb793 100644 --- a/winboard/config.h +++ b/winboard/config.h @@ -154,5 +154,7 @@ #ifdef _MSC_VER #define snprintf _snprintf +#if _MSC_VER < 1500 #define vsnprintf _vsnprintf #endif +#endif diff --git a/winboard/wsettings.c b/winboard/wsettings.c index 2992165..fc0dc12 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -9,9 +9,9 @@ * that generates the actual dialog box from it. */ -//#include "config.h" #include "config.h" +#include #include #include #include "common.h"