diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-15 02:02:52 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-15 02:46:48 +0300 |
commit | a880209efe5a0fb82469d2deba6ebcf5636ecabc (patch) | |
tree | 17f1172d36ac34089982c08a0122a19c8fce47f7 /include | |
parent | mingw builds: implement proper unused parameter macro (diff) | |
download | winapi-debug-a880209efe5a0fb82469d2deba6ebcf5636ecabc.tar.gz winapi-debug-a880209efe5a0fb82469d2deba6ebcf5636ecabc.zip |
mingw builds: work around missing SymTagEnum
Diffstat (limited to '')
-rw-r--r-- | include/pdb/symbol.hpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/include/pdb/symbol.hpp b/include/pdb/symbol.hpp index b9dff85..98379d8 100644 --- a/include/pdb/symbol.hpp +++ b/include/pdb/symbol.hpp @@ -13,12 +13,26 @@ #include <DbgHelp.h> #include <Windows.h> +#include <climits> #include <cstddef> #include <cstring> #include <stdexcept> #include <string> namespace pdb { +namespace symbol { + +// MinGW-w64 (as of version 7.0) doesn't have SymTagEnum +typedef ULONG Tag; + +constexpr Tag SYM_TAG_FUNCTION = 5; + +#ifdef _MSC_VER +static_assert(static_cast<Tag>(SymTagFunction) == SYM_TAG_FUNCTION, + "unexpected SymTagFunction value"); +#endif + +} // namespace symbol class SymbolInfo { public: @@ -52,13 +66,11 @@ public: Address get_offline_address() const { return raw.Address; } - typedef ULONG Tag; - - Tag get_tag() const { return raw.Tag; } + symbol::Tag get_tag() const { return raw.Tag; } - enum class Type : Tag { - Function = SymTagFunction, - RESERVED = SymTagMax, + enum class Type : symbol::Tag { + Function = symbol::SYM_TAG_FUNCTION, + RESERVED = ULONG_MAX, }; Type get_type() const { return static_cast<Type>(get_tag()); } |