]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41302: Fix build with system libmpdec (GH-21481)
authorFelix Yan <felixonmars@archlinux.org>
Wed, 15 Jul 2020 12:14:11 +0000 (20:14 +0800)
committerGitHub <noreply@github.com>
Wed, 15 Jul 2020 12:14:11 +0000 (14:14 +0200)
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.

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 35ce429f60124a9237706aa4a11cd940f9a146cc..5a2439690c3509c5b47d68731eabc42fc05fb420 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