diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index 89268d62b..b281a4b49 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -1,5 +1,17 @@ | |||
1 | #include <sys/utime.h> | 1 | #include <sys/utime.h> |
2 | 2 | ||
3 | /* | ||
4 | * MS Windows has broken versions of snprintf/vsnprintf that return -1 if | ||
5 | * the string is too large for the buffer and don't null terminate the | ||
6 | * string if it fills the buffer. However, if we're using a sufficiently | ||
7 | * modern version of MinGW and have an appropriate source code qualifier | ||
8 | * (such as _GNU_SOURCE) MinGW will use its own standards-compliant | ||
9 | * implementation. Check for this. | ||
10 | */ | ||
11 | #if !defined(__USE_MINGW_ANSI_STDIO) | ||
12 | #error "Must use MinGW stdio for snprintf/vsnprintf" | ||
13 | #endif | ||
14 | |||
3 | #define NOIMPL(name,...) static inline int name(__VA_ARGS__) { errno = ENOSYS; return -1; } | 15 | #define NOIMPL(name,...) static inline int name(__VA_ARGS__) { errno = ENOSYS; return -1; } |
4 | #define IMPL(name,ret,retval,...) static inline ret name(__VA_ARGS__) { return retval; } | 16 | #define IMPL(name,ret,retval,...) static inline ret name(__VA_ARGS__) { return retval; } |
5 | 17 | ||