(coded-charset-entity-reference-alist): Add setting for
[chise/xemacs-chise.git.1] / src / unexnt.c
index 77cf487..8260285 100644 (file)
@@ -56,10 +56,9 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * version of my_ebss in lastfile.c and a new firstfile.c file.  jhar */
 
 #include <config.h>
-#include <stdlib.h>    /* _fmode */
-#include <stdio.h>
-#include <fcntl.h>
-#include <windows.h>
+#include "lisp.h"
+
+#include "syswindows.h"
 
 #include "nt.h"
 #include "ntheap.h"
@@ -170,9 +169,9 @@ _start (void)
 }
 
 /* Dump out .data and .bss sections into a new executable.  */
-void
-unexec (char *new_name, char *old_name, void *start_data, void *start_bss,
-       void *entry_address)
+int
+unexec (char *new_name, char *old_name, unsigned int start_data,
+       unsigned int start_bss, unsigned int entry_address)
 {
   file_data in_file, out_file;
   char out_filename[MAX_PATH], in_filename[MAX_PATH];
@@ -267,6 +266,8 @@ unexec (char *new_name, char *old_name, void *start_data, void *start_bss,
 
   close_file_data (&in_file);
   close_file_data (&out_file);
+
+  return 0;
 }
 
 /* Routines to manipulate NT executable file sections.  */
@@ -510,17 +511,17 @@ read_in_bss (char *filename)
   file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
   if (file == INVALID_HANDLE_VALUE)
-    abort ();
+    ABORT ();
   
   /* Seek to where the .bss section is tucked away after the heap...  */
   index = heap_index_in_executable + get_committed_heap_size ();
   if (SetFilePointer (file, index, NULL, FILE_BEGIN) == 0xFFFFFFFF) 
-    abort ();
+    ABORT ();
 
   /* Ok, read in the saved .bss section and initialize all 
      uninitialized variables.  */
   if (!ReadFile (file, bss_start, bss_size, &n_read, NULL))
-    abort ();
+    ABORT ();
 
   CloseHandle (file);
 #endif
@@ -538,13 +539,13 @@ map_in_heap (char *filename)
   file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
                     OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
   if (file == INVALID_HANDLE_VALUE) 
-    abort ();
+    ABORT ();
 
   size = GetFileSize (file, &upper_size);
   file_mapping = CreateFileMapping (file, NULL, PAGE_WRITECOPY, 
                                    0, size, NULL);
   if (!file_mapping) 
-    abort ();
+    ABORT ();
 
   size = get_committed_heap_size ();
   file_base = MapViewOfFileEx (file_mapping, FILE_MAP_COPY, 0, 
@@ -562,17 +563,17 @@ map_in_heap (char *filename)
 
   if (VirtualAlloc (get_heap_start (), get_committed_heap_size (),
                    MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE) == NULL)
-    abort ();
+    ABORT ();
 
   /* Seek to the location of the heap data in the executable.  */
   if (SetFilePointer (file, heap_index_in_executable,
                      NULL, FILE_BEGIN) == 0xFFFFFFFF)
-    abort ();
+    ABORT ();
 
   /* Read in the data.  */
   if (!ReadFile (file, get_heap_start (), 
                 get_committed_heap_size (), &n_read, NULL))
-    abort ();
+    ABORT ();
 
   CloseHandle (file);
 }