]> granicus.if.org Git - clang/commitdiff
Fix for PR3841: follow gcc's example and fall back to the system
authorEli Friedman <eli.friedman@gmail.com>
Sun, 3 May 2009 23:00:48 +0000 (23:00 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 3 May 2009 23:00:48 +0000 (23:00 +0000)
stdint.h unless we are freestanding.

Any suggestions here are welcome.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70806 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/stdint.h

index 46eff354edaf86b5c1cf9f297b59aebb3f96ceb1..a7020d838ec96558bed6390bb9a6def96042397f 100644 (file)
  *
 \*===----------------------------------------------------------------------===*/
 
-#ifndef __STDINT_H
-#define __STDINT_H
+#ifndef __CLANG_STDINT_H
+#define __CLANG_STDINT_H
+
+/* If we're hosted, fall back to the system's stdint.h, which might have
+ * additional definitions.
+ */
+#if __STDC_HOSTED__
+# include_next <stdint.h>
+#else
 
 /* We currently only support targets with power of two, 2s complement integers.
  */
@@ -221,4 +228,5 @@ typedef __UINTMAX_TYPE__ uintmax_t;
 #define INTMAX_C(v)  (v##LL)
 #define UINTMAX_C(v) (v##ULL)
 
-#endif /* __STDINT_H */
+#endif /* __STDC_HOSTED__ */
+#endif /* __CLANG_STDINT_H */