Adapt llvmorg-19-init-9119-g4ec9a662d388: startswith/endswith removal

This commit is contained in:
Fangrui Song 2024-05-05 17:34:46 -07:00
parent 88e382f8a3
commit 559b416409
2 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,11 @@ namespace vfs = clang::vfs;
#define isAsciiIdentifierContinue isIdentifierBody #define isAsciiIdentifierContinue isIdentifierBody
#endif #endif
#if LLVM_VERSION_MAJOR >= 19
#define startswith starts_with
#define endswith ends_with
#endif
namespace ccls { namespace ccls {
#if LLVM_VERSION_MAJOR < 19 #if LLVM_VERSION_MAJOR < 19
std::string pathFromFileEntry(const clang::FileEntry &file); std::string pathFromFileEntry(const clang::FileEntry &file);

View File

@ -18,6 +18,11 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#if LLVM_VERSION_MAJOR >= 19
#define startswith starts_with
#define endswith ends_with
#endif
namespace std { namespace std {
template <> struct hash<clang::FileID> { template <> struct hash<clang::FileID> {
std::size_t operator()(clang::FileID fid) const { return fid.getHashValue(); } std::size_t operator()(clang::FileID fid) const { return fid.getHashValue(); }