Skip to content

Commit 550ab6e

Browse files
authored
Backport of some build-related flatbuffers changes (#825)
* From flatbuffers upstream: Fix compiler error Original author of change: avaliente-bc Backport/update from upstream flatbuffers repository. Change taken from google/flatbuffers#7227 * From flatbuffers upstream: Fix include of string_view with C++17 abseil Original author of change: ocpalo Backport/update from upstream flatbuffers repository. Changes taken from google/flatbuffers#7897.
1 parent b95135b commit 550ab6e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

include/behaviortree_cpp_v3/flatbuffers/base.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,17 @@ namespace flatbuffers {
237237
}
238238
#define FLATBUFFERS_HAS_STRING_VIEW 1
239239
// Check for absl::string_view
240-
#elif __has_include("absl/strings/string_view.h")
241-
#include "absl/strings/string_view.h"
242-
namespace flatbuffers {
243-
typedef absl::string_view string_view;
244-
}
245-
#define FLATBUFFERS_HAS_STRING_VIEW 1
240+
#elif __has_include("absl/strings/string_view.h") && \
241+
__has_include("absl/base/config.h") && \
242+
(__cplusplus >= 201411)
243+
#include "absl/base/config.h"
244+
#if !defined(ABSL_USES_STD_STRING_VIEW)
245+
#include "absl/strings/string_view.h"
246+
namespace flatbuffers {
247+
typedef absl::string_view string_view;
248+
}
249+
#define FLATBUFFERS_HAS_STRING_VIEW 1
250+
#endif
246251
#endif
247252
#endif // __has_include
248253
#endif // !FLATBUFFERS_HAS_STRING_VIEW

include/behaviortree_cpp_v3/flatbuffers/stl_emulation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ class span FLATBUFFERS_FINAL_CLASS {
625625
private:
626626
// This is a naive implementation with 'count_' member even if (Extent != dynamic_extent).
627627
pointer const data_;
628-
const size_type count_;
628+
size_type count_;
629629
};
630630

631631
#if !defined(FLATBUFFERS_SPAN_MINIMAL)

0 commit comments

Comments
 (0)