@@ -92,42 +92,37 @@ namespace detail {
92
92
// - https://github.com/ecatmur/stacktrace-from-exception/blob/main/stacktrace-from-exception.cpp
93
93
// - https://github.com/catboost/catboost/blob/master/contrib/libs/cxxsupp/libcxx/src/support/runtime/exception_pointer_msvc.ipp
94
94
// - https://www.geoffchappell.com/studies/msvc/language/predefined/index.htm
95
- #ifdef _WIN64
96
- #pragma pack(push, 4)
97
- struct CatchableType {
98
- std::uint32_t properties;
99
- std::int32_t pType;
100
- std::uint32_t non_virtual_adjustment; // these next three are from _PMD
101
- std::uint32_t offset_to_virtual_base_ptr;
102
- std::uint32_t virtual_base_table_index;
103
- std::uint32_t sizeOrOffset;
104
- std::int32_t copyFunction;
105
- };
106
- struct ThrowInfo {
107
- std::uint32_t attributes;
108
- std::int32_t pmfnUnwind;
109
- std::int32_t pForwardCompat;
110
- std::int32_t pCatchableTypeArray;
111
- };
112
- #pragma warning(disable:4200)
113
- #if IS_CLANG
114
- #pragma clang diagnostic push
115
- #pragma clang diagnostic ignored "-Wc99-extensions"
116
- #endif
117
- struct CatchableTypeArray {
118
- uint32_t nCatchableTypes;
119
- int32_t arrayOfCatchableTypes[];
120
- };
121
- #if IS_CLANG
122
- #pragma clang diagnostic pop
123
- #endif
124
- #pragma warning (pop)
125
- #pragma pack(pop)
126
- #else
127
- using CatchableTypeArray = ::_CatchableTypeArray;
128
- using CatchableType = ::_CatchableType;
129
- using ThrowInfo = ::_ThrowInfo;
95
+ #pragma pack(push, 4)
96
+ struct CatchableType {
97
+ std::uint32_t properties;
98
+ std::int32_t pType;
99
+ std::uint32_t non_virtual_adjustment; // these next three are from _PMD
100
+ std::uint32_t offset_to_virtual_base_ptr;
101
+ std::uint32_t virtual_base_table_index;
102
+ std::uint32_t sizeOrOffset;
103
+ std::int32_t copyFunction;
104
+ };
105
+ struct ThrowInfo {
106
+ std::uint32_t attributes;
107
+ std::int32_t pmfnUnwind;
108
+ std::int32_t pForwardCompat;
109
+ std::int32_t pCatchableTypeArray;
110
+ };
111
+ #pragma warning(push)
112
+ #pragma warning(disable:4200)
113
+ #if IS_CLANG
114
+ #pragma clang diagnostic push
115
+ #pragma clang diagnostic ignored "-Wc99-extensions"
116
+ #endif
117
+ struct CatchableTypeArray {
118
+ uint32_t nCatchableTypes;
119
+ int32_t arrayOfCatchableTypes[];
120
+ };
121
+ #if IS_CLANG
122
+ #pragma clang diagnostic pop
130
123
#endif
124
+ #pragma warning(pop)
125
+ #pragma pack(pop)
131
126
132
127
static constexpr unsigned EH_MAGIC_NUMBER1 = 0x19930520 ; // '?msc' version magic, see ehdata.h
133
128
static constexpr unsigned EH_EXCEPTION_NUMBER = 0xE06D7363 ; // '?msc', 'msc' | 0xE0000000
@@ -174,6 +169,7 @@ namespace detail {
174
169
#ifdef _WIN64
175
170
return reinterpret_cast <T>((uintptr_t )module_pointer + (uintptr_t )address);
176
171
#else
172
+ (void )module_pointer;
177
173
return reinterpret_cast <T>(address);
178
174
#endif
179
175
}
0 commit comments