From 01366408c9df773897bdd669cd4371d099f483bb Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 19 Sep 2012 14:59:27 +0100 Subject: mingw.h: fixes for MinGW-w64 --- include/mingw.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/include/mingw.h b/include/mingw.h index fdcd7f709..b39fcae3d 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -1,17 +1,5 @@ #include -/* - * MS Windows has broken versions of snprintf/vsnprintf that return -1 if - * the string is too large for the buffer and don't null terminate the - * string if it fills the buffer. However, if we're using a sufficiently - * modern version of MinGW and have an appropriate source code qualifier - * (such as _GNU_SOURCE) MinGW will use its own standards-compliant - * implementation. Check for this. - */ -#if !defined(__USE_MINGW_ANSI_STDIO) -#error "Must use MinGW stdio for snprintf/vsnprintf" -#endif - #define NOIMPL(name,...) static inline int name(__VA_ARGS__) { errno = ENOSYS; return -1; } #define IMPL(name,ret,retval,...) static inline ret name(__VA_ARGS__) { return retval; } @@ -142,6 +130,8 @@ int mingw_rename(const char*, const char*); FILE *mingw_popen(const char *cmd, const char *mode); int mingw_pclose(FILE *fd); +#undef popen +#undef pclose #define popen mingw_popen #define pclose mingw_pclose @@ -268,10 +258,13 @@ int mingw_fstat(int fd, struct stat *buf); /* * sys/time.h */ +#ifndef _TIMESPEC_DEFINED +#define _TIMESPEC_DEFINED struct timespec { time_t tv_sec; long int tv_nsec; }; +#endif struct itimerval { struct timeval it_value, it_interval; }; -- cgit v1.2.3-55-g6feb