mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 05:58:07 +00:00
additional check for absl::string_view availability (#7897)
absl::string_view is uses std::string_view when available. It already checks if std::string_view is available in the earlier code. It should only use absl::string_view implementation. Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -233,12 +233,17 @@ namespace flatbuffers {
|
|||||||
}
|
}
|
||||||
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
||||||
// Check for absl::string_view
|
// Check for absl::string_view
|
||||||
#elif __has_include("absl/strings/string_view.h") && (__cplusplus >= 201411)
|
#elif __has_include("absl/strings/string_view.h") && \
|
||||||
#include "absl/strings/string_view.h"
|
__has_include("absl/base/config.h") && \
|
||||||
namespace flatbuffers {
|
(__cplusplus >= 201411)
|
||||||
typedef absl::string_view string_view;
|
#include "absl/base/config.h"
|
||||||
}
|
#if !defined(ABSL_USES_STD_STRING_VIEW)
|
||||||
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
#include "absl/strings/string_view.h"
|
||||||
|
namespace flatbuffers {
|
||||||
|
typedef absl::string_view string_view;
|
||||||
|
}
|
||||||
|
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif // __has_include
|
#endif // __has_include
|
||||||
#endif // !FLATBUFFERS_HAS_STRING_VIEW
|
#endif // !FLATBUFFERS_HAS_STRING_VIEW
|
||||||
|
|||||||
Reference in New Issue
Block a user