1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00

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.
This commit is contained in:
Eli Zaretskii 2013-10-14 19:23:10 +03:00
parent ccd4a7833f
commit 279066b2b3
6 changed files with 46 additions and 25 deletions

View 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

32
nt/inc/mingw_time.h Normal file
View File

@ -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

View 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 */

View 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

View File

@ -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>

View 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>