diff options
author | Juergen Daubert <jue@jue.li> | 2020-07-16 19:49:22 +0000 |
---|---|---|
committer | Juergen Daubert <jue@jue.li> | 2020-07-16 19:49:22 +0000 |
commit | 48b929176ef24a6fceba99e691b075fc7ca28fbc (patch) | |
tree | b3debf87afc84cab5c225b0811e755b0ff366dbc /python3 | |
parent | 67714afe991e3a18c66c17f8e4e655c8257bc25c (diff) | |
download | core-48b929176ef24a6fceba99e691b075fc7ca28fbc.tar.gz core-48b929176ef24a6fceba99e691b075fc7ca28fbc.tar.xz |
python3: add mpdecimal-2.5.patch
Diffstat (limited to 'python3')
-rw-r--r-- | python3/mpdecimal-2.5.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/python3/mpdecimal-2.5.patch b/python3/mpdecimal-2.5.patch new file mode 100644 index 00000000..3a61e285 --- /dev/null +++ b/python3/mpdecimal-2.5.patch @@ -0,0 +1,43 @@ +From 16eea45fbd3b7c3d1b222b7eb7a5d7ee427f70bd Mon Sep 17 00:00:00 2001 +From: Felix Yan <felixonmars@archlinux.org> +Date: Thu, 16 Jul 2020 04:22:23 +0800 +Subject: [PATCH] [3.8] bpo-41302: Support system libmpdec 2.5 for Python 3.8 + (GH-21488) + +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. +--- + .../next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst | 1 + + Modules/_decimal/_decimal.c | 7 +++++++ + 2 files changed, 8 insertions(+) + 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 0000000000000..2f1301740e748 +--- /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 +diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c +index df7c6e254bcf2..eb1f1a01feeca 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 |