X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/b1f7435d66a93f03b77932b3a9ad8a83ce5e1ebc..d425e3882ca60fabae080ddb890789ef2e73a66b:/src/ld/ld.hpp diff --git a/src/ld/ld.hpp b/src/ld/ld.hpp index ed021ff..7be00a3 100644 --- a/src/ld/ld.hpp +++ b/src/ld/ld.hpp @@ -788,6 +788,20 @@ public: + +// utility classes for using std::unordered_map with c-strings +struct CStringHash { + size_t operator()(const char* __s) const { + size_t __h = 0; + for ( ; *__s; ++__s) + __h = 5 * __h + *__s; + return __h; + }; +}; +struct CStringEquals +{ + bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } +};