diff options
| author | Eli Zaretskii | 2013-03-26 10:21:27 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-03-26 10:21:27 +0200 |
| commit | b88b62dec99cec327c6bae67ef4d3a8bc5b601ca (patch) | |
| tree | 2d3d5acaabe9d9e124c90bfae57bddf3dc355c19 | |
| parent | 69b2c07eaf592dee54ccd9bdb5f38dce88d1f221 (diff) | |
| download | emacs-b88b62dec99cec327c6bae67ef4d3a8bc5b601ca.tar.gz emacs-b88b62dec99cec327c6bae67ef4d3a8bc5b601ca.zip | |
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.
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/ntlib.c | 4 | ||||
| -rw-r--r-- | nt/ChangeLog | 20 | ||||
| -rw-r--r-- | nt/addpm.c | 4 | ||||
| -rw-r--r-- | nt/inc/ms-w32.h | 8 | ||||
| -rw-r--r-- | nt/inc/sys/stat.h | 10 | ||||
| -rw-r--r-- | nt/inc/sys/time.h | 9 | ||||
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/w32.c | 2 | ||||
| -rw-r--r-- | src/w32term.c | 5 |
10 files changed, 65 insertions, 11 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 03412aa23b9..10758d80872 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-03-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Fix incompatibilities between MinGW.org and MinGW64 headers. | ||
| 4 | * ntlib.c (struct timespec) [!_TIMEZONE_DEFINED]: Define the | ||
| 5 | struct only if _TIMEZONE_DEFINED is not defined. | ||
| 6 | |||
| 1 | 2013-03-23 cg <chengang31@gmail.com> (tiny change) | 7 | 2013-03-23 cg <chengang31@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * makefile.w32-in (LIB_SRC): Move before first use. | 9 | * makefile.w32-in (LIB_SRC): Move before first use. |
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index f43117457cb..849abc2ede5 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c | |||
| @@ -34,11 +34,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | 34 | ||
| 35 | #include "ntlib.h" | 35 | #include "ntlib.h" |
| 36 | 36 | ||
| 37 | /* MinGW64 defines _TIMEZONE_DEFINED and defines 'struct timespec' in | ||
| 38 | its system headers. */ | ||
| 39 | #ifndef _TIMEZONE_DEFINED | ||
| 37 | struct timezone | 40 | struct timezone |
| 38 | { | 41 | { |
| 39 | int tz_minuteswest; /* minutes west of Greenwich */ | 42 | int tz_minuteswest; /* minutes west of Greenwich */ |
| 40 | int tz_dsttime; /* type of dst correction */ | 43 | int tz_dsttime; /* type of dst correction */ |
| 41 | }; | 44 | }; |
| 45 | #endif | ||
| 42 | 46 | ||
| 43 | #define MAXPATHLEN _MAX_PATH | 47 | #define MAXPATHLEN _MAX_PATH |
| 44 | 48 | ||
diff --git a/nt/ChangeLog b/nt/ChangeLog index 20579d36c79..f4fa0a7ee53 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2013-03-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Fix more incompatibilities between MinGW.org and MinGW64 headers | ||
| 4 | reported by Óscar Fuentes in | ||
| 5 | http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00699.html | ||
| 6 | and in | ||
| 7 | 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 | For MinGW64, include sys/types.h and time.h. | ||
| 10 | |||
| 11 | * inc/sys/time.h (struct timeval) [!_W64]: Guard definition with | ||
| 12 | _W64. | ||
| 13 | (struct timezone) [!_TIMEZONE_DEFINED]: Guard definition with | ||
| 14 | _TIMEZONE_DEFINED. | ||
| 15 | |||
| 16 | * addpm.c (_WIN32_IE) [_W64]: For MinGW64, don't define to 0x400. | ||
| 17 | |||
| 18 | * inc/sys/stat.h: Remove _CRTIMP from prototypes of fstat, stat, | ||
| 19 | lstat, and fstatat. | ||
| 20 | |||
| 1 | 2013-03-25 Eli Zaretskii <eliz@gnu.org> | 21 | 2013-03-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 22 | ||
| 3 | Fix incompatibilities between MinGW.org and MinGW64 headers | 23 | Fix incompatibilities between MinGW.org and MinGW64 headers |
diff --git a/nt/addpm.c b/nt/addpm.c index 6ed625d908f..8079d51dd64 100644 --- a/nt/addpm.c +++ b/nt/addpm.c | |||
| @@ -34,7 +34,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 34 | installed, then the DDE fallback for creating icons the Windows 3.1 | 34 | installed, then the DDE fallback for creating icons the Windows 3.1 |
| 35 | progman way will be used instead, but that is prone to lockups | 35 | progman way will be used instead, but that is prone to lockups |
| 36 | caused by other applications not servicing their message queues. */ | 36 | caused by other applications not servicing their message queues. */ |
| 37 | /* MinGW64 defines _W64 and barfs if _WIN32_IE is defined to anything | ||
| 38 | below 0x500. */ | ||
| 39 | #ifndef _W64 | ||
| 37 | #define _WIN32_IE 0x400 | 40 | #define _WIN32_IE 0x400 |
| 41 | #endif | ||
| 38 | /* Request C Object macros for COM interfaces. */ | 42 | /* Request C Object macros for COM interfaces. */ |
| 39 | #define COBJMACROS 1 | 43 | #define COBJMACROS 1 |
| 40 | 44 | ||
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index d3faa6d2b2f..ccab3695c6c 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h | |||
| @@ -154,6 +154,14 @@ extern char *getenv (); | |||
| 154 | 154 | ||
| 155 | #ifdef emacs | 155 | #ifdef emacs |
| 156 | 156 | ||
| 157 | #ifdef _W64 | ||
| 158 | /* MinGW64 specific stuff. */ | ||
| 159 | #define USE_NO_MINGW_SETJMP_TWO_ARGS 1 | ||
| 160 | /* Make sure 'struct timespec' and 'struct timezone' are defined. */ | ||
| 161 | #include <sys/types.h> | ||
| 162 | #include <time.h> | ||
| 163 | #endif | ||
| 164 | |||
| 157 | #ifdef _MSC_VER | 165 | #ifdef _MSC_VER |
| 158 | #include <sys/timeb.h> | 166 | #include <sys/timeb.h> |
| 159 | #include <sys/stat.h> | 167 | #include <sys/stat.h> |
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h index c356283c04b..31129bbf4f3 100644 --- a/nt/inc/sys/stat.h +++ b/nt/inc/sys/stat.h | |||
| @@ -106,11 +106,11 @@ extern int w32_stat_get_owner_group; | |||
| 106 | /* Prevent redefinition by other headers, e.g. wchar.h. */ | 106 | /* Prevent redefinition by other headers, e.g. wchar.h. */ |
| 107 | #define _STAT_DEFINED | 107 | #define _STAT_DEFINED |
| 108 | 108 | ||
| 109 | _CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*); | 109 | int __cdecl __MINGW_NOTHROW fstat (int, struct stat*); |
| 110 | _CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); | 110 | int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*); |
| 111 | _CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*); | 111 | int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*); |
| 112 | _CRTIMP int __cdecl __MINGW_NOTHROW lstat (const char*, struct stat*); | 112 | int __cdecl __MINGW_NOTHROW fstatat (int, char const *, |
| 113 | _CRTIMP int __cdecl __MINGW_NOTHROW fstatat (int, char const *, | ||
| 114 | struct stat *, int); | 113 | struct stat *, int); |
| 114 | _CRTIMP 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/nt/inc/sys/time.h b/nt/inc/sys/time.h index e49f0ea4de3..80c725385bb 100644 --- a/nt/inc/sys/time.h +++ b/nt/inc/sys/time.h | |||
| @@ -6,31 +6,34 @@ | |||
| 6 | * have the below stuff. | 6 | * have the below stuff. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | /* The guards are for MinGW64, which defines these structs on its | ||
| 10 | system headers which are included by ms-w32.h. */ | ||
| 11 | #ifndef _W64 | ||
| 9 | struct timeval | 12 | struct timeval |
| 10 | { | 13 | { |
| 11 | long tv_sec; /* seconds */ | 14 | long tv_sec; /* seconds */ |
| 12 | long tv_usec; /* microseconds */ | 15 | long tv_usec; /* microseconds */ |
| 13 | }; | 16 | }; |
| 17 | #endif | ||
| 14 | 18 | ||
| 19 | #ifndef _TIMEZONE_DEFINED | ||
| 15 | struct timezone | 20 | struct timezone |
| 16 | { | 21 | { |
| 17 | int tz_minuteswest; /* minutes west of Greenwich */ | 22 | int tz_minuteswest; /* minutes west of Greenwich */ |
| 18 | int tz_dsttime; /* type of dst correction */ | 23 | int tz_dsttime; /* type of dst correction */ |
| 19 | }; | 24 | }; |
| 25 | #endif | ||
| 20 | 26 | ||
| 21 | void gettimeofday (struct timeval *, struct timezone *); | 27 | void gettimeofday (struct timeval *, struct timezone *); |
| 22 | 28 | ||
| 23 | #define ITIMER_REAL 0 | 29 | #define ITIMER_REAL 0 |
| 24 | #define ITIMER_PROF 1 | 30 | #define ITIMER_PROF 1 |
| 25 | 31 | ||
| 26 | /* MinGW64 defines 'struct itimerval' and _TIMESPEC_DEFINED in sys/types.h. */ | ||
| 27 | #ifndef _TIMESPEC_DEFINED | ||
| 28 | struct itimerval | 32 | struct itimerval |
| 29 | { | 33 | { |
| 30 | struct timeval it_interval; /* timer interval */ | 34 | struct timeval it_interval; /* timer interval */ |
| 31 | struct timeval it_value; /* current value */ | 35 | struct timeval it_value; /* current value */ |
| 32 | }; | 36 | }; |
| 33 | #endif | ||
| 34 | 37 | ||
| 35 | int getitimer (int, struct itimerval *); | 38 | int getitimer (int, struct itimerval *); |
| 36 | int setitimer (int, struct itimerval *, struct itimerval *); | 39 | int setitimer (int, struct itimerval *, struct itimerval *); |
diff --git a/src/ChangeLog b/src/ChangeLog index 107d2af866b..669c8e99a27 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-03-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Fix incompatibilities between MinGW.org and MinGW64 headers. | ||
| 4 | * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined. | ||
| 5 | |||
| 6 | * w32.c (REPARSE_DATA_BUFFER): Guard with | ||
| 7 | MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined. | ||
| 8 | |||
| 1 | 2013-03-25 Jan Djärv <jan.h.d@swipnet.se> | 9 | 2013-03-25 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 10 | ||
| 3 | * xterm.c: Include X11/XKBlib.h | 11 | * xterm.c: Include X11/XKBlib.h |
| @@ -127,7 +127,7 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX { | |||
| 127 | #define SDDL_REVISION_1 1 | 127 | #define SDDL_REVISION_1 1 |
| 128 | #endif /* SDDL_REVISION_1 */ | 128 | #endif /* SDDL_REVISION_1 */ |
| 129 | 129 | ||
| 130 | #ifdef _MSC_VER | 130 | #ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE |
| 131 | /* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the | 131 | /* MSVC doesn't provide the definition of REPARSE_DATA_BUFFER and the |
| 132 | associated macros, except on ntifs.h, which cannot be included | 132 | associated macros, except on ntifs.h, which cannot be included |
| 133 | because it triggers conflicts with other Windows API headers. So | 133 | because it triggers conflicts with other Windows API headers. So |
diff --git a/src/w32term.c b/src/w32term.c index e02b5a61229..5f7952c2ec2 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -109,9 +109,10 @@ struct w32_display_info *x_display_list; | |||
| 109 | Lisp_Object w32_display_name_list; | 109 | Lisp_Object w32_display_name_list; |
| 110 | 110 | ||
| 111 | 111 | ||
| 112 | #if _WIN32_WINNT < 0x0500 | 112 | #if _WIN32_WINNT < 0x0500 && !defined(_W64) |
| 113 | /* Pre Windows 2000, this was not available, but define it here so | 113 | /* Pre Windows 2000, this was not available, but define it here so |
| 114 | that Emacs compiled on such a platform will run on newer versions. */ | 114 | that Emacs compiled on such a platform will run on newer versions. |
| 115 | MinGW64 (_W64) defines these unconditionally, so avoid redefining. */ | ||
| 115 | 116 | ||
| 116 | typedef struct tagWCRANGE | 117 | typedef struct tagWCRANGE |
| 117 | { | 118 | { |