emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112140: Fix more MinGW64 incompatibi


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112140: Fix more MinGW64 incompatibilities.
Date: Tue, 26 Mar 2013 15:45:01 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112140
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Tue 2013-03-26 15:45:01 +0200
message:
  Fix more MinGW64 incompatibilities.
  
  Reported by ׃scar Fuentes in
  
    http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00733.html
  
   nt/inc/ms-w32.h (_WIN32_WINNT) [!_W64]: Don't define for MinGW64.
   nt/inc/sys/stat.h (chmod): Remove _CRTIMP from prototype.
  
   src/w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
   Define only for _WIN32_WINNT less than 0x0500.
modified:
  nt/ChangeLog
  nt/inc/ms-w32.h
  nt/inc/sys/stat.h
  src/ChangeLog
  src/w32.c
=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2013-03-26 08:21:27 +0000
+++ b/nt/ChangeLog      2013-03-26 13:45:01 +0000
@@ -2,11 +2,15 @@
 
        Fix more incompatibilities between MinGW.org and MinGW64 headers
        reported by Óscar Fuentes in
+       http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00733.html
        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.
+       (_WIN32_WINNT) [!_W64]: Don't define for MinGW64.
+
+       * inc/sys/stat.h (chmod): Remove _CRTIMP from prototype.
 
        * inc/sys/time.h (struct timeval) [!_W64]: Guard definition with
        _W64.

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2013-03-26 08:21:27 +0000
+++ b/nt/inc/ms-w32.h   2013-03-26 13:45:01 +0000
@@ -129,9 +129,11 @@
 
 /* Prevent accidental use of features unavailable in older Windows
    versions we still support.  MinGW64 defines this to a higher value
-   in its system headers, so define our override before including any
-   system headers.  */
-#define _WIN32_WINNT 0x0400
+   in its system headers, and is not really compatible with values
+   lower than 0x0500, so leave it alone.  */
+#ifndef _W64
+# define _WIN32_WINNT 0x0400
+#endif
 
 /* Make a leaner executable.  */
 #define WIN32_LEAN_AND_MEAN 1

=== modified file 'nt/inc/sys/stat.h'
--- a/nt/inc/sys/stat.h 2013-03-26 08:21:27 +0000
+++ b/nt/inc/sys/stat.h 2013-03-26 13:45:01 +0000
@@ -111,6 +111,6 @@
 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);
+int __cdecl __MINGW_NOTHROW    chmod (const char*, int);
 
 #endif /* INC_SYS_STAT_H_ */

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-03-26 08:21:27 +0000
+++ b/src/ChangeLog     2013-03-26 13:45:01 +0000
@@ -1,5 +1,8 @@
 2013-03-26  Eli Zaretskii  <address@hidden>
 
+       * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
+       Define only for _WIN32_WINNT less than 0x0500.
+
        Fix incompatibilities between MinGW.org and MinGW64 headers.
        * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
 

=== modified file 'src/w32.c'
--- a/src/w32.c 2013-03-26 08:21:27 +0000
+++ b/src/w32.c 2013-03-26 13:45:01 +0000
@@ -69,7 +69,8 @@
 #include <pwd.h>
 #include <grp.h>
 
-#ifdef __GNUC__
+/* MinGW64 (_W64) defines these in its _mingw.h.  */
+#if defined(__GNUC__) && !defined(_W64)
 #define _ANONYMOUS_UNION
 #define _ANONYMOUS_STRUCT
 #endif
@@ -96,6 +97,7 @@
 #ifndef _MSC_VER
 #include <w32api.h>
 #endif
+#if _WIN32_WINNT < 0x0500
 #if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || 
(__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15)
 /* This either is not in psapi.h or guarded by higher value of
    _WIN32_WINNT than what we use.  w32api supplied with MinGW 3.15
@@ -114,6 +116,7 @@
   SIZE_T PrivateUsage;
 } PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX;
 #endif
+#endif
 
 #include <winioctl.h>
 #include <aclapi.h>


reply via email to

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