File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 139139#endif // !defined(FLATBUFFERS_LITTLEENDIAN)
140140
141141#define FLATBUFFERS_VERSION_MAJOR 23
142- #define FLATBUFFERS_VERSION_MINOR 1
143- #define FLATBUFFERS_VERSION_REVISION 21
142+ #define FLATBUFFERS_VERSION_MINOR 3
143+ #define FLATBUFFERS_VERSION_REVISION 3
144144#define FLATBUFFERS_STRING_EXPAND (X ) #X
145145#define FLATBUFFERS_STRING (X ) FLATBUFFERS_STRING_EXPAND(X)
146146namespace flatbuffers {
@@ -233,7 +233,7 @@ namespace flatbuffers {
233233 }
234234 #define FLATBUFFERS_HAS_STRING_VIEW 1
235235 // Check for absl::string_view
236- #elif __has_include("absl/strings/string_view.h")
236+ #elif __has_include("absl/strings/string_view.h") && (__cplusplus >= 201411)
237237 #include " absl/strings/string_view.h"
238238 namespace flatbuffers {
239239 typedef absl::string_view string_view;
Original file line number Diff line number Diff line change 4141 #include < optional>
4242#endif
4343
44- // The __cpp_lib_span is the predefined feature macro.
45- #if defined(FLATBUFFERS_USE_STD_SPAN)
46- #include < span>
47- #elif defined(__cpp_lib_span) && defined(__has_include)
48- #if __has_include(<span>)
49- #include < array>
50- #include < span>
51- #define FLATBUFFERS_USE_STD_SPAN
44+ #ifndef FLATBUFFERS_USE_STD_SPAN
45+ // Testing __cpp_lib_span requires including either <version> or <span>,
46+ // both of which were added in C++20.
47+ // See: https://en.cppreference.com/w/cpp/utility/feature_test
48+ #if defined(__cplusplus) && __cplusplus >= 202002L
49+ #define FLATBUFFERS_USE_STD_SPAN 1
5250 #endif
51+ #endif // FLATBUFFERS_USE_STD_SPAN
52+
53+ #if defined(FLATBUFFERS_USE_STD_SPAN)
54+ #include < array>
55+ #include < span>
5356#else
5457 // Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined.
5558 #if !defined(FLATBUFFERS_TEMPLATES_ALIASES)
Original file line number Diff line number Diff line change 99// Ensure the included flatbuffers.h is the same version as when this file was
1010// generated, otherwise it may not be compatible.
1111static_assert (FLATBUFFERS_VERSION_MAJOR == 23 &&
12- FLATBUFFERS_VERSION_MINOR == 1 &&
13- FLATBUFFERS_VERSION_REVISION == 21 ,
12+ FLATBUFFERS_VERSION_MINOR == 3 &&
13+ FLATBUFFERS_VERSION_REVISION == 3 ,
1414 " Non-compatible flatbuffers version included" );
1515
1616namespace mslb {
You can’t perform that action at this time.
0 commit comments