From 559b4164096d026a73604055e5014361faf70a10 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 5 May 2024 17:34:46 -0700 Subject: [PATCH] Adapt llvmorg-19-init-9119-g4ec9a662d388: startswith/endswith removal --- src/clang_tu.hh | 5 +++++ src/indexer.hh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/clang_tu.hh b/src/clang_tu.hh index cba38e56..b3288eb7 100644 --- a/src/clang_tu.hh +++ b/src/clang_tu.hh @@ -21,6 +21,11 @@ namespace vfs = clang::vfs; #define isAsciiIdentifierContinue isIdentifierBody #endif +#if LLVM_VERSION_MAJOR >= 19 +#define startswith starts_with +#define endswith ends_with +#endif + namespace ccls { #if LLVM_VERSION_MAJOR < 19 std::string pathFromFileEntry(const clang::FileEntry &file); diff --git a/src/indexer.hh b/src/indexer.hh index 11e7133b..723cda8b 100644 --- a/src/indexer.hh +++ b/src/indexer.hh @@ -18,6 +18,11 @@ #include #include +#if LLVM_VERSION_MAJOR >= 19 +#define startswith starts_with +#define endswith ends_with +#endif + namespace std { template <> struct hash { std::size_t operator()(clang::FileID fid) const { return fid.getHashValue(); }