]> granicus.if.org Git - clang/commitdiff
If there's no math.h, then tgmath.h should just be empty
authorDouglas Gregor <dgregor@apple.com>
Sun, 29 Jan 2012 22:35:57 +0000 (22:35 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 29 Jan 2012 22:35:57 +0000 (22:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149209 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/tgmath.h
test/Modules/compiler_builtins.m

index 1b0b9d24c1d52d90d025c8b199a97b32c7ec42dc..0617ae2ddb3a23dfd7f28243b145d9ffd11c6937 100644 (file)
@@ -26,6 +26,7 @@
 #define __TGMATH_H
 
 /* C99 7.22 Type-generic math <tgmath.h>. */
+#if __has_include(<math.h>)
 #include <math.h>
 
 /* C++ handles type genericity with overloading in math.h. */
@@ -1354,4 +1355,5 @@ static long double
 #undef _TG_ATTRS
 
 #endif /* __cplusplus */
+#endif /* __has_include(<math.h>) */
 #endif /* __TGMATH_H */
index 254494a2423b418cb13d829f2b5c0c4925f014c3..3cf24142d33a9e1c1c35ce1c1ce1f08f950c7549 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -verify %s
 
 @import __compiler_builtins.float_constants;
 
@@ -9,5 +9,4 @@ float getFltMax() { return FLT_MAX; }
 
 char getCharMax() { return CHAR_MAX; }
 
-// FIXME: Re-enable this test.
-//size_t size; // expected-error{{unknown type name 'size_t'}}
+size_t size; // expected-error{{unknown type name 'size_t'}}