From 94626ae7d9bef31be090344f609561906a2e263a04cdd93c0cbb8c7268753a0c Mon Sep 17 00:00:00 2001 From: Frank Schreiner Date: Mon, 10 May 2021 07:11:20 +0000 Subject: [PATCH] Accepting request 887978 from home:marxin:branches:system:packagemanager - Add use-clamp-from-C-STD-library.patch in order to fix clamp clash (boo#1181867). OBS-URL: https://build.opensuse.org/request/show/887978 OBS-URL: https://build.opensuse.org/package/show/system:packagemanager/dpkg?expand=0&rev=79 --- dpkg.changes | 6 ++++++ dpkg.spec | 3 +++ use-clamp-from-C-STD-library.patch | 33 ++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 use-clamp-from-C-STD-library.patch diff --git a/dpkg.changes b/dpkg.changes index 4b6ad79..3b0ba70 100644 --- a/dpkg.changes +++ b/dpkg.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 23 09:07:05 UTC 2021 - Martin Liška + +- Add use-clamp-from-C-STD-library.patch in order to fix + clamp clash (boo#1181867). + ------------------------------------------------------------------- Tue Aug 25 13:39:24 UTC 2020 - Martin Liška diff --git a/dpkg.spec b/dpkg.spec index 2973b94..0225f2e 100644 --- a/dpkg.spec +++ b/dpkg.spec @@ -30,6 +30,8 @@ Patch1: update-alternatives-suse.patch # PATCH-FIX-SUSE: tar of Leap 42.{2,3} does not recognize --sort=name, --clamp-mtime options Patch2: drop-tar-option.patch Patch3: ncurses-fix.patch +# PATCH-FIX-OPENSUSE: Use clamp from C++ STD library. +Patch4: use-clamp-from-C-STD-library.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -89,6 +91,7 @@ Libraries and header files for dpkg. %patch2 -p1 %endif %patch3 -p1 +%patch4 -p1 %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects diff --git a/use-clamp-from-C-STD-library.patch b/use-clamp-from-C-STD-library.patch new file mode 100644 index 0000000..4b9c43e --- /dev/null +++ b/use-clamp-from-C-STD-library.patch @@ -0,0 +1,33 @@ +From 43bf69b419bcfc0c601015d753b921b6849bae06 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Fri, 23 Apr 2021 11:03:59 +0200 +Subject: [PATCH] Use clamp from C++ STD library. + +--- + lib/dpkg/macros.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h +index 0c1937a..34387d9 100644 +--- a/lib/dpkg/macros.h ++++ b/lib/dpkg/macros.h +@@ -112,7 +112,6 @@ + #ifndef max + #define max(a, b) ((a) > (b) ? (a) : (b)) + #endif +-#endif + + /** + * @def clamp +@@ -127,6 +126,8 @@ + #define clamp(v, l, h) ((v) > (h) ? (h) : ((v) < (l) ? (l) : (v))) + #endif + ++#endif ++ + /** @} */ + + #endif /* LIBDPKG_MACROS_H */ +-- +2.31.1 +