This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][GOLD] Fix build breakage on OSX due to unintended macro substitution.
- From: Ian Lance Taylor <iant at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Sun, 10 Jan 2010 22:49:52 -0800
- Subject: Re: [PATCH][GOLD] Fix build breakage on OSX due to unintended macro substitution.
- References: <498552561001102113y7c9dfe66r87c28e2bbfdff6f0@mail.gmail.com>
"Doug Kwan (éæå)" <dougkwan@google.com> writes:
> +// This is defined to avoid unintended macro substitutions in DEFINE_var below.
> +// On Mac OSX, assert.h is included transitively by some other library headers
> +// we use. We need to use EMPTY_PARAMETER_LIST to avoid assert() being
> +// substituted as a macro when the "assert" command line option is defined.
> +// Note that this only deals with function-like macros.
> +
> +#define EMPTY_PARAMETER_LIST ()
>
> // These are helper macros use by DEFINE_uint64/etc below.
> // This macro is used inside the General_options_ class, so defines
> @@ -249,7 +256,7 @@ struct Struct_special : public Struct_va
> optional_arg__, type__, param_type__, parse_fn__) \
> public: \
> param_type__ \
> - varname__() const \
> + varname__ EMPTY_PARAMETER_LIST const \
Does it work to write
(varname__)() const
? If it does, please do that instead, with a short comment. Thanks.
Ian