summaryrefslogtreecommitdiff
path: root/bridges/source
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/source')
-rw-r--r--bridges/source/cpp_uno/msvc_win32_intel/except.cxx7
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx13
2 files changed, 12 insertions, 8 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
index 48e538335d94..6aaf8c2c8f4f 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
@@ -32,6 +32,7 @@
#include "com/sun/star/uno/Any.hxx"
#include <unordered_map>
#include "msci.hxx"
+#include "bridges/cpp_uno/shared/except.hxx"
#pragma pack(push, 8)
@@ -493,8 +494,11 @@ int msci_filterCppException(
if (rethrow && pRecord == pPointers->ExceptionRecord)
{
- // hack to get msvcrt internal _curexception field:
pRecord = *reinterpret_cast< EXCEPTION_RECORD ** >(
+#if _MSC_VER >= 1900 // VC 2015 (and later?)
+ __current_exception()
+#else
+ // hack to get msvcrt internal _curexception field:
reinterpret_cast< char * >( __pxcptinfoptrs() ) +
// as long as we don't demand msvcr source as build prerequisite
// (->platform sdk), we have to code those offsets here.
@@ -503,6 +507,7 @@ int msci_filterCppException(
// offsetof (_tiddata, _curexception) -
// offsetof (_tiddata, _tpxcptinfoptrs):
0x28 // msvcr80.dll (and later?)
+#endif
);
}
// rethrow: handle only C++ exceptions:
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index f543236a6891..d5d6d0e27606 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -250,6 +250,7 @@ void
#include "com/sun/star/uno/Any.hxx"
#include <unordered_map>
#include "mscx.hxx"
+#include "bridges/cpp_uno/shared/except.hxx"
#pragma pack(push, 8)
@@ -866,8 +867,11 @@ int mscx_filterCppException(
if (rethrow && pRecord == pPointers->ExceptionRecord)
{
- // Hack to get msvcrt internal _curexception field:
pRecord = *reinterpret_cast< EXCEPTION_RECORD ** >(
+#if _MSC_VER >= 1900 // VC 2015 (and later?)
+ __current_exception()
+#else
+ // Hack to get msvcrt internal _curexception field
reinterpret_cast< char * >( __pxcptinfoptrs() ) +
// As long as we don't demand MSVCR source as build prerequisite,
// we have to code those offsets here.
@@ -875,12 +879,7 @@ int mscx_filterCppException(
// MSVS9/crt/src/mtdll.h:
// offsetof (_tiddata, _curexception) -
// offsetof (_tiddata, _tpxcptinfoptrs):
-#if _MSC_VER <= 1900 // VC 2015
- //
- // See dev-tools/uno/uno_exception_offset
- 0x48 // msvcr90.dll
-#else
- error, please find value for this compiler version
+ 0x48
#endif
);
}