Skip to content

Commit

Permalink
Backport of some build-related flatbuffers changes (#825)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
ltoenning committed May 30, 2024
1 parent b95135b commit 550ab6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions include/behaviortree_cpp_v3/flatbuffers/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,17 @@ namespace flatbuffers {
}
#define FLATBUFFERS_HAS_STRING_VIEW 1
// Check for absl::string_view
#elif __has_include("absl/strings/string_view.h")
#include "absl/strings/string_view.h"
namespace flatbuffers {
typedef absl::string_view string_view;
}
#define FLATBUFFERS_HAS_STRING_VIEW 1
#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
#endif // !FLATBUFFERS_HAS_STRING_VIEW
Expand Down
2 changes: 1 addition & 1 deletion include/behaviortree_cpp_v3/flatbuffers/stl_emulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ class span FLATBUFFERS_FINAL_CLASS {
private:
// This is a naive implementation with 'count_' member even if (Extent != dynamic_extent).
pointer const data_;
const size_type count_;
size_type count_;
};

#if !defined(FLATBUFFERS_SPAN_MINIMAL)
Expand Down

0 comments on commit 550ab6e

Please sign in to comment.