]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41302: Fix build with system libmpdec (GH-21481)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 15 Jul 2020 13:01:10 +0000 (06:01 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Jul 2020 13:01:10 +0000 (06:01 -0700)
Move definition of UNUSED from modified headers of libmpdec to
_decimal.c itself. This makes the vendored source closer to the
standalone library and fixes build with --with-system-libmpdec.

Tested to build fine with either system libmpdec or the vendored one.
(cherry picked from commit 015efdbef7454a522e88cd79ba2b4cd77a5fb2a2)

Co-authored-by: Felix Yan <felixonmars@archlinux.org>
Modules/_decimal/_decimal.c
Modules/_decimal/libmpdec/mpdecimal.h

index ff7c647c2220c183fbb3f50be7460cde89f21d6c..fb4e020f1260e6ec9e17d77e5aa3317e08294a24 100644 (file)
 
 #define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x
 
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+  #define UNUSED __attribute__((unused))
+#else
+  #define UNUSED
+#endif
 
 /* _Py_DEC_MINALLOC >= MPD_MINALLOC */
 #define _Py_DEC_MINALLOC 4
index 108b76efa8594178400a425ef3cd6f2abfcc100f..2815a8cde31db886b66b6fcab45bb62e41422e39 100644 (file)
@@ -61,12 +61,6 @@ extern "C" {
   #define MPD_HIDE_SYMBOLS_END
 #endif
 
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
-  #define UNUSED __attribute__((unused))
-#else
-  #define UNUSED
-#endif
-
 #if defined(_MSC_VER)
   #include "vccompat.h"
   #define EXTINLINE extern inline