From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13943 invoked by alias); 17 Oct 2013 15:46:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13933 invoked by uid 89); 17 Oct 2013 15:46:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Oct 2013 15:46:17 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9HFkF0H000977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 17 Oct 2013 11:46:16 -0400 Received: from barimba.redhat.com (ovpn-113-54.phx2.redhat.com [10.3.113.54]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9HFkEab023640; Thu, 17 Oct 2013 11:46:15 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC] undef reg in gdb_curses.h Date: Thu, 17 Oct 2013 15:46:00 -0000 Message-Id: <1382024768-24151-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-10/txt/msg00519.txt.bz2 I tried to build gdb on the AIX machine in the GCC compile farm (gcc111), but it failed in a couple of spots because gdb uses "reg" as a variable name and the AIX defines "reg" to "register". I saw that we already had a workaround for this lurking in utils.c, so I just moved that to gdb_curses.h. This fixed the problem on AIX and still builds on x86-64 Fedora 18. Let me know what you think. I suppose in the absence of comments I will put this in. * utils.c (reg): Move undefinition... * gdb_curses.h: ... here. Update comment to mention AIX. --- gdb/gdb_curses.h | 8 ++++++++ gdb/utils.c | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/gdb_curses.h b/gdb/gdb_curses.h index 37b2d5b..92c6db1 100644 --- a/gdb/gdb_curses.h +++ b/gdb/gdb_curses.h @@ -54,4 +54,12 @@ extern int tgetnum (const char *); #endif +/* SunOS's curses.h has a '#define reg register' in it. Thank you Sun. */ +/* Ditto for: + -bash-4.2$ uname -a + AIX power-aix 1 7 00F84C0C4C00 */ +#ifdef reg +#undef reg +#endif + #endif /* gdb_curses.h */ diff --git a/gdb/utils.c b/gdb/utils.c index 47f9dfe..1986758 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -40,11 +40,6 @@ #include #endif -/* SunOS's curses.h has a '#define reg register' in it. Thank you Sun. */ -#ifdef reg -#undef reg -#endif - #include #include "timeval-utils.h" #include "gdbcmd.h" -- 1.8.1.4