changeset 4825:2e1527b8385b

merge changes to get things to compile under cygwin
author Ben Wing <ben@xemacs.org>
date Thu, 24 Dec 2009 19:46:51 -0600
parents bc4f2511bbea (current diff) c12b646d84ee (diff)
children 780bb5441c14
files
diffstat 8 files changed, 61 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/modules/ldap/eldap.c	Tue Dec 22 15:52:06 2009 -0700
+++ b/modules/ldap/eldap.c	Thu Dec 24 19:46:51 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	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/database.c	Thu Dec 24 19:46:51 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/fileio.c	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/fileio.c	Thu Dec 24 19:46:51 2009 -0600
@@ -2325,7 +2325,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 +2346,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	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/intl-encap-win32.c	Thu Dec 24 19:46:51 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	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/mule-charset.c	Thu Dec 24 19:46:51 2009 -0600
@@ -868,8 +868,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	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/nas.c	Thu Dec 24 19:46:51 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/syswindows.h	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/syswindows.h	Thu Dec 24 19:46:51 2009 -0600
@@ -55,10 +55,12 @@
 
 BEGIN_C_DECLS
 
+#if 0 /* breaks the build, as of GCC 3.4.4 or earlier */
 /* 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	Tue Dec 22 15:52:06 2009 -0700
+++ b/src/unicode.c	Thu Dec 24 19:46:51 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