aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hunt <rideau3@gmail.com>2010-06-15 02:36:48 +0000
committerSean Hunt <rideau3@gmail.com>2010-06-15 02:36:48 +0000
commit88318139c94cef1a77cce969613bbc0745d7e99f (patch)
tree448fc600e1f5cdbd2bb0854a0363668e7e41ce6b
parentfcd783d583d270b7ec1ec3e0fcf83cd93d30e381 (diff)
MinGW requires that wint_t be defined in stddef.h. In order to accomodate, we
won't define it unless specifically requested via the use of __need_wint_t. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105985 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Headers/stddef.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Headers/stddef.h b/lib/Headers/stddef.h
index 6868ad341f..b1d0d52874 100644
--- a/lib/Headers/stddef.h
+++ b/lib/Headers/stddef.h
@@ -45,6 +45,13 @@ typedef __typeof__(*L"") wchar_t;
#define NULL ((void*)0)
#endif
+// Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
+// __WINT_TYPE__ directly; accomodate both by requiring __need_wint_t
+#if defined(__need_wint_t) && !defined(_WINT_T)
+#define _WINT_T
+typedef __WINT_TYPE__ wint_t;
+#endif
+
#define offsetof(t, d) __builtin_offsetof(t, d)
#endif /* __STDDEF_H */