[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-dev] [Patch] or/config.c for MSVC



This gcc-centric macro in or/config.c doesn't work well in
MSVC v16/18:

#define COMPLAIN(args...) \
  STMT_BEGIN log_warn(LD_CONFIG, args); STMT_END

I suggest it should be patched like this:

--- a/config.c       2015-05-06 22:22:09 +0000
+++ b/config.c 2015-05-06 23:15:57 +0000
@@ -2571,8 +2571,8 @@

 #define REJECT(arg) \
   STMT_BEGIN *msg = tor_strdup(arg); return -1; STMT_END
-#define COMPLAIN(args...) \
-  STMT_BEGIN log_warn(LD_CONFIG, args); STMT_END
+#define COMPLAIN(args, ...) \
+  STMT_BEGIN log_warn(LD_CONFIG, args, ## __VA_ARGS__); STMT_END

 /** Log a warning message iff <b>filepath</b> is not absolute.
  * Warning message must contain option name <b>option</b> and

-------

All recent compilers supports '__VA_ARGS__'?

--
--gv
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev