Allow darwin to provide additional definitions and implementation
specifc values for tgmath.h on Apple platforms.
rdar://problem/
19019845
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289181
91177308-0d34-0410-b5e6-
96231b3b80d8
#ifndef __TGMATH_H
#define __TGMATH_H
+/*
+ * Allow additional definitions and implementation-defined values on Apple
+ * platforms.
+ */
+#if defined(__APPLE__) && __STDC_HOSTED__ && __has_include_next(<tgmath.h>)
+# include_next <tgmath.h>
+#else
+
/* C99 7.22 Type-generic math <tgmath.h>. */
#include <math.h>
#undef _TG_ATTRS
#endif /* __cplusplus */
+#endif /* __has_include_next */
#endif /* __TGMATH_H */
--- /dev/null
+#ifndef SYS_TGMATH_H
+#define SYS_TGMATH_H
+
+#endif /* SYS_TGMATH_H */
--- /dev/null
+// REQUIRES: system-darwin
+// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only -std=c11 -isysroot %S/Inputs %s
+#include <tgmath.h>
+
+// Test the #include_next on tgmath.h works on Darwin.
+#ifndef SYS_TGMATH_H
+ #error "SYS_TGMATH_H not defined"
+#endif
+
+#ifndef __TGMATH_H
+ #error "__TGMATH_H not defined"
+#endif