Commit 279066b2 authored by Eli Zaretskii's avatar Eli Zaretskii

Attempt to fix time_t related problems with MinGW 4.0 runtime.

 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.
parent ccd4a783
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
......
/* 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
......@@ -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 */
......
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
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment