From ef82a1e4d4ced0d74261abc6cef4fab17f6bff42 Mon Sep 17 00:00:00 2001 From: Alex Lian Date: Sat, 26 Jan 2013 18:42:56 -0500 Subject: [PATCH] For Windows MinGW address the "ISO C99 requires rest arguments to be used" error --- contrib/windows.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/windows.h b/contrib/windows.h index c54e5a5..c0d213f 100644 --- a/contrib/windows.h +++ b/contrib/windows.h @@ -30,7 +30,12 @@ # include # include "win32/err.h" # if defined (__MINGW32__) -# define snprintf(S, n, F, ...) sprintf(S, F, __VA_ARGS__) +/* + * Cheating here on the snprintf to incorporate the format argument + * into the VA_ARGS. Else we get MinGW errors regarding number of arguments + * if doing a fixed string with no arguments. +*/ +# define snprintf(S, n, ...) sprintf(S, __VA_ARGS__) # define pipe(fds) _pipe(fds, 5000, _O_BINARY) # define ETIMEDOUT WSAETIMEDOUT # define ENOTSUP WSAEOPNOTSUPP