Patchwork ia64-dis.c: Undefine ABS to avoid clash with glib

login
register
mail settings
Submitter Peter Maydell
Date Oct. 29, 2011, 11:58 a.m.
Message ID <1319889506-20487-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/122535/
State New
Headers show

Comments

Peter Maydell - Oct. 29, 2011, 11:58 a.m.
Undefine ABS to avoid a clash with the macro that glib.h
helpfully defines for us (and a resulting build failure
on ia64 hosts).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Bit of a namespace grab by glib.h if you ask me. Undefining
ABS seems the most straightforward fix.

 ia64-dis.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Anthony Liguori - Nov. 1, 2011, 6:04 p.m.
On 10/29/2011 06:58 AM, Peter Maydell wrote:
> Undefine ABS to avoid a clash with the macro that glib.h
> helpfully defines for us (and a resulting build failure
> on ia64 hosts).
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
> Bit of a namespace grab by glib.h if you ask me. Undefining
> ABS seems the most straightforward fix.
>
>   ia64-dis.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/ia64-dis.c b/ia64-dis.c
> index 2886df3..2a103e6 100644
> --- a/ia64-dis.c
> +++ b/ia64-dis.c
> @@ -781,6 +781,9 @@ ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
>     return 0;
>   }
>
> +/* glib.h defines ABS so we must undefine it to avoid a clash */
> +#undef ABS
> +
>   #define CST	IA64_OPND_CLASS_CST
>   #define REG	IA64_OPND_CLASS_REG
>   #define IND	IA64_OPND_CLASS_IND

Patch

diff --git a/ia64-dis.c b/ia64-dis.c
index 2886df3..2a103e6 100644
--- a/ia64-dis.c
+++ b/ia64-dis.c
@@ -781,6 +781,9 @@  ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
   return 0;
 }
 
+/* glib.h defines ABS so we must undefine it to avoid a clash */
+#undef ABS
+
 #define CST	IA64_OPND_CLASS_CST
 #define REG	IA64_OPND_CLASS_REG
 #define IND	IA64_OPND_CLASS_IND