Bläddra i källkod

dselect: Show dependency/conflicts resolution screen again

Fix by switching the C++ code to use STL's min() and max() instead of
preprocessor macros, to avoid multiple evaluation of arguments.

Regression introduced in commit f426b031ac858fa30ace69959a43b61fb40f4be9.

Closes: #574816

Based-on-patch-by: Robert Luberda <robert@debian.org>
Guillem Jover 16 år sedan
förälder
incheckning
7e98241b11
3 ändrade filer med 12 tillägg och 0 borttagningar
  1. 4 0
      debian/changelog
  2. 5 0
      dselect/dselect.h
  3. 3 0
      lib/dpkg/macros.h

+ 4 - 0
debian/changelog

@@ -8,6 +8,10 @@ dpkg (1.15.6.1) UNRELEASED; urgency=low
     exposing the configure variable HAVE_C_ATTRIBUTE on installed headers.
   * Do not allow a --retry schedule in start-stop-daemon where forever is
     the last item, as it needs something to repeat over. Closes: #570938
+  * Show dselect dependency/conflicts resolution screen again, by switching
+    the code to use STL's min() and max() instead of preprocessor macros, to
+    avoid multiple evaluation of arguments. Regression introduced in 1.15.6.
+    Based on a patch by Robert Luberda <robert@debian.org>. Closes: #574816
 
   [ Raphaël Hertzog ]
   * Accept source packages without "Format" field for compatibility with very

+ 5 - 0
dselect/dselect.h

@@ -24,6 +24,11 @@
 
 #include <signal.h>
 
+#include <algorithm>
+
+using std::min;
+using std::max;
+
 #include "dselect-curses.h"
 
 #define DSELECT		"dselect"

+ 3 - 0
lib/dpkg/macros.h

@@ -59,6 +59,8 @@
 #define array_count(a) (sizeof(a) / sizeof((a)[0]))
 #endif
 
+/* For C++ use native implementations from STL or similar. */
+#ifndef __cplusplus
 #ifndef min
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #endif
@@ -66,6 +68,7 @@
 #ifndef max
 #define max(a, b) ((a) > (b) ? (a) : (b))
 #endif
+#endif
 
 #endif /* LIBDPKG_MACROS_H */