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 /nt | |
| 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.
Diffstat (limited to 'nt')
| -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 |
5 files changed, 43 insertions, 8 deletions
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 *); |