changeset 4854:95c4ced5c07c

fix compile problems -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-01-14 Ben Wing <ben@xemacs.org> * glyphs-eimage.c: Turn on fixes for conflicts between jmorecfg.h and windows.h on Cygwin, too. * emacs.c (debug_can_access_memory): * lisp.h: Declare function const void * to avoid warnings. * sysfile.h: Include syswindows.h on Windows to avoid problems using things like PATHNAME_CONVERT_OUT. * sysfile.h (X_OK): * dialog-msw.c (handle_directory_proc): * dialog-msw.c (handle_directory_dialog_box): * nt.c (Fmswindows_short_file_name): * sysdep.c (qxe_allocating_getcwd): * syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR): * unexcw.c (unexec): * unexnt.c (_start): * win32.c (mswindows_read_link_1): Rename PATH_MAX_EXTERNAL to PATH_MAX_TSTR to reflect its actual semantics. * unexcw.c: Remove include of syswindows.h that had been added because sysfile.h didn't include it.
author Ben Wing <ben@xemacs.org>
date Thu, 14 Jan 2010 01:25:16 -0600
parents d35e231d347d
children 189fb67ca31a
files src/ChangeLog src/dialog-msw.c src/emacs.c src/glyphs-eimage.c src/lisp.h src/nt.c src/sysdep.c src/sysfile.h src/syswindows.h src/unexcw.c src/unexnt.c src/win32.c
diffstat 12 files changed, 63 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/ChangeLog	Thu Jan 14 01:25:16 2010 -0600
@@ -1,3 +1,33 @@
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* glyphs-eimage.c:
+	Turn on fixes for conflicts between jmorecfg.h and windows.h on
+	Cygwin, too.
+	
+	* emacs.c (debug_can_access_memory):
+	* lisp.h:
+	Declare function const void * to avoid warnings.
+	
+	* sysfile.h:
+	Include syswindows.h on Windows to avoid problems using things like
+	PATHNAME_CONVERT_OUT.
+	
+	* sysfile.h (X_OK):
+	* dialog-msw.c (handle_directory_proc):
+	* dialog-msw.c (handle_directory_dialog_box):
+	* nt.c (Fmswindows_short_file_name):
+	* sysdep.c (qxe_allocating_getcwd):
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	* unexcw.c (unexec):
+	* unexnt.c (_start):
+	* win32.c (mswindows_read_link_1):
+	Rename PATH_MAX_EXTERNAL to PATH_MAX_TSTR to reflect its actual
+	semantics.
+
+	* unexcw.c:
+	Remove include of syswindows.h that had been added because
+	sysfile.h didn't include it.
+
 2010-01-13  Ben Wing  <ben@xemacs.org>
 
 	* specifier.c (specifier_instance_from_inst_list):
--- a/src/dialog-msw.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/dialog-msw.c	Thu Jan 14 01:25:16 2010 -0600
@@ -344,7 +344,7 @@
 CALLBACK handle_directory_proc (HWND hwnd, UINT msg,
 				LPARAM lParam, LPARAM lpData)
 {
-  Extbyte szDir[PATH_MAX_EXTERNAL];
+  Extbyte szDir[PATH_MAX_TCHAR];
   struct param_data *pd = (struct param_data *) lpData;
   
   switch (msg)
@@ -430,7 +430,7 @@
       pidl = qxeSHBrowseForFolder (&bi);
       if (pidl)
 	{
-	  Extbyte *szDir = alloca_extbytes (PATH_MAX_EXTERNAL);
+	  Extbyte *szDir = alloca_extbytes (PATH_MAX_TCHAR);
 	  
 	  if (qxeSHGetPathFromIDList (pidl, szDir))
 	    ret = tstr_to_local_file_format (szDir);
--- a/src/emacs.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/emacs.c	Thu Jan 14 01:25:16 2010 -0600
@@ -3354,7 +3354,7 @@
 
 /* Return whether all bytes in the specified memory block can be read. */
 int
-debug_can_access_memory (void *ptr, Bytecount len)
+debug_can_access_memory (const void *ptr, Bytecount len)
 {
   return !IsBadReadPtr (ptr, len);
 }
@@ -3375,7 +3375,7 @@
 
 /* Return whether all bytes in the specified memory block can be read. */
 int
-debug_can_access_memory (void *ptr, Bytecount len)
+debug_can_access_memory (const void *ptr, Bytecount len)
 {
   /* Use volatile to protect variables from being clobbered by longjmp. */
   SIGTYPE (*volatile old_sigbus) (int);
--- a/src/glyphs-eimage.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/glyphs-eimage.c	Thu Jan 14 01:25:16 2010 -0600
@@ -100,13 +100,13 @@
 
 BEGIN_C_DECLS
 
-#ifdef WIN32_NATIVE
-/* #### Yuck!  More horrifitude.  tiffio.h, below, includes <windows.h>,
-   which defines INT32 and INT16, the former differently and incompatibly
-   from jmorecfg.h, included by jpeglib.h.  We can disable the stuff in
-   jmorecfg.h by defining XMD_H (clever, huh?); then we define these
-   typedefs the way that <windows.h> wants them (which is more correct,
-   anyway; jmorecfg.h defines INT32 as `long'). */
+#ifdef WIN32_ANY
+/* #### Yuck!  More horrifitude.  tiffio.h, below, and sysfile.h above,
+   include <windows.h>, which defines INT32 and INT16, the former
+   differently and incompatibly from jmorecfg.h, included by jpeglib.h.  We
+   can disable the stuff in jmorecfg.h by defining XMD_H (clever, huh?);
+   then we define these typedefs the way that <windows.h> wants them (which
+   is more correct, anyway; jmorecfg.h defines INT32 as `long'). */
 #define XMD_H
 typedef signed int INT32;
 typedef signed short INT16;
--- a/src/lisp.h	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/lisp.h	Thu Jan 14 01:25:16 2010 -0600
@@ -4572,7 +4572,7 @@
 extern Fixnum emacs_priority;
 extern int suppress_early_error_handler_backtrace;
 void debug_break (void);
-int debug_can_access_memory (void *ptr, Bytecount len);
+int debug_can_access_memory (const void *ptr, Bytecount len);
 DECLARE_DOESNT_RETURN (really_abort (void));
 void zero_out_command_line_status_vars (void);
 
--- a/src/nt.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/nt.c	Thu Jan 14 01:25:16 2010 -0600
@@ -2091,7 +2091,7 @@
 */
        (filename))
 {
-  Extbyte shortname[PATH_MAX_EXTERNAL];
+  Extbyte shortname[PATH_MAX_TCHAR];
   Extbyte *fileext;
   Ibyte *shortint;
 
--- a/src/sysdep.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/sysdep.c	Thu Jan 14 01:25:16 2010 -0600
@@ -2862,7 +2862,7 @@
 	}
     }
 #else
-  Extbyte chingame_limitos_arbitrarios[PATH_MAX_EXTERNAL];
+  Extbyte chingame_limitos_arbitrarios[PATH_MAX_TCHAR];
   Ibyte *ret2;
 
   if (!getwd (chingame_limitos_arbitrarios))
--- a/src/sysfile.h	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/sysfile.h	Thu Jan 14 01:25:16 2010 -0600
@@ -86,6 +86,12 @@
 /* # include <sys/fcntl.h> */
 #endif /* WIN32_NATIVE */
 
+/* Needed for C_STRING_TO_TSTR, MAX_XETCHAR_SIZE below; but syswindows.h
+   depends on lisp.h being previously included. */
+#if defined (WIN32_ANY) && defined (emacs)
+# include "syswindows.h"
+#endif
+
 #ifndef	STDERR_FILENO
 #define	STDIN_FILENO	0
 #define	STDOUT_FILENO	1
@@ -302,14 +308,16 @@
 # define QXE_PATH_MAX 1024
 #endif
 
-/* Client .c files should use PATH_MAX_INTERNAL or PATH_MAX_EXTERNAL
+/* Client .c files should use PATH_MAX_INTERNAL or PATH_MAX_TCHAR
    if they must use either one at all. */
 
 /* Use for internally formatted text, which can potentially have up to
    four bytes per character */
 #define PATH_MAX_INTERNAL (QXE_PATH_MAX * MAX_ICHAR_LEN)
-/* Use for externally formatted text. */
-#define PATH_MAX_EXTERNAL (QXE_PATH_MAX * MAX_XETCHAR_SIZE)
+#ifdef WIN32_ANY
+/* Use for externally formatted text in TCHAR's. */
+#define PATH_MAX_TCHAR (QXE_PATH_MAX * MAX_XETCHAR_SIZE)
+#endif
 
 /* The following definitions are needed under Windows, at least */
 #ifndef X_OK
--- a/src/syswindows.h	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/syswindows.h	Thu Jan 14 01:25:16 2010 -0600
@@ -959,7 +959,7 @@
       lfftt_tstr_path = alloca_extbytes (lfftt_size);			\
       cygwin_conv_path (CCP_POSIX_TO_WIN_T | CCP_RELATIVE,		\
 			lfftt_utf8_path, lfftt_tstr_path, lfftt_size);	\
-      * (Extbyte **) &(out) = lfftt_tstr_path;				\
+      * (const Extbyte **) &(out) = lfftt_tstr_path;			\
     }									\
 } while (0)
 #define TSTR_TO_LOCAL_FILE_FORMAT(path, out)				\
--- a/src/unexcw.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/unexcw.c	Thu Jan 14 01:25:16 2010 -0600
@@ -27,7 +27,6 @@
 #include "lisp.h"
 
 #include "sysfile.h"
-#include "syswindows.h"
 
 #define PERROR(arg)				\
 do {						\
@@ -103,7 +102,7 @@
 {
   /* ugly nt hack - should be in lisp */
   int a_new, a_out = -1;
-  char new_name[PATH_MAX_EXTERNAL], a_name[PATH_MAX_EXTERNAL];
+  char new_name[PATH_MAX_TCHAR], a_name[PATH_MAX_TCHAR];
   char *ptr;
   
   /* Make sure that the input and output filenames have the
--- a/src/unexnt.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/unexnt.c	Thu Jan 14 01:25:16 2010 -0600
@@ -133,7 +133,7 @@
      won't work.)  */
   if (heap_state == HEAP_UNLOADED) 
     {
-      Extbyte executable_path[PATH_MAX_EXTERNAL];
+      Extbyte executable_path[PATH_MAX_TCHAR];
 
       /* Don't use mswindows_get_module_file_name() because it uses
 	 xmalloc() */
--- a/src/win32.c	Wed Jan 13 19:43:16 2010 -0600
+++ b/src/win32.c	Thu Jan 14 01:25:16 2010 -0600
@@ -521,7 +521,7 @@
 	    {
 	      Extbyte *fname_unicode;
 	      WIN32_FIND_DATAW wfd;
-	      LPWSTR resolved = alloca_array (WCHAR, PATH_MAX_EXTERNAL + 1);
+	      LPWSTR resolved = alloca_array (WCHAR, PATH_MAX_TCHAR + 1);
 
 	      /* Always Unicode.  Not obvious from the
 		 IPersistFile documentation, but look under
@@ -546,10 +546,10 @@
 		  /* Another Cygwin prototype error,
 		     fixed in v2.2 of w32api */
 		  XECOMCALL4 (psl, GetPath, (LPSTR) resolved,
-			      PATH_MAX_EXTERNAL, &wfd, 0)
+			      PATH_MAX_TCHAR, &wfd, 0)
 #else
 		  XECOMCALL4 (psl, GetPath, resolved,
-			      PATH_MAX_EXTERNAL, &wfd, 0)
+			      PATH_MAX_TCHAR, &wfd, 0)
 #endif
 		  == S_OK)
 		TSTR_TO_C_STRING_MALLOC (resolved, retval);
@@ -579,7 +579,7 @@
 	    {
 	      Extbyte *fname_unicode;
 	      WIN32_FIND_DATAA wfd;
-	      LPSTR resolved = alloca_array (CHAR, PATH_MAX_EXTERNAL + 1);
+	      LPSTR resolved = alloca_array (CHAR, PATH_MAX_TCHAR + 1);
 
 	      /* Always Unicode.  Not obvious from the
 		 IPersistFile documentation, but look under
@@ -591,7 +591,7 @@
 			      (LPWSTR) fname_unicode,
 			      STGM_READ) == S_OK
 		  && XECOMCALL4 (psl, GetPath, resolved,
-				 PATH_MAX_EXTERNAL, &wfd, 0) == S_OK)
+				 PATH_MAX_TCHAR, &wfd, 0) == S_OK)
 		TSTR_TO_C_STRING_MALLOC (resolved, retval);
 
 	      XECOMCALL0 (ppf, Release);