This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] 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 <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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]