diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-10-04 21:25:51 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-10-04 21:25:51 +0000 |
commit | 015839a555e7e476f1dfb16d0e8c3b98de26aaee (patch) | |
tree | cf533a8473fefe8465624c4ce14198c62a9be4b5 | |
parent | 8cabfb764d6b0390038f2d0af6f29781b4b2294b (diff) | |
download | bcm5719-llvm-015839a555e7e476f1dfb16d0e8c3b98de26aaee.tar.gz bcm5719-llvm-015839a555e7e476f1dfb16d0e8c3b98de26aaee.zip |
[libcxx] [test] Guard __has_include usage with a macro
Summary: There's a macro scheme already being used for __has_feature etc. Use it for __has_include too, which makes MSVC happy (it doesn't support __has_include yet, and unguarded use explodes horribly).
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25251
llvm-svn: 283260
-rw-r--r-- | libcxx/test/support/test_macros.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 534c13a2fe0..c751388e5f2 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -22,6 +22,12 @@ #define TEST_HAS_FEATURE(X) 0 #endif +#ifdef __has_include +#define TEST_HAS_INCLUDE(X) __has_include(X) +#else +#define TEST_HAS_INCLUDE(X) 0 +#endif + #ifdef __has_extension #define TEST_HAS_EXTENSION(X) __has_extension(X) #else @@ -63,7 +69,7 @@ #endif // Attempt to deduce GCC version -#if defined(_LIBCPP_VERSION) && __has_include(<features.h>) +#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE(<features.h>) #include <features.h> #define TEST_HAS_GLIBC #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor) |