aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-26 12:47:40 +0100
committerRon Yorston <rmy@pobox.com>2012-03-26 12:47:40 +0100
commitb11062c28d3b8b9401effcc9fd7a7f76d920461f (patch)
tree1919ed663659342e9ee082482b2e8468764e85ad /include
parent83fefff167c161716ba4a40aa4f0dce96cfd3498 (diff)
downloadbusybox-w32-b11062c28d3b8b9401effcc9fd7a7f76d920461f.tar.gz
busybox-w32-b11062c28d3b8b9401effcc9fd7a7f76d920461f.tar.bz2
busybox-w32-b11062c28d3b8b9401effcc9fd7a7f76d920461f.zip
MinGW snprintf/vsnprintf work properly
Diffstat (limited to 'include')
-rw-r--r--include/mingw.h12
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