From 1f3e4d930a9c53b29afe9afbf5170df8310985d0 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 15 Jul 2020 19:03:58 +0800 Subject: [PATCH 1/2] bpo-41302: Support system libmpdec 2.5 for Python 3.8 Define UNUSED only when mpdecimal.h doesn't define it. This would support building with system libmpdec 2.5 while retaining compatibility with system libmpdec 2.4 or the vendored copy. Tested to build fine with either system libmpdec or the vendored one. --- Modules/_decimal/_decimal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index df7c6e254bcf29..eb1f1a01feeca8 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -58,6 +58,13 @@ #define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x +#ifndef UNUSED +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) + #define UNUSED __attribute__((unused)) +#else + #define UNUSED +#endif +#endif /* _Py_DEC_MINALLOC >= MPD_MINALLOC */ #define _Py_DEC_MINALLOC 4 From dd2858f1f7bcc49780ed683646df9aa47692b822 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 15 Jul 2020 17:56:32 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst diff --git a/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst b/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst new file mode 100644 index 00000000000000..2f1301740e7484 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst @@ -0,0 +1 @@ +Enable building Python 3.8 with libmpdec-2.5.0 to ease maintenance for Linux distributions. Patch by Felix Yan. \ No newline at end of file