summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/stdint.h
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-05-03 23:00:48 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-05-03 23:00:48 +0000
commit7df3447c101fa07edf7d36d8f1763dc5ca69cb90 (patch)
treedd066d02f7d48a1b512239475b85cb2ef4e7e176 /clang/lib/Headers/stdint.h
parentb8c4fd8cfd27dbc63e1706729be4b330bf946a0c (diff)
downloadbcm5719-llvm-7df3447c101fa07edf7d36d8f1763dc5ca69cb90.tar.gz
bcm5719-llvm-7df3447c101fa07edf7d36d8f1763dc5ca69cb90.zip
Fix for PR3841: follow gcc's example and fall back to the system
stdint.h unless we are freestanding. Any suggestions here are welcome. llvm-svn: 70806
Diffstat (limited to 'clang/lib/Headers/stdint.h')
-rw-r--r--clang/lib/Headers/stdint.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/Headers/stdint.h b/clang/lib/Headers/stdint.h
index 46eff354eda..a7020d838ec 100644
--- a/clang/lib/Headers/stdint.h
+++ b/clang/lib/Headers/stdint.h
@@ -22,8 +22,15 @@
*
\*===----------------------------------------------------------------------===*/
-#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 */
OpenPOWER on IntegriCloud