WIN bridges: unify exception handling

Desktop / LibreOffice - Jan-Marek Glogowski [fbihome.de] - 16 September 2020 22:01 UTC

This is almost just refactoring, but with classes like type_info_ and __type_info, just following the code became tendious. I tried to come up with better names... and in the end included some minor code changes described below.

This patch moves the "common" code for MSVC exception handling into msvc_shared/except.cxx. Still it contains a few small ifdefs, so it doesn't feel like clean separation, but a lot of duplicate code is dropped this way.

The "major" code change for amd64 is the drop of the duplicate static RTTInfo object originally used by mscx_getRTTI and mscx_getRTTI_len, by merging of both functions into the single, new get() function to use a single std::find call.

Change-Id: Ib07d40e2794cde79156be3324c80ccf21a6aa8ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102864

8c3e6666c5ef WIN bridges: unify exception handling
bridges/Library_cpp_uno.mk | 6 +
.../msci.hxx => inc/msvc/amd64.hxx} | 48 +-
bridges/inc/msvc/except.hxx | 118 +++++
bridges/inc/msvc/x86.hxx | 68 +++
bridges/source/cpp_uno/msvc_shared/except.cxx | 338 +++++++++++++
.../source/cpp_uno/msvc_win32_intel/cpp2uno.cxx | 7 +-
bridges/source/cpp_uno/msvc_win32_intel/except.cxx | 442 +----------------
.../source/cpp_uno/msvc_win32_intel/uno2cpp.cxx | 4 +-
.../source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx | 26 +-
.../source/cpp_uno/msvc_win32_x86-64/except.cxx | 530 ++-------------------
bridges/source/cpp_uno/msvc_win32_x86-64/mscx.hxx | 49 --
.../source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx | 4 +-
solenv/clang-format/excludelist | 2 -
13 files changed, 628 insertions(+), 1014 deletions(-)

Upstream: cgit.freedesktop.org


  • Share