From aee17e424f491173bb377b97c397bca1604bf5b8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 16 Oct 2013 12:25:27 -0600 Subject: [PATCH] undef reg in gdb_curses.h 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. 2013-10-29 Tom Tromey * utils.c (reg): Move undefinition... * gdb_curses.h: ... here. Update comment to mention AIX. --- gdb/ChangeLog | 5 +++++ gdb/gdb_curses.h | 8 ++++++++ gdb/utils.c | 5 ----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 23a21626650..daceab8fde0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-10-29 Tom Tromey + + * utils.c (reg): Move undefinition... + * gdb_curses.h: ... here. Update comment to mention AIX. + 2013-10-29 Nicolas Blanc * exec.h (add_target_sections_of_objfile): New declaration. diff --git a/gdb/gdb_curses.h b/gdb/gdb_curses.h index 37b2d5b8c49..92c6db169d0 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 47f9dfe3219..198675827a2 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" -- 2.30.2