Remove support for DJGPP v1.x (bug#5813).
[bpt/emacs.git] / src / unexec.c
index e3381d6..6cb27b3 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+                 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -131,11 +131,9 @@ initialize nonstandard fields in the file header
 #ifdef HAVE_COFF_H
 #include <coff.h>
 #ifdef MSDOS
-#if __DJGPP__ > 1
 #include <fcntl.h>  /* for O_RDONLY, O_RDWR */
 #include <crt0.h>   /* for _crt0_startup_flags and its bits */
 static int save_djgpp_startup_flags;
-#endif /* __DJGPP__ > 1 */
 #define filehdr external_filehdr
 #define scnhdr external_scnhdr
 #define syment external_syment
@@ -204,6 +202,7 @@ static int pagemask;
 
 #ifdef emacs
 
+#include <setjmp.h>
 #include "lisp.h"
 
 static
@@ -309,7 +308,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
   if (a_out >= 0)
     {
 #ifdef MSDOS
-#if __DJGPP__ > 1
       /* Support the coff-go32-exe format with a prepended stub, since
         this is what GCC 2.8.0 and later generates by default in DJGPP.  */
       unsigned short mz_header[3];
@@ -327,7 +325,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
        }
       else
        lseek (a_out, 0L, 0);
-#endif /* __DJGPP__ > 1 */
 #endif /* MSDOS */
       if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr))
        {
@@ -498,7 +495,7 @@ write_segment (new, ptr, end)
          )
        {
          /* Write only a page of zeros at once,
-            so that we we don't overshoot the start
+            so that we don't overshoot the start
             of the valid memory in the old data segment.  */
          if (nwrite > pagesize)
            nwrite = pagesize;
@@ -531,7 +528,6 @@ copy_text_and_data (new, a_out)
   register char *ptr;
 
 #ifdef MSDOS
-#if __DJGPP__ >= 2
   /* Dump the original table of exception handlers, not the one
      where our exception hooks are registered.  */
   __djgpp_exception_toggle ();
@@ -540,7 +536,6 @@ copy_text_and_data (new, a_out)
      and which might change the way that dumped Emacs works.  */
   save_djgpp_startup_flags = _crt0_startup_flags;
   _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR);
-#endif
 #endif
 
   lseek (new, (long) text_scnptr, 0);
@@ -554,14 +549,12 @@ copy_text_and_data (new, a_out)
   write_segment (new, ptr, end);
 
 #ifdef MSDOS
-#if __DJGPP__ >= 2
   /* Restore our exception hooks.  */
   __djgpp_exception_toggle ();
 
   /* Restore the startup flags.  */
   _crt0_startup_flags = save_djgpp_startup_flags;
 #endif
-#endif
 
 
   return 0;
@@ -629,7 +622,6 @@ mark_x (name)
     PERROR (name);
 }
 \f
-#ifndef COFF_BSD_SYMBOLS
 
 /*
  *     If the COFF file contains a symbol table and a line number section,
@@ -698,8 +690,6 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
   return 0;
 }
 
-#endif /* COFF_BSD_SYMBOLS */
-
 /* ****************************************************************
  * unexec
  *
@@ -723,9 +713,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
   if (make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) < 0
       || copy_text_and_data (new, a_out) < 0
       || copy_sym (new, a_out, a_name, new_name) < 0
-#ifndef COFF_BSD_SYMBOLS
       || adjust_lnnoptrs (new, a_out, new_name) < 0
-#endif
       )
     {
       close (new);