[cfe-commits] r149213 - in /cfe/trunk: lib/Headers/tgmath.h test/Modules/compiler_builtins.m

Douglas Gregor dgregor at apple.com
Sun Jan 29 15:40:50 PST 2012


Author: dgregor
Date: Sun Jan 29 17:40:50 2012
New Revision: 149213

URL: http://llvm.org/viewvc/llvm-project?rev=149213&view=rev
Log:
Teach tgmath.h to only include <complex.h> if it's available.

Modified:
    cfe/trunk/lib/Headers/tgmath.h
    cfe/trunk/test/Modules/compiler_builtins.m

Modified: cfe/trunk/lib/Headers/tgmath.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/tgmath.h?rev=149213&r1=149212&r2=149213&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/tgmath.h (original)
+++ cfe/trunk/lib/Headers/tgmath.h Sun Jan 29 17:40:50 2012
@@ -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__))

Modified: cfe/trunk/test/Modules/compiler_builtins.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins.m?rev=149213&r1=149212&r2=149213&view=diff
==============================================================================
--- cfe/trunk/test/Modules/compiler_builtins.m (original)
+++ cfe/trunk/test/Modules/compiler_builtins.m Sun Jan 29 17:40:50 2012
@@ -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 @@
 
 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'}}





More information about the cfe-commits mailing list