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

Nick Mathewson nickm at alum.mit.edu
Wed Jul 15 18:46:11 UTC 2015


On Tue, May 19, 2015 at 3:20 PM, Gisle Vanem <gvanem at yahoo.no> wrote:
> 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
>

I just applied something like this to master, and made corresponding
changes to torlog.h as well.

I made the changes conditional on not having GCC, since the GCC syntax
will work with older versions of GCC.  (Somebody should check whether
we care about those versions.)

Thanks!

-- 
Nick


More information about the tor-dev mailing list