]> git.eshelyaron.com Git - emacs.git/commitdiff
Attempt to fix time_t related problems with MinGW 4.0 runtime.
authorEli Zaretskii <eliz@gnu.org>
Mon, 14 Oct 2013 16:23:10 +0000 (19:23 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 14 Oct 2013 16:23:10 +0000 (19:23 +0300)
 nt/inc/mingw_time.h: New file.
 nt/inc/ms-w32.h: Include mingw_time.h instead of doing its job.

 src/w32proc.c: Include mingw_time.h.
 src/w32.c: Include mingw_time.h.

nt/ChangeLog
nt/inc/mingw_time.h [new file with mode: 0644]
nt/inc/ms-w32.h
src/ChangeLog
src/w32.c
src/w32proc.c

index cdd9ec60b11d3ceca1f6874238a8876464587217..b8bbddda6e5da2f1bc914cbff6e819ce3950e1af 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-14  Eli Zaretskii  <eliz@gnu.org>
+
+       * inc/mingw_time.h: New file.
+
+       * inc/ms-w32.h: Include mingw_time.h instead of doing its job.
+
 2013-10-12  Eli Zaretskii  <eliz@gnu.org>
 
        * inc/dirent.h (struct dirent) [__MINGW_MAJOR_VERSION >= 4]: Make
diff --git a/nt/inc/mingw_time.h b/nt/inc/mingw_time.h
new file mode 100644 (file)
index 0000000..ef6eeaf
--- /dev/null
@@ -0,0 +1,32 @@
+/* Fix issues related to MinGW 4.x handling of time data types.  */
+
+#ifndef _MINGW_TIME_H
+#define _MINGW_TIME_H
+
+/* The @#$%^&! MinGW developers stopped updating the values of
+   __MINGW32_VERSION, __MINGW32_MAJOR_VERSION, and
+   __MINGW32_MINOR_VERSION values in v4.x of the runtime, to
+   "discourage its uses".  So the values of those macros can no longer
+   be trusted, and we need the workaround below, to have a single set
+   of macros we can trust.  (The .17 minor version is arbitrary.)  */
+#ifdef __MINGW32__
+#include <_mingw.h>
+#endif
+/* MinGW64 doesn't have this problem, and does not define
+   __MINGW_VERSION.  */
+#ifndef __MINGW64_VERSION_MAJOR
+# ifndef __MINGW_VERSION
+#  define __MINGW_VERSION 3.17
+#  undef __MINGW_MAJOR_VERSION
+#  define __MINGW_MAJOR_VERSION 3
+#  undef __MINGW_MINOR_VERSION
+#  define __MINGW_MINOR_VERSION 17
+#  undef __MINGW_PATCHLEVEL
+#  define __MINGW_PATCHLEVEL 0
+# endif
+#endif
+#if __MINGW_MAJOR_VERSION >= 4
+# define _USE_32BIT_TIME_T
+#endif
+
+#endif
index d5257d9a9378573ba978a59c000e9540c448a585..e27ae4daf4f23aed3fcfed7d8f1d081194b7bc0f 100644 (file)
@@ -24,31 +24,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define WINDOWSNT
 #endif
 
-/* The @#$%^&! MinGW developers stopped updating the values of
-   __MINGW32_VERSION, __MINGW32_MAJOR_VERSION, and
-   __MINGW32_MINOR_VERSION values in v4.x of the runtime, to
-   "discourage its uses".  So the values of those macros can no longer
-   be trusted, and we need the workaround below, to have a single set
-   of macros we can trust.  (The .17 minor version is arbitrary.)  */
-#ifdef __MINGW32__
-#include <_mingw.h>
-#endif
-/* MinGW64 doesn't have this problem, and does not define
-   __MINGW_VERSION.  */
-#ifndef __MINGW64_VERSION_MAJOR
-# ifndef __MINGW_VERSION
-#  define __MINGW_VERSION 3.17
-#  undef __MINGW_MAJOR_VERSION
-#  define __MINGW_MAJOR_VERSION 3
-#  undef __MINGW_MINOR_VERSION
-#  define __MINGW_MINOR_VERSION 17
-#  undef __MINGW_PATCHLEVEL
-#  define __MINGW_PATCHLEVEL 0
-# endif
-#endif
-#if __MINGW_MAJOR_VERSION >= 4
-# define _USE_32BIT_TIME_T
-#endif
+#include <mingw_time.h>
 
 /* #undef const */
 
index 018489bdbc249448a0c44fe7b9515f23f2a5c7f7..0349cc8b9b0a6d0be2c0ba45e17175f1f6360491 100644 (file)
@@ -1,5 +1,9 @@
 2013-10-14  Eli Zaretskii  <eliz@gnu.org>
 
+       * w32proc.c: Include mingw_time.h.
+
+       * w32.c: Include mingw_time.h.
+
        Implement scrolling of TTY menus when the screen is too short.
 
        * term.c (tty_menu_display): Accept an additional argument, the
index 1dcf46b5f4bc1b83819256e1986be0de8cf4ae0a..c6b8dfed9dc83cdc55b45daa3efe3cbf3485e4cc 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -19,6 +19,8 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /*
    Geoff Voelker (voelker@cs.washington.edu)                         7-29-94
 */
+
+#include <mingw_time.h>
 #include <stddef.h> /* for offsetof */
 #include <stdlib.h>
 #include <stdio.h>
index 221b42fb7b262edc77e67794ab7ff184e3f503cc..ea16f26a0ee4fcc4aaeefaf09a29e70d6c2256b7 100644 (file)
@@ -21,6 +21,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
      Adapted from alarm.c by Tim Fleehart
 */
 
+#include <mingw_time.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>