Commit 553fabe7 authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent b234d92c
2013-03-25 Eli Zaretskii <eliz@gnu.org>
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 <eliz@gnu.org>
Fix the MSVC build. (Bug#13939)
......
......@@ -127,6 +127,15 @@ typedef unsigned short mode_t;
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 @@ int _getpid (void);
/* '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 sigset_t;
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 @@ extern char *get_emacs_configuration_options (void);
#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
......
......@@ -23,11 +23,14 @@ void gettimeofday (struct timeval *, struct timezone *);
#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 *);
......
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