aboutsummaryrefslogtreecommitdiffstats
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2013-03-26 10:21:27 +0200
committerEli Zaretskii <[email protected]>2013-03-26 10:21:27 +0200
commitb88b62dec99cec327c6bae67ef4d3a8bc5b601ca (patch)
tree2d3d5acaabe9d9e124c90bfae57bddf3dc355c19 /nt
parent69b2c07eaf592dee54ccd9bdb5f38dce88d1f221 (diff)
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/ChangeLog20
-rw-r--r--nt/addpm.c4
-rw-r--r--nt/inc/ms-w32.h8
-rw-r--r--nt/inc/sys/stat.h10
-rw-r--r--nt/inc/sys/time.h9
5 files changed, 43 insertions, 8 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 20579d36c7..f4fa0a7ee5 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,23 @@
+2013-03-26 Eli Zaretskii <[email protected]>
+
+ 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 <[email protected]>
Fix incompatibilities between MinGW.org and MinGW64 headers
diff --git a/nt/addpm.c b/nt/addpm.c
index 6ed625d908..8079d51dd6 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/>. */
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
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index d3faa6d2b2..ccab3695c6 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -154,6 +154,14 @@ extern char *getenv ();
#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>
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index c356283c04..31129bbf4f 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -106,11 +106,11 @@ extern int w32_stat_get_owner_group;
/* Prevent redefinition by other headers, e.g. wchar.h. */
#define _STAT_DEFINED
-_CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*);
-_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 *,
+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);
#endif /* INC_SYS_STAT_H_ */
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h
index e49f0ea4de..80c725385b 100644
--- a/nt/inc/sys/time.h
+++ b/nt/inc/sys/time.h
@@ -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 *);