From 7734c79f4d6e76e3d80f7ff42aea9e891102bc99 Mon Sep 17 00:00:00 2001 From: Eric Mullins Date: Sun, 11 Oct 2009 18:39:24 -0600 Subject: [PATCH] Maintainence to support all compilers. --- backend.c | 15 +++++++++------ winboard/config.h | 2 ++ winboard/wsettings.c | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) 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" -- 1.7.0.4