Teach tgmath.h to only include <complex.h> if it's available.

llvm-svn: 149213
This commit is contained in:
Douglas Gregor 2012-01-29 23:40:50 +00:00
parent 8277797e3d
commit e8f900bdcc
2 changed files with 5 additions and 3 deletions

View File

@ -30,7 +30,9 @@
/* C++ handles type genericity with overloading in math.h. */
#ifndef __cplusplus
#include <complex.h>
#if __has_include(<complex.h>)
# include <complex.h>
#endif
#define _TG_ATTRSp __attribute__((__overloadable__))
#define _TG_ATTRS __attribute__((__overloadable__, __always_inline__))

View File

@ -1,5 +1,5 @@
// RUN: rm -rf %t
// RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t %s
// RUN: %clang -fsyntax-only -fmodules -fmodule-cache-path %t %s -Xclang -verify
@import __compiler_builtins.float_constants;
@ -9,4 +9,4 @@ float getFltMax() { return FLT_MAX; }
char getCharMax() { return CHAR_MAX; }
//size_t size; // expected-error{{unknown type name 'size_t'}}
size_t size; // expected-error{{unknown type name 'size_t'}}