summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaewook Oh <twoh@fb.com>2019-02-08 17:15:50 +0000
committerTaewook Oh <twoh@fb.com>2019-02-08 17:15:50 +0000
commit91c32fd8c8fa395971a028f7091273fa2c8f44e6 (patch)
tree8f3c41011eb12917dd9d495e9090950994efe1e3
parent3ce8112dad683737d415abb0fe33a2e442e29c32 (diff)
downloadbcm5719-llvm-91c32fd8c8fa395971a028f7091273fa2c8f44e6.tar.gz
bcm5719-llvm-91c32fd8c8fa395971a028f7091273fa2c8f44e6.zip
Guard a feature that unsupported by old GCC
Summary: As @david2050 commented, changes introduced by https://reviews.llvm.org/D56397 break builds for older compilers which don't support `__has(_cpp)_attribute`. This is a fix for the break. Reviewers: protze.joachim, jlpeyton, AndreyChurbanov, Hahnfeld, david2050 Subscribers: openmp-commits, david2050 Tags: #openmp Differential Revision: https://reviews.llvm.org/D57851 llvm-svn: 353538
-rw-r--r--openmp/runtime/src/kmp_os.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
index f229cccbb50..a553463bd8d 100644
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -39,6 +39,14 @@
#define KMP_MEM_CONS_MODEL KMP_MEM_CONS_VOLATILE
#endif
+#ifndef __has_cpp_attribute
+#define __has_cpp_attribute(x) 0
+#endif
+
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
/* ------------------------- Compiler recognition ---------------------- */
#define KMP_COMPILER_ICC 0
#define KMP_COMPILER_GCC 0
@@ -304,7 +312,7 @@ extern "C" {
# define KMP_FALLTHROUGH() [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
# define KMP_FALLTHROUGH() [[clang::fallthrough]]
-#elif __has_attribute(fallthough) || _GNUC_VER >= 700
+#elif __has_attribute(fallthough) || __GNUC__ >= 7
# define KMP_FALLTHROUGH() __attribute__((__fallthrough__))
#else
# define KMP_FALLTHROUGH() ((void)0)
OpenPOWER on IntegriCloud