From ce701a3393e8f02410dc0d076d5ddf57ef324260 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 16 Mar 2011 16:59:54 -0700 Subject: [PATCH] New file unexec.h, the (simple) interface for unexec. * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o): (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o): Depend on unexec.h. * emacs.c [!defined CANNOT_DUMP]: Include unexec.h. * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c: * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h. --- src/ChangeLog | 8 ++++++++ src/deps.mk | 18 +++++++++--------- src/emacs.c | 4 +--- src/unexaix.c | 2 ++ src/unexcoff.c | 2 ++ src/unexcw.c | 3 ++- src/unexelf.c | 2 ++ src/unexhp9k800.c | 3 ++- src/unexmacosx.c | 3 +++ src/unexsol.c | 2 ++ src/unexw32.c | 1 + 11 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7bc0a8fcc4..14d3e37a8e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2011-03-16 Paul Eggert + New file unexec.h, the (simple) interface for unexec. + * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o): + (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o): + Depend on unexec.h. + * emacs.c [!defined CANNOT_DUMP]: Include unexec.h. + * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c: + * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h. + * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid shadowing. (back_comment, skip_chars): Mark vars as initialized. diff --git a/src/deps.mk b/src/deps.mk index 80a5721cf3..c868ff0e3c 100644 --- a/src/deps.mk +++ b/src/deps.mk @@ -93,7 +93,7 @@ editfns.o: editfns.c window.h buffer.h systime.h $(INTERVALS_H) character.h \ emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \ termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \ globals.h ../lib/unistd.h window.h dispextern.h keyboard.h keymap.h \ - frame.h coding.h gnutls.h msdos.h + frame.h coding.h gnutls.h msdos.h unexec.h fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \ coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h \ commands.h globals.h ../lib/unistd.h @@ -200,15 +200,15 @@ terminfo.o: terminfo.c lisp.h globals.h $(config_h) tparam.o: tparam.c tparam.h lisp.h $(config_h) undo.o: undo.c buffer.h commands.h window.h dispextern.h msdos.h \ lisp.h globals.h $(config_h) -unexaix.o: unexaix.c lisp.h $(config_h) +unexaix.o: unexaix.c lisp.h unexec.h $(config_h) unexalpha.o: unexalpha.c $(config_h) -unexcw.o: unexcw.c lisp.h $(config_h) -unexcoff.o: unexcoff.c lisp.h $(config_h) -unexelf.o: unexelf.c ../lib/unistd.h $(config_h) -unexhp9k800.o: unexhp9k800.c $(config_h) -unexmacosx.o: unexmacosx.c $(config_h) -unexsol.o: unexsol.c lisp.h $(config_h) -unexw32.o: unexw32.c $(config_h) +unexcw.o: unexcw.c lisp.h unexec.h $(config_h) +unexcoff.o: unexcoff.c lisp.h unexec.h $(config_h) +unexelf.o: unexelf.c unexec.h ../lib/unistd.h $(config_h) +unexhp9k800.o: unexhp9k800.c unexec.h $(config_h) +unexmacosx.o: unexmacosx.c unexec.h $(config_h) +unexsol.o: unexsol.c lisp.h unexec.h $(config_h) +unexw32.o: unexw32.c unexec.h $(config_h) w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \ msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h) widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \ diff --git a/src/emacs.c b/src/emacs.c index c49e38f7a6..d30d42f1ee 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2085,9 +2085,7 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff) #ifndef CANNOT_DUMP -/* FIXME: maybe this should go into header file, config.h seems the - only one appropriate. */ -extern int unexec (const char *, const char *); +#include "unexec.h" DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0, doc: /* Dump current state of Emacs into executable file FILENAME. diff --git a/src/unexaix.c b/src/unexaix.c index fe9d13d3e4..612d7c1fec 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -40,6 +40,8 @@ what you give them. Help stamp out software-hoarding! */ */ #include +#include "unexec.h" + #define PERROR(file) report_error (file, new) #include /* Define getpagesize () if the system does not. diff --git a/src/unexcoff.c b/src/unexcoff.c index 4dafabab68..1efde1a9cb 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c @@ -50,6 +50,8 @@ along with GNU Emacs. If not, see . */ */ #include +#include "unexec.h" + #define PERROR(file) report_error (file, new) #ifndef CANNOT_DUMP /* all rest of file! */ diff --git a/src/unexcw.c b/src/unexcw.c index 02add901bb..b5d72e6155 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include +#include "unexec.h" + #include #include #include @@ -299,4 +301,3 @@ unexec (const char *outfile, const char *infile) return (0); } - diff --git a/src/unexelf.c b/src/unexelf.c index 1009c87066..182b9f8a16 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -386,6 +386,8 @@ temacs: Instead we read the whole file, modify it, and write it out. */ #include +#include + extern void fatal (const char *msgid, ...); #include diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c index c0471992a7..9889ffd63f 100644 --- a/src/unexhp9k800.c +++ b/src/unexhp9k800.c @@ -50,6 +50,8 @@ */ #include +#include "unexec.h" + #include #include #include @@ -319,4 +321,3 @@ display_header (hdr, auxhdr) hdr->unloadable_sp_location, hdr->unloadable_sp_size); } #endif /* DEBUG */ - diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 2e46c063e9..0df0bb8451 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -95,6 +95,9 @@ along with GNU Emacs. If not, see . */ #undef malloc #undef realloc #undef free + +#include "unexec.h" + #include #include #include diff --git a/src/unexsol.c b/src/unexsol.c index e1a10f7d21..ae91c17085 100644 --- a/src/unexsol.c +++ b/src/unexsol.c @@ -1,6 +1,8 @@ /* Trivial unexec for Solaris. */ #include +#include "unexec.h" + #include #include diff --git a/src/unexw32.c b/src/unexw32.c index 829c864c96..c921cd657d 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -21,6 +21,7 @@ along with GNU Emacs. If not, see . */ */ #include +#include "unexec.h" #include #include -- 2.20.1