Fix build with gcc version 7.4.0 (#5570)
authorBrian Harris <BrianHarris@users.noreply.github.com>
Tue, 15 Oct 2019 17:56:58 +0000 (12:56 -0500)
committerWouter van Oortmerssen <aardappel@gmail.com>
Tue, 15 Oct 2019 17:56:58 +0000 (10:56 -0700)
include/flatbuffers/base.h

index 6e76a3f..a8b1407 100644 (file)
@@ -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(<string_view>) && (__cplusplus >= 201606 || _HAS_CXX17)
+    #if __has_include(<string_view>) && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17))
       #include <string_view>
       namespace flatbuffers {
         typedef std::string_view string_view;