Jonathan Harris wrote:
Peter 'Luna' Runestig wrote:

Is this the right way to make 21.5.6 compile under Windows NT?

diff -ur xemacs-21.5.6.orig/src/unexnt.c xemacs-21.5.6/src/unexnt.c
--- xemacs-21.5.6.orig/src/unexnt.c    Wed Mar 13 09:53:02 2002
+++ xemacs-21.5.6/src/unexnt.c    Wed Apr 10 11:42:44 2002
@@ -128,7 +128,7 @@
     {
       char executable_path[PATH_MAX];
 
-      if (GetModuleFileName (NULL, executable_path, PATH_MAX) == 0) +      if (qxeGetModuleFileName (NULL, executable_path, PATH_MAX) == 0)      {
       exit (1);
     }
[etc]

I think that this is incorrect since the path length paramter should specify the number of characters, not bytes. A similar patch is attached which explicitly uses ASCII versions of the functions to avoid this issue.

Ben, this error was introduced by your introduction of ERROR_WHEN_NONINTERCEPTED_FUNS_USED on 2002-03-31. How come you're not seeing this problem?
Because I compile with pdump.

but i went back and cleaned up your patch to be Mule-correct [i.e. we need to be using the qxe versions and not cheating by using the A versions] and made sure things compile ok under unexec.  i also changed the default to pdump because it works perfectly and in general we're trying to move away from unexec.


Jonathan.




Index: src/unexnt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unexnt.c,v
retrieving revision 1.12
diff -u -r1.12 unexnt.c
--- src/unexnt.c 2002/03/13 08:53:02 1.12
+++ src/unexnt.c 2002/04/11 00:49:03
@@ -128,7 +128,7 @@
{
char executable_path[PATH_MAX];

- if (GetModuleFileName (NULL, executable_path, PATH_MAX) == 0)
+ if (GetModuleFileNameA (NULL, executable_path, PATH_MAX) == 0)
{
exit (1);
}
@@ -225,7 +225,7 @@
dump_bss_and_heap (&in_file, &out_file);

/* Patch up header fields; profiler is picky about this. */
- hImagehelp = LoadLibrary ("imagehlp.dll");
+ hImagehelp = LoadLibraryA ("imagehlp.dll");
if (hImagehelp)
{
PIMAGE_DOS_HEADER dos_header;
@@ -534,14 +534,14 @@
void *file_base;
unsigned long size, upper_size, n_read;

- file = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ file = CreateFileA (filename, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (file == INVALID_HANDLE_VALUE)
abort ();

size = GetFileSize (file, &upper_size);
- file_mapping = CreateFileMapping (file, NULL, PAGE_WRITECOPY,
- 0, size, NULL);
+ file_mapping = CreateFileMappingA (file, NULL, PAGE_WRITECOPY,
+ 0, size, NULL);
if (!file_mapping)
abort ();