changeset 1688:034a2ddf5b6b

[xemacs-hg @ 2003-09-16 03:57:54 by james] Fix C++ build of dump-id.c, and remove dumper.h/lrecord.h duplication.
author james
date Tue, 16 Sep 2003 03:57:59 +0000
parents a4b5e2effaff
children 1193b7458e43
files lib-src/ChangeLog lib-src/make-dump-id.c src/ChangeLog src/depend src/dumper.h src/lrecord.h
diffstat 6 files changed, 30 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Mon Sep 15 22:04:10 2003 +0000
+++ b/lib-src/ChangeLog	Tue Sep 16 03:57:59 2003 +0000
@@ -1,3 +1,8 @@
+2003-09-15  Jerry James  <james@xemacs.org>
+
+	* make-dump-id.c (main): Output separate declaration and
+	definition for dump_id.
+
 2003-09-03  Steve Youngs  <youngs@xemacs.org>
 
 	* XEmacs 21.5.15 "celery" is released.
--- a/lib-src/make-dump-id.c	Mon Sep 15 22:04:10 2003 +0000
+++ b/lib-src/make-dump-id.c	Tue Sep 16 03:57:59 2003 +0000
@@ -64,10 +64,12 @@
       return EXIT_FAILURE;
     }
 
-  /* dump_id is declared as extern "C" in lrecord.h */
-  fprintf (f, "#if defined (__cplusplus)\n");
-  fprintf (f, "extern \"C\"\n");
-  fprintf (f, "#endif /* __cplusplus */\n");
+  /* dump_id is declared as extern "C" in dumper.h */
+  fputs ("extern\n", f);
+  fputs ("#ifdef __cplusplus\n", f);
+  fputs ("\"C\"\n", f);
+  fputs ("#endif\n", f);
+  fputs ("unsigned int dump_id;\n", f);
   fprintf (f, "unsigned int dump_id = %uU;\n", generate_dump_id ());
 
   if ((fclose (f)) != 0)
--- a/src/ChangeLog	Mon Sep 15 22:04:10 2003 +0000
+++ b/src/ChangeLog	Tue Sep 16 03:57:59 2003 +0000
@@ -1,3 +1,10 @@
+2003-09-15  Jerry James  <james@xemacs.org>
+
+	* depend: Regenerate.
+	* dumper.h: Use extern "C" for C++ builds.
+	* lrecord.h: Remove duplicated material from dumper.h and include
+	that instead.
+
 2003-09-15  Jerry James  <james@xemacs.org>
 
 	* event-msw.c (debug_mswin_messages): Conditionally compile
--- a/src/depend	Mon Sep 15 22:04:10 2003 +0000
+++ b/src/depend	Tue Sep 16 03:57:59 2003 +0000
@@ -11,7 +11,7 @@
 LISP_H=
 #else
 CONFIG_H=config.h
-LISP_H=lisp.h config.h general-slots.h lrecord.h symeval.h symsinit.h text.h $(LISP_UNION_H)
+LISP_H=lisp.h config.h dumper.h general-slots.h lrecord.h symeval.h symsinit.h text.h $(LISP_UNION_H)
 #endif
 
 #if defined(HAVE_MS_WINDOWS)
--- a/src/dumper.h	Mon Sep 15 22:04:10 2003 +0000
+++ b/src/dumper.h	Tue Sep 16 03:57:59 2003 +0000
@@ -23,9 +23,19 @@
 #ifndef INCLUDED_dumper_h
 #define INCLUDED_dumper_h
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void pdump_objects_unmark (void);
 void pdump (void);
 int pdump_load (const char *argv0);
+void pdump_backtrace (void);
 extern unsigned int dump_id;
+extern char *pdump_start, *pdump_end;
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* INCLUDED_dumper_h */
--- a/src/lrecord.h	Mon Sep 15 22:04:10 2003 +0000
+++ b/src/lrecord.h	Tue Sep 16 03:57:59 2003 +0000
@@ -1510,14 +1510,7 @@
 extern MODULE_API int initialized;
 
 #ifdef PDUMP
-
-void pdump_objects_unmark (void);
-void pdump (void);
-int pdump_load (const char *argv0);
-void pdump_backtrace (void);
-extern unsigned int dump_id;
-extern char *pdump_start, *pdump_end;
-
+#include "dumper.h"
 #define DUMPEDP(adr) ((((char *) (adr)) < pdump_end) && \
                       (((char *) (adr)) >= pdump_start))
 #else