emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112138: Fix more incompatibilities b


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112138: Fix more incompatibilities between MinGW.org and MinGW64 headers
Date: Tue, 26 Mar 2013 10:21:27 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112138
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Tue 2013-03-26 10:21:27 +0200
message:
  Fix more incompatibilities between MinGW.org and MinGW64 headers
  
  Reported by ׃scar Fuentes in
    http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00699.html
  and in
    http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00707.html.
  
   nt/inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS) [_W64]: Define to 1.
   For MinGW64, include sys/types.h and time.h.
   nt/inc/sys/time.h (struct timeval) [!_W64]: Guard definition with _W64.
   (struct timezone) [!_TIMEZONE_DEFINED]: Guard definition with
   _TIMEZONE_DEFINED.
   nt/addpm.c (_WIN32_IE) [_W64]: For MinGW64, don't define to 0x400.
   nt/inc/sys/stat.h: Remove _CRTIMP from prototypes of fstat, stat,
   lstat, and fstatat.
  
   lib-src/ntlib.c (struct timespec) [!_TIMEZONE_DEFINED]: Define the
   struct only if _TIMEZONE_DEFINED is not defined.
  
   src/w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
   src/w32.c (REPARSE_DATA_BUFFER): Guard with
   MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
modified:
  lib-src/ChangeLog
  lib-src/ntlib.c
  nt/ChangeLog
  nt/addpm.c
  nt/inc/ms-w32.h
  nt/inc/sys/stat.h
  nt/inc/sys/time.h
  src/ChangeLog
  src/w32.c
  src/w32term.c
=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2013-03-23 15:30:38 +0000
+++ b/lib-src/ChangeLog 2013-03-26 08:21:27 +0000
@@ -1,3 +1,9 @@
+2013-03-26  Eli Zaretskii  <address@hidden>
+
+       Fix incompatibilities between MinGW.org and MinGW64 headers.
+       * ntlib.c (struct timespec) [!_TIMEZONE_DEFINED]: Define the
+       struct only if _TIMEZONE_DEFINED is not defined.
+
 2013-03-23  cg  <address@hidden>  (tiny change)
 
        * makefile.w32-in (LIB_SRC): Move before first use.

=== modified file 'lib-src/ntlib.c'
--- a/lib-src/ntlib.c   2013-01-01 09:11:05 +0000
+++ b/lib-src/ntlib.c   2013-03-26 08:21:27 +0000
@@ -34,11 +34,15 @@
 
 #include "ntlib.h"
 
+/* MinGW64 defines _TIMEZONE_DEFINED and defines 'struct timespec' in
+   its system headers.  */
+#ifndef _TIMEZONE_DEFINED
 struct timezone
 {
   int          tz_minuteswest; /* minutes west of Greenwich */
   int          tz_dsttime;     /* type of dst correction */
 };
+#endif
 
 #define MAXPATHLEN _MAX_PATH
 

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2013-03-25 13:48:37 +0000
+++ b/nt/ChangeLog      2013-03-26 08:21:27 +0000
@@ -1,3 +1,23 @@
+2013-03-26  Eli Zaretskii  <address@hidden>
+
+       Fix more incompatibilities between MinGW.org and MinGW64 headers
+       reported by Óscar Fuentes in
+       http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00699.html
+       and in
+       http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00707.html.
+       * inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS) [_W64]: Define to 1.
+       For MinGW64, include sys/types.h and time.h.
+
+       * inc/sys/time.h (struct timeval) [!_W64]: Guard definition with
+       _W64.
+       (struct timezone) [!_TIMEZONE_DEFINED]: Guard definition with
+       _TIMEZONE_DEFINED.
+
+       * addpm.c (_WIN32_IE) [_W64]: For MinGW64, don't define to 0x400.
+
+       * inc/sys/stat.h: Remove _CRTIMP from prototypes of fstat, stat,
+       lstat, and fstatat.
+
 2013-03-25  Eli Zaretskii  <address@hidden>
 
        Fix incompatibilities between MinGW.org and MinGW64 headers

=== modified file 'nt/addpm.c'
--- a/nt/addpm.c        2013-01-01 09:11:05 +0000
+++ b/nt/addpm.c        2013-03-26 08:21:27 +0000
@@ -34,7 +34,11 @@
    installed, then the DDE fallback for creating icons the Windows 3.1
    progman way will be used instead, but that is prone to lockups
    caused by other applications not servicing their message queues.  */
+/* MinGW64 defines _W64 and barfs if _WIN32_IE is defined to anything
+   below 0x500.  */
+#ifndef _W64
 #define _WIN32_IE 0x400
+#endif
 /* Request C Object macros for COM interfaces.  */
 #define COBJMACROS 1
 

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2013-03-25 13:48:37 +0000
+++ b/nt/inc/ms-w32.h   2013-03-26 08:21:27 +0000
@@ -154,6 +154,14 @@
 
 #ifdef emacs
 
+#ifdef _W64
+/* MinGW64 specific stuff.  */
+#define USE_NO_MINGW_SETJMP_TWO_ARGS 1
+/* Make sure 'struct timespec' and 'struct timezone' are defined.  */
+#include <sys/types.h>
+#include <time.h>
+#endif
+
 #ifdef _MSC_VER
 #include <sys/timeb.h>
 #include <sys/stat.h>

=== modified file 'nt/inc/sys/stat.h'
--- a/nt/inc/sys/stat.h 2013-02-01 06:30:51 +0000
+++ b/nt/inc/sys/stat.h 2013-03-26 08:21:27 +0000
@@ -106,11 +106,11 @@
 /* Prevent redefinition by other headers, e.g. wchar.h.  */
 #define _STAT_DEFINED
 
-_CRTIMP int __cdecl __MINGW_NOTHROW    fstat (int, struct stat*);
+int __cdecl __MINGW_NOTHROW    fstat (int, struct stat*);
+int __cdecl __MINGW_NOTHROW    stat (const char*, struct stat*);
+int __cdecl __MINGW_NOTHROW    lstat (const char*, struct stat*);
+int __cdecl __MINGW_NOTHROW    fstatat (int, char const *,
+                                                struct stat *, int);
 _CRTIMP int __cdecl __MINGW_NOTHROW    chmod (const char*, int);
-_CRTIMP int __cdecl __MINGW_NOTHROW    stat (const char*, struct stat*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    lstat (const char*, struct stat*);
-_CRTIMP int __cdecl __MINGW_NOTHROW    fstatat (int, char const *,
-                                                struct stat *, int);
 
 #endif /* INC_SYS_STAT_H_ */

=== modified file 'nt/inc/sys/time.h'
--- a/nt/inc/sys/time.h 2013-03-25 13:48:37 +0000
+++ b/nt/inc/sys/time.h 2013-03-26 08:21:27 +0000
@@ -6,31 +6,34 @@
  * have the below stuff.
  */
 
+/* The guards are for MinGW64, which defines these structs on its
+   system headers which are included by ms-w32.h.  */
+#ifndef _W64
 struct timeval
 {
   long         tv_sec;         /* seconds */
   long         tv_usec;        /* microseconds */
 };
+#endif
 
+#ifndef _TIMEZONE_DEFINED
 struct timezone
 {
   int          tz_minuteswest; /* minutes west of Greenwich */
   int          tz_dsttime;     /* type of dst correction */
 };
+#endif
 
 void gettimeofday (struct timeval *, struct timezone *);
 
 #define ITIMER_REAL      0
 #define ITIMER_PROF      1
 
-/* MinGW64 defines 'struct itimerval' and _TIMESPEC_DEFINED in sys/types.h.  */
-#ifndef _TIMESPEC_DEFINED
 struct itimerval
 {
   struct  timeval it_interval; /* timer interval */
   struct  timeval it_value;    /* current value */
 };
-#endif
 
 int getitimer (int, struct itimerval *);
 int setitimer (int, struct itimerval *, struct itimerval *);

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-03-25 17:59:59 +0000
+++ b/src/ChangeLog     2013-03-26 08:21:27 +0000
@@ -1,3 +1,11 @@
+2013-03-26  Eli Zaretskii  <address@hidden>
+
+       Fix incompatibilities between MinGW.org and MinGW64 headers.
+       * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
+
+       * w32.c (REPARSE_DATA_BUFFER): Guard with
+       MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
+
 2013-03-25  Jan Djärv  <address@hidden>
 
        * xterm.c: Include X11/XKBlib.h

=== modified file 'src/w32.c'
--- a/src/w32.c 2013-03-07 03:01:17 +0000
+++ b/src/w32.c 2013-03-26 08:21:27 +0000
@@ -127,7 +127,7 @@
 #define SDDL_REVISION_1        1
 #endif /* SDDL_REVISION_1 */
 
-#ifdef _MSC_VER
+#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE
 /* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the
    associated macros, except on ntifs.h, which cannot be included
    because it triggers conflicts with other Windows API headers.  So

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-03-24 00:16:11 +0000
+++ b/src/w32term.c     2013-03-26 08:21:27 +0000
@@ -109,9 +109,10 @@
 Lisp_Object w32_display_name_list;
 
 
-#if _WIN32_WINNT < 0x0500
+#if _WIN32_WINNT < 0x0500 && !defined(_W64)
 /* Pre Windows 2000, this was not available, but define it here so
-   that Emacs compiled on such a platform will run on newer versions.  */
+   that Emacs compiled on such a platform will run on newer versions.
+   MinGW64 (_W64) defines these unconditionally, so avoid redefining.  */
 
 typedef struct tagWCRANGE
 {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]