aboutsummaryrefslogtreecommitdiffstats
path: root/executor/_include/flatbuffers/stl_emulation.h
diff options
context:
space:
mode:
authorPimyn Girgis <pimyn@google.com>2025-12-02 12:28:10 +0000
committerTahuti <pimyn@google.com>2025-12-03 09:02:54 +0000
commit1cfbf16e320ca9bdadd9c24eb1d2d68b25369ba6 (patch)
treebe0ce827f327c8a76125307e64047e01fa449d4c /executor/_include/flatbuffers/stl_emulation.h
parent42a04216dd856c12e723e48930e85d63998e4eda (diff)
executor: update flatbuffers
Update flatbuffers to v23.5.26, which matches the compiler version in the new env container.
Diffstat (limited to 'executor/_include/flatbuffers/stl_emulation.h')
-rw-r--r--executor/_include/flatbuffers/stl_emulation.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/executor/_include/flatbuffers/stl_emulation.h b/executor/_include/flatbuffers/stl_emulation.h
index 452ddb832..fd3a8cda7 100644
--- a/executor/_include/flatbuffers/stl_emulation.h
+++ b/executor/_include/flatbuffers/stl_emulation.h
@@ -41,15 +41,18 @@
#include <optional>
#endif
-// The __cpp_lib_span is the predefined feature macro.
-#if defined(FLATBUFFERS_USE_STD_SPAN)
- #include <span>
-#elif defined(__cpp_lib_span) && defined(__has_include)
- #if __has_include(<span>)
- #include <array>
- #include <span>
- #define FLATBUFFERS_USE_STD_SPAN
+#ifndef FLATBUFFERS_USE_STD_SPAN
+ // Testing __cpp_lib_span requires including either <version> or <span>,
+ // both of which were added in C++20.
+ // See: https://en.cppreference.com/w/cpp/utility/feature_test
+ #if defined(__cplusplus) && __cplusplus >= 202002L
+ #define FLATBUFFERS_USE_STD_SPAN 1
#endif
+#endif // FLATBUFFERS_USE_STD_SPAN
+
+#if defined(FLATBUFFERS_USE_STD_SPAN)
+ #include <array>
+ #include <span>
#else
// Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined.
#if !defined(FLATBUFFERS_TEMPLATES_ALIASES)