]> granicus.if.org Git - clang/commitdiff
lib/Headers/stddef.h: wint_t should be defined whenever <stddef.h> is included with...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 19 Oct 2010 03:42:41 +0000 (03:42 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 19 Oct 2010 03:42:41 +0000 (03:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116794 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/stddef.h

index 84ec1a7b4e24a14fca53688e25a90c1cc8305b8c..7cc0bc1a75fdfcad4ebb80ff86a6f16ace182bbe 100644 (file)
@@ -46,13 +46,16 @@ typedef __WCHAR_TYPE__ 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 */
+
+/* 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)
+#if !defined(_WINT_T)
+#define _WINT_T
+typedef __WINT_TYPE__ wint_t;
+#endif /* _WINT_T */
+#undef __need_wint_t
+#endif /* __need_wint_t */