File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 17
17
#endif
18
18
19
19
#ifdef _MSC_VER
20
+ #if defined(__clang__)
21
+ #define CPPTRACE_PUSH_EXTENSION_WARNINGS \
22
+ _Pragma (" clang diagnostic push" ) \
23
+ _Pragma(" clang diagnostic ignored \" -Wlanguage-extension-token\" " )
24
+ #define CPPTRACE_POP_EXTENSION_WARNINGS \
25
+ _Pragma (" clang diagnostic pop" )
26
+ #else
27
+ #define CPPTRACE_PUSH_EXTENSION_WARNINGS
28
+ #define CPPTRACE_POP_EXTENSION_WARNINGS
29
+ #endif
20
30
#define CPPTRACE_TYPE_FOR (param ) \
21
31
typename ::cpptrace::detail::argument<void (param)>::type
22
32
// this awful double-IILE is due to C2713 "You can't use structured exception handling (__try/__except) and C++
23
33
// exception handling (try/catch) in the same function."
24
34
#define CPPTRACE_TRY \
25
35
try { \
26
36
[&]() -> ::cpptrace::detail::dont_return_from_try_catch_macros { \
37
+ CPPTRACE_PUSH_EXTENSION_WARNINGS \
27
38
__try { \
39
+ CPPTRACE_POP_EXTENSION_WARNINGS \
28
40
return [&]() -> ::cpptrace::detail::dont_return_from_try_catch_macros {
29
41
#define CPPTRACE_CATCH (param ) \
30
42
return ::cpptrace::detail::dont_return_from_try_catch_macros (); \
31
43
}(); \
44
+ CPPTRACE_PUSH_EXTENSION_WARNINGS \
32
45
} __except (::cpptrace::detail::exception_filter<CPPTRACE_TYPE_FOR (param)>(GetExceptionInformation ())) { \
46
+ CPPTRACE_POP_EXTENSION_WARNINGS \
33
47
CPPTRACE_UNREACHABLE (); \
34
48
} \
35
49
}(); \
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ namespace detail {
84
84
} else {
85
85
// 64 bit
86
86
// I get an "error: 'QWORD' was not declared in this scope" for some reason when using QWORD
87
- auto bytes = load_bytes<unsigned __int64 >(file, nt_header_offset + 0x18 + 0x18 ); // optional header + 0x18
87
+ auto bytes = load_bytes<std:: uint64_t >(file, nt_header_offset + 0x18 + 0x18 ); // optional header + 0x18
88
88
if (!bytes) {
89
89
return std::move (bytes).unwrap_error ();
90
90
}
Original file line number Diff line number Diff line change @@ -84,10 +84,17 @@ namespace detail {
84
84
std::int32_t pCatchableTypeArray;
85
85
};
86
86
#pragma warning(disable:4200)
87
+ #if IS_CLANG
88
+ #pragma clang diagnostic push
89
+ #pragma clang diagnostic ignored "-Wc99-extensions"
90
+ #endif
87
91
struct CatchableTypeArray {
88
92
uint32_t nCatchableTypes;
89
93
int32_t arrayOfCatchableTypes[];
90
94
};
95
+ #if IS_CLANG
96
+ #pragma clang diagnostic pop
97
+ #endif
91
98
#pragma warning (pop)
92
99
#pragma pack(pop)
93
100
#else
@@ -563,6 +570,7 @@ CPPTRACE_BEGIN_NAMESPACE
563
570
namespace detail {
564
571
#ifdef _MSC_VER
565
572
bool matches_exception (EXCEPTION_POINTERS* exception_ptrs, const std::type_info& type_info) {
573
+ CPPTRACE_PUSH_EXTENSION_WARNINGS
566
574
__try {
567
575
auto * exception_record = exception_ptrs->ExceptionRecord ;
568
576
// Check if the SEH exception is a C++ exception
@@ -572,6 +580,7 @@ CPPTRACE_BEGIN_NAMESPACE
572
580
} __except (EXCEPTION_EXECUTE_HANDLER) {
573
581
// pass
574
582
}
583
+ CPPTRACE_POP_EXTENSION_WARNINGS
575
584
return false ;
576
585
}
577
586
#else
You can’t perform that action at this time.
0 commit comments