From: Eli Zaretskii Date: Mon, 14 Oct 2013 16:23:10 +0000 (+0300) Subject: Attempt to fix time_t related problems with MinGW 4.0 runtime. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1270 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=279066b2b3a56e94c4a5dc994e0349db03a52c09;p=emacs.git 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. --- diff --git a/nt/ChangeLog b/nt/ChangeLog index cdd9ec60b11..b8bbddda6e5 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,9 @@ +2013-10-14 Eli Zaretskii + + * inc/mingw_time.h: New file. + + * inc/ms-w32.h: Include mingw_time.h instead of doing its job. + 2013-10-12 Eli Zaretskii * 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 index 00000000000..ef6eeaf0f35 --- /dev/null +++ b/nt/inc/mingw_time.h @@ -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 diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index d5257d9a937..e27ae4daf4f 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -24,31 +24,7 @@ along with GNU Emacs. If not, see . */ #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 /* #undef const */ diff --git a/src/ChangeLog b/src/ChangeLog index 018489bdbc2..0349cc8b9b0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2013-10-14 Eli Zaretskii + * 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 diff --git a/src/w32.c b/src/w32.c index 1dcf46b5f4b..c6b8dfed9dc 100644 --- a/src/w32.c +++ b/src/w32.c @@ -19,6 +19,8 @@ along with GNU Emacs. If not, see . */ /* Geoff Voelker (voelker@cs.washington.edu) 7-29-94 */ + +#include #include /* for offsetof */ #include #include diff --git a/src/w32proc.c b/src/w32proc.c index 221b42fb7b2..ea16f26a0ee 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -21,6 +21,7 @@ along with GNU Emacs. If not, see . */ Adapted from alarm.c by Tim Fleehart */ +#include #include #include #include