pitrou commented on code in PR #38192:
URL: https://github.com/apache/arrow/pull/38192#discussion_r1354853607


##########
cpp/thirdparty/flatbuffers/README.md:
##########
@@ -75,48 +117,229 @@ index fccce42f6..a00d5b0fd 100644
  
  #if (!defined(_MSC_VER) || _MSC_VER > 1600) && \
      (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \
-@@ -201,16 +211,20 @@ namespace flatbuffers {
-     // Check for std::string_view (in c++17)
-     #if __has_include(<string_view>) && (__cplusplus >= 201606 || 
(defined(_HAS_CXX17) && _HAS_CXX17))
-       #include <string_view>
-+      namespace arrow_vendored_private {
-       namespace flatbuffers {
-         typedef std::string_view string_view;
-       }
-+      }
-       #define FLATBUFFERS_HAS_STRING_VIEW 1
-     // Check for std::experimental::string_view (in c++14, compiler-dependent)
-     #elif __has_include(<experimental/string_view>) && (__cplusplus >= 201411)
-       #include <experimental/string_view>
-+      namespace arrow_vendored_private {
-       namespace flatbuffers {
-         typedef std::experimental::string_view string_view;
-       }
-+      }
-       #define FLATBUFFERS_HAS_STRING_VIEW 1
-     #endif
-   #endif // __has_include
-@@ -278,6 +292,7 @@ template<typename T> FLATBUFFERS_CONSTEXPR inline bool 
IsConstTrue(T t) {
+@@ -216,37 +227,13 @@ namespace flatbuffers {
+ #endif
+ 
+ #ifndef FLATBUFFERS_HAS_STRING_VIEW
+-  // Only provide flatbuffers::string_view if __has_include can be used
+-  // 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 || 
(defined(_HAS_CXX17) && _HAS_CXX17))
+-      #include <string_view>
+-      namespace flatbuffers {
+-        typedef std::string_view string_view;
+-      }
+-      #define FLATBUFFERS_HAS_STRING_VIEW 1
+-    // Check for std::experimental::string_view (in c++14, compiler-dependent)
+-    #elif __has_include(<experimental/string_view>) && (__cplusplus >= 201411)
+-      #include <experimental/string_view>
+-      namespace flatbuffers {
+-        typedef std::experimental::string_view string_view;
+-      }
+-      #define FLATBUFFERS_HAS_STRING_VIEW 1
+-    // Check for absl::string_view
+-    #elif __has_include("absl/strings/string_view.h") && \
+-          __has_include("absl/base/config.h") && \
+-          (__cplusplus >= 201411)
+-      #include "absl/base/config.h"
+-      #if !defined(ABSL_USES_STD_STRING_VIEW)
+-        #include "absl/strings/string_view.h"
+-        namespace flatbuffers {
+-          typedef absl::string_view string_view;
+-        }
+-        #define FLATBUFFERS_HAS_STRING_VIEW 1
+-      #endif
+-    #endif
+-  #endif // __has_include
++  #include <string_view>

Review Comment:
   Is this change actually necessary or would the original "Check for 
std::string_view (in c++17)" snippet above work for us? We probably want to 
minimize the patch size.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to