]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Change variadic macros to C99 style.
authorMatthias Andree <matthias.andree@gmx.de>
Sat, 4 Dec 2010 02:51:11 +0000 (03:51 +0100)
committerDavid Sommerseth <dazo@users.sourceforge.net>
Sat, 4 Dec 2010 11:24:44 +0000 (12:24 +0100)
The macros used GCC's pre-C99 syntax, which could not be compiled with
Microsoft Visual Studio 2008.

Note this breaks compatibility with GCC versions before 3.0, which is
deemed safe in a discussion on IRC with David Sommerseth and Samuli
Seppänen on #openvpn-devel (RHEL 3 uses GCC 3.2 already).

Compiled tested on VS2008 by Samuli, on Cygwin GCC 3.4 and GCC 4.3 by myself.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Acked-by: David Sommerseth <dazo@users.sourceforge.net>
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
(cherry picked from commit 9469168e3abb09bd78297208a917ee4d9c025041)

service-win32/openvpnserv.c

index 6c9ff1ec45c98f856ace996cb93890db1f43af36..07374e2e87033004f217a90868188a5301bd4f8e 100755 (executable)
@@ -84,9 +84,9 @@ static HANDLE exit_event = NULL;
 #define CLEAR(x) memset(&(x), 0, sizeof(x))
 
 /* snprintf with guaranteed null termination */
-#define mysnprintf(out, args...) \
+#define mysnprintf(out, ...) \
         { \
-           snprintf (out, sizeof(out), args); \
+           snprintf (out, sizeof(out), __VA_ARGS__); \
            out [sizeof (out) - 1] = '\0'; \
         }
 
@@ -98,10 +98,10 @@ static HANDLE exit_event = NULL;
 #define M_ERR     (MSG_FLAGS_ERROR)                    // error
 
 /* write error to event log */
-#define MSG(flags, args...) \
+#define MSG(flags, ...) \
         { \
            char x_msg[256]; \
-           mysnprintf (x_msg, args); \
+           mysnprintf (x_msg, __VA_ARGS__); \
            AddToMessageLog ((flags), x_msg); \
         }