Maintainence to support all compilers.
authorEric Mullins <emwine@earthlink.net>
Mon, 12 Oct 2009 00:39:24 +0000 (18:39 -0600)
committerEric Mullins <emwine@earthlink.net>
Mon, 12 Oct 2009 00:39:24 +0000 (18:39 -0600)
backend.c
winboard/config.h
winboard/wsettings.c

index a112d57..549fb9d 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -77,6 +77,7 @@
 #if STDC_HEADERS
 # include <stdlib.h>
 # include <string.h>
+# include <stdarg.h>
 #else /* not STDC_HEADERS */
 # if HAVE_STRING_H
 #  include <string.h>
@@ -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
index f6542c4..5eeb793 100644 (file)
 \r
 #ifdef _MSC_VER\r
 #define snprintf _snprintf\r
+#if _MSC_VER < 1500\r
 #define vsnprintf _vsnprintf\r
 #endif\r
+#endif\r
index 2992165..fc0dc12 100644 (file)
@@ -9,9 +9,9 @@
  * that generates the actual dialog box from it.\r
  */\r
 \r
-//#include "config.h"\r
 #include "config.h"\r
 \r
+#include <windows.h>\r
 #include <stdio.h>\r
 #include <string.h>\r
 #include "common.h"\r