diff options
| author | Eli Zaretskii | 2013-03-26 15:45:01 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-03-26 15:45:01 +0200 |
| commit | a18d7de6144f9b0ce1202c6ac9c065cbd8e78168 (patch) | |
| tree | 7c19231e5557b44bbafed3cf74c7d3476ace1fd9 | |
| parent | f46ba47d8b340125b17b2f13229079419f61a85e (diff) | |
| download | emacs-a18d7de6144f9b0ce1202c6ac9c065cbd8e78168.tar.gz emacs-a18d7de6144f9b0ce1202c6ac9c065cbd8e78168.zip | |
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.
| -rw-r--r-- | nt/ChangeLog | 4 | ||||
| -rw-r--r-- | nt/inc/ms-w32.h | 8 | ||||
| -rw-r--r-- | nt/inc/sys/stat.h | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/w32.c | 5 |
5 files changed, 17 insertions, 5 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog index f4fa0a7ee53..10f145a0dd9 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -2,11 +2,15 @@ | |||
| 2 | 2 | ||
| 3 | Fix more incompatibilities between MinGW.org and MinGW64 headers | 3 | Fix more incompatibilities between MinGW.org and MinGW64 headers |
| 4 | reported by Óscar Fuentes in | 4 | reported by Óscar Fuentes in |
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00733.html | ||
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00699.html | 6 | http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00699.html |
| 6 | and in | 7 | and in |
| 7 | http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00707.html. | 8 | http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00707.html. |
| 8 | * inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS) [_W64]: Define to 1. | 9 | * inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS) [_W64]: Define to 1. |
| 9 | For MinGW64, include sys/types.h and time.h. | 10 | For MinGW64, include sys/types.h and time.h. |
| 11 | (_WIN32_WINNT) [!_W64]: Don't define for MinGW64. | ||
| 12 | |||
| 13 | * inc/sys/stat.h (chmod): Remove _CRTIMP from prototype. | ||
| 10 | 14 | ||
| 11 | * inc/sys/time.h (struct timeval) [!_W64]: Guard definition with | 15 | * inc/sys/time.h (struct timeval) [!_W64]: Guard definition with |
| 12 | _W64. | 16 | _W64. |
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index ccab3695c6c..f721676f731 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -129,9 +129,11 @@ extern char *getenv (); | |||
| 129 | 129 | ||
| 130 | /* Prevent accidental use of features unavailable in older Windows | 130 | /* Prevent accidental use of features unavailable in older Windows |
| 131 | versions we still support. MinGW64 defines this to a higher value | 131 | versions we still support. MinGW64 defines this to a higher value |
| 132 | in its system headers, so define our override before including any | 132 | in its system headers, and is not really compatible with values |
| 133 | system headers. */ | 133 | lower than 0x0500, so leave it alone. */ |
| 134 | #define _WIN32_WINNT 0x0400 | 134 | #ifndef _W64 |
| 135 | # define _WIN32_WINNT 0x0400 | ||
| 136 | #endif | ||
| 135 | 137 | ||
| 136 | /* Make a leaner executable. */ | 138 | /* Make a leaner executable. */ |
| 137 | #define WIN32_LEAN_AND_MEAN 1 | 139 | #define WIN32_LEAN_AND_MEAN 1 |
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h index 31129bbf4f3..f6785c56477 100644 --- a/nt/inc/sys/stat.h +++ b/nt/inc/sys/stat.h | |||
| @@ -111,6 +111,6 @@ int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*); | |||
| 111 | int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*); | 111 | int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*); |
| 112 | int __cdecl __MINGW_NOTHROW fstatat (int, char const *, | 112 | int __cdecl __MINGW_NOTHROW fstatat (int, char const *, |
| 113 | struct stat *, int); | 113 | struct stat *, int); |
| 114 | _CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); | 114 | int __cdecl __MINGW_NOTHROW chmod (const char*, int); |
| 115 | 115 | ||
| 116 | #endif /* INC_SYS_STAT_H_ */ | 116 | #endif /* INC_SYS_STAT_H_ */ |
diff --git a/src/ChangeLog b/src/ChangeLog index 669c8e99a27..93d2b447cd5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-03-26 Eli Zaretskii <eliz@gnu.org> | 1 | 2013-03-26 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]: | ||
| 4 | Define only for _WIN32_WINNT less than 0x0500. | ||
| 5 | |||
| 3 | Fix incompatibilities between MinGW.org and MinGW64 headers. | 6 | Fix incompatibilities between MinGW.org and MinGW64 headers. |
| 4 | * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined. | 7 | * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined. |
| 5 | 8 | ||
| @@ -69,7 +69,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 69 | #include <pwd.h> | 69 | #include <pwd.h> |
| 70 | #include <grp.h> | 70 | #include <grp.h> |
| 71 | 71 | ||
| 72 | #ifdef __GNUC__ | 72 | /* MinGW64 (_W64) defines these in its _mingw.h. */ |
| 73 | #if defined(__GNUC__) && !defined(_W64) | ||
| 73 | #define _ANONYMOUS_UNION | 74 | #define _ANONYMOUS_UNION |
| 74 | #define _ANONYMOUS_STRUCT | 75 | #define _ANONYMOUS_STRUCT |
| 75 | #endif | 76 | #endif |
| @@ -96,6 +97,7 @@ typedef struct _MEMORY_STATUS_EX { | |||
| 96 | #ifndef _MSC_VER | 97 | #ifndef _MSC_VER |
| 97 | #include <w32api.h> | 98 | #include <w32api.h> |
| 98 | #endif | 99 | #endif |
| 100 | #if _WIN32_WINNT < 0x0500 | ||
| 99 | #if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15) | 101 | #if !defined (__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15) |
| 100 | /* This either is not in psapi.h or guarded by higher value of | 102 | /* This either is not in psapi.h or guarded by higher value of |
| 101 | _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 | 103 | _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15 |
| @@ -114,6 +116,7 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX { | |||
| 114 | SIZE_T PrivateUsage; | 116 | SIZE_T PrivateUsage; |
| 115 | } PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX; | 117 | } PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX; |
| 116 | #endif | 118 | #endif |
| 119 | #endif | ||
| 117 | 120 | ||
| 118 | #include <winioctl.h> | 121 | #include <winioctl.h> |
| 119 | #include <aclapi.h> | 122 | #include <aclapi.h> |