Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] undef reg in gdb_curses.h
@ 2013-10-17 15:46 Tom Tromey
  2013-10-17 16:58 ` Pedro Alves
  2013-10-29 16:41 ` Tom Tromey
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2013-10-17 15:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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 <curses.h> 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 <pc.h>
 #endif
 
-/* SunOS's curses.h has a '#define reg register' in it.  Thank you Sun.  */
-#ifdef reg
-#undef reg
-#endif
-
 #include <signal.h>
 #include "timeval-utils.h"
 #include "gdbcmd.h"
-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-29 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-17 15:46 [RFC] undef reg in gdb_curses.h Tom Tromey
2013-10-17 16:58 ` Pedro Alves
2013-10-29 16:41 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox