This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
savestring dcls conflict
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: savestring dcls conflict
- From: "Golubev I. N." <gin at mo dot msk dot ru>
- Date: Mon, 26 Jun 2000 13:27:44 (GMT)
Version: 5.0 with readline-4.1
I still do not think that gdb must be built only with its own
readline.
Definitions and behavior of savestring functions in readline and gdb
are different. <readline/readline.h> provides dcl of its own way and
provides a way to block away this dcl. I patch gdb to make use of
blocking away method and avoid conflicts of dcls with compilation
errors. If header does not contain dcl in question, no harm is done.
--- gdb/event-top.c 2000/06/19 13:07:57 1.1
+++ gdb/event-top.c 2000/06/19 13:13:26 1.2
@@ -32,7 +32,11 @@
#include "gdbcmd.h"
/* readline include files */
+/* so we can use vanilla `readline.h': block away `savestring' dcl we
+ do not want to use; we use our one instead */
+#define savestring
#include <readline/readline.h>
+#undef savestring
#include <readline/history.h>
#include <signal.h>
--- gdb/tracepoint.c 2000/06/19 13:16:17 1.1
+++ gdb/tracepoint.c 2000/06/19 13:19:48 1.2
@@ -36,7 +36,11 @@
#include "ax-gdb.h"
/* readline include files */
+/* so we can use vanilla `readline.h': block away `savestring' dcl we
+ do not want to use; we use our one instead */
+#define savestring
#include <readline/readline.h>
+#undef savestring
#include <readline/history.h>
/* readline defines this. */
--- gdb/top.c 2000/06/19 13:16:32 1.1
+++ gdb/top.c 2000/06/19 13:19:48 1.2
@@ -36,7 +36,11 @@
#include "version.h"
/* readline include files */
+/* so we can use vanilla `readline.h': block away `savestring' dcl we
+ do not want to use; we use our one instead */
+#define savestring
#include <readline/readline.h>
+#undef savestring
#include <readline/history.h>
/* readline defines this. */
--- gdb/utils.c 2000/06/19 13:16:33 1.1
+++ gdb/utils.c 2000/06/19 13:19:48 1.2
@@ -50,7 +50,11 @@
#include "language.h"
#include "annotate.h"
+/* so we can use vanilla `readline.h': block away `savestring' dcl we
+ do not want to use; we use our one instead */
+#define savestring
#include <readline/readline.h>
+#undef savestring
#undef XMALLOC
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))