kdiff3/Fix-linking-with-boost-1.75.0.patch
Christophe Marin de6364cf14 Accepting request 1058883 from home:wolfi323:branches:KDE:Extra
- Update to 1.10.0
  * Make DirectoryMergeWindow and DirectoryMergeInfo QDockWidgets
  * Use Qt native saveState/restoreState
- Build with boost 1.75.0 on Leap as the standard version is too
  old (kdiff3 requires at least 1.71 now)
- Add Fix-linking-with-boost-1.75.0.patch to workaround a bug in
  boost 1.75.0 that breaks the linking stage

OBS-URL: https://build.opensuse.org/request/show/1058883
OBS-URL: https://build.opensuse.org/package/show/KDE:Extra/kdiff3?expand=0&rev=38
2023-01-17 13:25:32 +00:00

42 lines
1.3 KiB
Diff

From d1f6385c0838602bce35f02087556f978d7c074b Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Tue, 17 Jan 2023 11:33:47 +0100
Subject: [PATCH] Fix linking with boost 1.75.0
Boost 1.75.0 has a bug that causes "multiple definitions" errors in the
linking stage. This was fixed in later versions by declaring some
functions as inline.
See https://github.com/boostorg/safe_numerics/issues/106 .
As a (ugly) workaround, override the function that breaks kdiff3's build
to be inline before including the boost headers (when using 1.75.0).
---
src/TypeUtils.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/TypeUtils.h b/src/TypeUtils.h
index de2265f0..459a5777 100644
--- a/src/TypeUtils.h
+++ b/src/TypeUtils.h
@@ -14,6 +14,16 @@
#include <type_traits>
#include <limits>
+#include <boost/version.hpp>
+#if BOOST_VERSION == 107500
+// prevent multiple definitions of literal_string with boost 1.75
+// see https://github.com/boostorg/safe_numerics/issues/106
+#include <cstdint>
+namespace boost::safe_numerics {
+ enum class safe_numerics_error : std::uint8_t;
+ inline const char * literal_string(const safe_numerics_error & e);
+}
+#endif
#include <boost/safe_numerics/safe_integer.hpp>
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
--
2.35.3