If there's no math.h, then tgmath.h should just be empty

llvm-svn: 149209
This commit is contained in:
Douglas Gregor 2012-01-29 22:35:57 +00:00
parent fc5aae33b7
commit b9f9aea13c
2 changed files with 4 additions and 3 deletions

View 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 */

View 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'}}