changeset 5119:d877c14318b3 ben-lisp-object

merge in latest-fix changes
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:22:48 -0600
parents e0db3c197671 (current diff) 11daf37dae4d (diff)
children d1247f3cc363
files modules/ldap/eldap.c src/database.c src/faces.c src/mule-charset.c
diffstat 11 files changed, 69 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/modules/ldap/eldap.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/modules/ldap/eldap.c	Sat Dec 26 21:22:48 2009 -0600
@@ -497,8 +497,10 @@
   CHECK_SYMBOL (attrsonly);
 
   /* Perform the search */
-  bs = NILP (base) ? "" : NEW_LISP_STRING_TO_EXTERNAL (base, Qnative);
-  filt = NILP (filter) ? "" : NEW_LISP_STRING_TO_EXTERNAL (filter, Qnative);
+  bs = NILP (base) ? (Extbyte *) "" :
+    NEW_LISP_STRING_TO_EXTERNAL (base, Qnative);
+  filt = NILP (filter) ? (Extbyte *) "" :
+    NEW_LISP_STRING_TO_EXTERNAL (filter, Qnative);
   if (ldap_search (ld, bs, ldap_scope, filt, ldap_attributes,
 		   NILP (attrsonly) ? 0 : 1)
       == -1)
--- a/src/database.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/database.c	Sat Dec 26 21:22:48 2009 -0600
@@ -85,7 +85,47 @@
 #endif /* HAVE_BERKELEY_DB */
 
 #ifdef HAVE_DBM
+#if defined (CYGWIN) || defined (MINGW)
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* As of Cygwin 1.7.0, the prototypes in ndbm.h are broken when compiling
+using C++, since they are of the form `datum dbm_firstkey()', without any
+args given. */
+/* Parameters to dbm_store for simple insertion or replacement. */
+#define  DBM_INSERT  0
+#define  DBM_REPLACE 1
+
+
+/* The data and key structure.  This structure is defined for compatibility. */
+typedef struct {
+        char *dptr;
+        int   dsize;
+      } datum;
+
+
+/* The file information header. This is good enough for most applications. */
+typedef struct {int dummy[10];} DBM;
+
+int     dbm_clearerr(DBM *);
+void    dbm_close(DBM *);
+int     dbm_delete(DBM *, datum);
+int     dbm_error(DBM *);
+datum   dbm_fetch(DBM *, datum);
+datum   dbm_firstkey(DBM *);
+datum   dbm_nextkey(DBM *);
+DBM    *dbm_open(const char *, int, mode_t);
+int     dbm_store(DBM *, datum, datum, int);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#else
 #include NDBM_H_FILE
+#endif
 Lisp_Object Qdbm;
 #endif /* HAVE_DBM */
 
--- a/src/faces.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/faces.c	Sat Dec 26 21:22:48 2009 -0600
@@ -2272,6 +2272,7 @@
     Lisp_Object device_symbol = Qx;
 #endif
 
+#if defined (USE_XFT) || defined (MULE)
     const Ascbyte **fontptr;
 
     const Ascbyte *fonts[] =
@@ -2301,6 +2302,7 @@
       "-*-*-medium-r-*-*-*-170-*-*-c-*-*-*",
 #endif
     };
+#endif /* defined (USE_XFT) || defined (MULE) */
 
 #ifdef MULE
 
--- a/src/fileio.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/fileio.c	Sat Dec 26 21:22:48 2009 -0600
@@ -794,8 +794,9 @@
       handler = Ffind_file_name_handler (default_directory, Qexpand_file_name);
       if (!NILP (handler))
 	RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name,
-				       call3 (handler, Qexpand_file_name,
-					      name, default_directory));
+				       call3_check_string
+                                       (handler, Qexpand_file_name,
+				        name, default_directory));
     }
 
   o = XSTRING_DATA (default_directory);
@@ -2325,7 +2326,7 @@
 {
 #if defined(WIN32_NATIVE) || defined(CYGWIN)
 #ifdef CYGWIN
-    char filename_buffer[PATH_MAX];
+    Extbyte filename_buffer[PATH_MAX];
 #endif
 	// Since this has to work for a directory, we can't just call 'CreateFile'
 	PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
@@ -2346,13 +2347,13 @@
     DWORD dwAccessAllowed;
     Extbyte *fnameext;
 
+    C_STRING_TO_TSTR(filename, fnameext);
+
 #ifdef CYGWIN
-    cygwin_conv_to_full_win32_path(filename, filename_buffer);
-    filename = (Ibyte*)filename_buffer;
+    cygwin_conv_to_full_win32_path(fnameext, filename_buffer);
+    fnameext = filename_buffer;
 #endif
 
-    C_STRING_TO_TSTR(filename, fnameext);
-
     // First check for a normal file with the old-style readonly bit
     attributes = qxeGetFileAttributes(fnameext);
     if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
--- a/src/intl-encap-win32.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/intl-encap-win32.c	Sat Dec 26 21:22:48 2009 -0600
@@ -1199,7 +1199,7 @@
 BOOL
 qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
 {
-#ifdef CYGWIN_HEADERS
+#if 0 /* defined (CYGWIN_HEADERS) */ /* fixed at some point <= GCC 3.4.4 */
   /* Cygwin mistakenly declares the second argument as DWORD. */
   if (XEUNICODE_P)
     return GetICMProfileW (arg1, (DWORD) arg2, (LPWSTR) arg3);
@@ -1217,7 +1217,7 @@
 BOOL
 qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4)
 {
-#ifdef CYGWIN_HEADERS
+#if defined (CYGWIN_HEADERS)
   /* Cygwin mistakenly declares the second argument as DWORD. */
   if (XEUNICODE_P)
     return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4);
--- a/src/mule-charset.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/mule-charset.c	Sat Dec 26 21:22:48 2009 -0600
@@ -867,8 +867,6 @@
 */
        (charset, ccl_program))
 {
-  struct ccl_program test_ccl;
-
   charset = Fget_charset (charset);
   XCHARSET_CCL_PROGRAM (charset) = get_ccl_program (ccl_program);
 
--- a/src/nas.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/nas.c	Sat Dec 26 21:22:48 2009 -0600
@@ -237,6 +237,8 @@
   return NULL;
 }
 
+# if 0 /* not currently used */
+
 static void
 nas_close_down_play (void)
 
@@ -245,6 +247,8 @@
   sound_warn ("disconnected from audio server");
 }
 
+#endif
+
  /********************************************************************\
  *                                                                    *
  * Callback which is run when the sound finishes playing.             *
--- a/src/redisplay-x.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/redisplay-x.c	Sat Dec 26 21:22:48 2009 -0600
@@ -136,7 +136,6 @@
 			      const Ichar *str, Charcount len,
 			      struct face_cachel *UNUSED(cachel))
 {
-  int i;
   if (!len)
     return 0;
 
--- a/src/syswindows.h	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/syswindows.h	Sat Dec 26 21:22:48 2009 -0600
@@ -55,10 +55,13 @@
 
 BEGIN_C_DECLS
 
+#if 0 /* breaks the build, as of GCC 3.4.4 or earlier, since the prototype
+         is now declared static */
 /* Fucking GCC complains about "no previous prototype" for inline
    functions.  DUH!  See DECLARE_INLINE_HEADER. */
 extern __inline void *GetCurrentFiber (void);
 extern __inline void *GetFiberData (void);
+#endif
 
 END_C_DECLS
 
--- a/src/unicode.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/unicode.c	Sat Dec 26 21:22:48 2009 -0600
@@ -2945,8 +2945,10 @@
   Lisp_Object skip_chars_range_table, result = Qnil;
   enum query_coding_failure_reasons failed_reason,
     previous_failed_reason = query_coding_succeeded;
-  int checked_unicode, invalid_lower_limit = UNICODE_ERROR_OCTET_RANGE_START,
-    invalid_upper_limit, unicode_type = XCODING_SYSTEM_UNICODE_TYPE (codesys);
+  int checked_unicode,
+    invalid_lower_limit = UNICODE_ERROR_OCTET_RANGE_START,
+    invalid_upper_limit = -1,
+    unicode_type = XCODING_SYSTEM_UNICODE_TYPE (codesys);
 
   if (flags & QUERY_METHOD_HIGHLIGHT && 
       /* If we're being called really early, live without highlights getting
--- a/src/vdb-win32.c	Sat Dec 26 21:18:49 2009 -0600
+++ b/src/vdb-win32.c	Sat Dec 26 21:22:48 2009 -0600
@@ -29,7 +29,7 @@
 #include "syswindows.h"
 
 
-DWORD WINAPI 
+LONG WINAPI 
 win32_fault_handler (LPEXCEPTION_POINTERS e)
 {
 #define GET_FAULT_ADDRESS (void *) e->ExceptionRecord->ExceptionInformation[1]
@@ -46,7 +46,7 @@
     return EXCEPTION_CONTINUE_SEARCH;
 }
 
-typedef DWORD (WINAPI *gcPVECTORED_EXCEPTION_HANDLER) (LPEXCEPTION_POINTERS e);
+typedef LONG (WINAPI *gcPVECTORED_EXCEPTION_HANDLER) (LPEXCEPTION_POINTERS e);
 
 
 void