emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112130: Fix incompatibilities betwee


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112130: Fix incompatibilities between MinGW.org and MinGW64 headers
Date: Mon, 25 Mar 2013 15:48:37 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112130
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2013-03-25 15:48:37 +0200
message:
  Fix incompatibilities between MinGW.org and MinGW64 headers
  
  Problems were reported by ׃scar Fuentes in
   
    http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00611.html.
  
   nt/inc/ms-w32.h (struct timespec): Don't define if
   _TIMESPEC_DEFINED is already defined.
   (sigset_t) [!_POSIX]: Typedef for MinGW64.
   (_WIN32_WINNT, WIN32_LEAN_AND_MEAN): Move definitions before
   including the first system header, to avoid redefinition if some
   system header defines a default value.
   nt/inc/sys/time.h (struct itimerval): Don't define if
   _TIMESPEC_DEFINED is already defined.
modified:
  nt/ChangeLog
  nt/inc/ms-w32.h
  nt/inc/sys/time.h
=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2013-03-16 08:55:38 +0000
+++ b/nt/ChangeLog      2013-03-25 13:48:37 +0000
@@ -1,3 +1,18 @@
+2013-03-25  Eli Zaretskii  <address@hidden>
+
+       Fix incompatibilities between MinGW.org and MinGW64 headers
+       reported by Óscar Fuentes in
+       http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00611.html.
+       * inc/ms-w32.h (struct timespec): Don't define if
+       _TIMESPEC_DEFINED is already defined.
+       (sigset_t) [!_POSIX]: Typedef for MinGW64.
+       (_WIN32_WINNT, WIN32_LEAN_AND_MEAN): Move definitions before
+       including the first system header, to avoid redefinition if some
+       system header defines a default value.
+
+       * inc/sys/time.h (struct itimerval): Don't define if
+       _TIMESPEC_DEFINED is already defined.
+
 2013-03-16  Eli Zaretskii  <address@hidden>
 
        Fix the MSVC build.  (Bug#13939)

=== modified file 'nt/inc/ms-w32.h'
--- a/nt/inc/ms-w32.h   2013-03-13 18:42:22 +0000
+++ b/nt/inc/ms-w32.h   2013-03-25 13:48:37 +0000
@@ -127,6 +127,15 @@
 extern char *getenv ();
 #endif
 
+/* 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
+
+/* Make a leaner executable.  */
+#define WIN32_LEAN_AND_MEAN 1
+
 #ifdef HAVE_STRINGS_H
 #include "strings.h"
 #endif
@@ -266,11 +275,14 @@
 /* 'struct timespec' is used by time-related functions in lib/ and
    elsewhere, but we don't use lib/time.h where the structure is
    defined.  */
+/* MinGW64 defines 'struct timespec' and _TIMESPEC_DEFINED in sys/types.h.  */
+#ifndef _TIMESPEC_DEFINED
 struct timespec
 {
   time_t       tv_sec;         /* seconds */
   long int     tv_nsec;        /* nanoseconds */
 };
+#endif
 
 /* Required for functions in lib/time_r.c, since we don't use lib/time.h.  */
 extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
@@ -321,6 +333,10 @@
 typedef int ssize_t;
 #endif
 
+#ifndef _POSIX /* MinGW64 */
+typedef _sigset_t sigset_t;
+#endif
+
 typedef void (_CALLBACK_ *signal_handler) (int);
 extern signal_handler sys_signal (int, signal_handler);
 
@@ -366,13 +382,6 @@
 #define _WINSOCKAPI_    1
 #define _WINSOCK_H
 
-/* Prevent accidental use of features unavailable in
-   older Windows versions we still support.  */
-#define _WIN32_WINNT 0x0400
-
-/* Make a leaner executable.  */
-#define WIN32_LEAN_AND_MEAN 1
-
 /* Defines size_t and alloca ().  */
 #ifdef emacs
 #define malloc e_malloc

=== modified file 'nt/inc/sys/time.h'
--- a/nt/inc/sys/time.h 2012-09-30 15:49:05 +0000
+++ b/nt/inc/sys/time.h 2013-03-25 13:48:37 +0000
@@ -23,11 +23,14 @@
 #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 *);


reply via email to

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