diff options
author | Erlend E. Aasland <erlend@python.org> | 2024-04-29 06:58:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 06:58:57 (GMT) |
commit | c7e7bfc4ca26bf90e0d4959e303770fbfc3a3795 (patch) | |
tree | d1b0b6187ff84ec7b7bd4e29f3f81df34d3ce51b /Modules/_decimal | |
parent | ab6eda0ee59587e84cb417dd84452b9c6845434c (diff) | |
download | cpython-c7e7bfc4ca26bf90e0d4959e303770fbfc3a3795.zip cpython-c7e7bfc4ca26bf90e0d4959e303770fbfc3a3795.tar.gz cpython-c7e7bfc4ca26bf90e0d4959e303770fbfc3a3795.tar.bz2 |
gh-115119: Detect _decimal dependencies using pkg-config (#115406)
pkg-config is supported for libmpdec 4.0.0 and newer.
Diffstat (limited to 'Modules/_decimal')
-rw-r--r-- | Modules/_decimal/_decimal.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index fa425f4..c105367 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -34,7 +34,19 @@ #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_typeobject.h" #include "complexobject.h" -#include "mpdecimal.h" + +#include <mpdecimal.h> + +// Reuse config from mpdecimal.h if present. +#if defined(MPD_CONFIG_64) + #ifndef CONFIG_64 + #define CONFIG_64 MPD_CONFIG_64 + #endif +#elif defined(MPD_CONFIG_32) + #ifndef CONFIG_32 + #define CONFIG_32 MPD_CONFIG_32 + #endif +#endif #include <ctype.h> // isascii() #include <stdlib.h> |