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
This commit is contained in:
Frank Schreiner 2021-05-10 07:11:20 +00:00 committed by Git OBS Bridge
parent 4ddd505dd7
commit 94626ae7d9
3 changed files with 42 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 23 09:07:05 UTC 2021 - Martin Liška <mliska@suse.cz>
- 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 <mliska@suse.cz>

View File

@ -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

View File

@ -0,0 +1,33 @@
From 43bf69b419bcfc0c601015d753b921b6849bae06 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
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