diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h index 6e76a3f8e..a8b14073d 100644 --- a/include/flatbuffers/base.h +++ b/include/flatbuffers/base.h @@ -199,7 +199,7 @@ namespace flatbuffers { // to detect a header that provides an implementation #if defined(__has_include) // Check for std::string_view (in c++17) - #if __has_include() && (__cplusplus >= 201606 || _HAS_CXX17) + #if __has_include() && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17)) #include namespace flatbuffers { typedef std::string_view string_view;