diff options
author | Stefan Krah <skrah@bytereef.org> | 2014-08-26 19:31:47 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2014-08-26 19:31:47 (GMT) |
commit | cf26115651c4c5cfc92776fd7204d7a218241e88 (patch) | |
tree | feadaf2def9e0d5776bcc46a90b30909deb84d4f | |
parent | 298131a44896a4fec1ea829814ad52409d59aba5 (diff) | |
download | cpython-cf26115651c4c5cfc92776fd7204d7a218241e88.zip cpython-cf26115651c4c5cfc92776fd7204d7a218241e88.tar.gz cpython-cf26115651c4c5cfc92776fd7204d7a218241e88.tar.bz2 |
Introduce and check for MPD_VERSION_HEX for precise management of builds
with an external libmpdec.
-rw-r--r-- | Lib/decimal.py | 2 | ||||
-rw-r--r-- | Modules/_decimal/_decimal.c | 4 | ||||
-rw-r--r-- | Modules/_decimal/libmpdec/mpdecimal.h | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index e11f1a0..5544f4e 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -140,7 +140,7 @@ __all__ = [ __version__ = '1.70' # Highest version of the spec this complies with # See http://speleotrove.com/decimal/ -__libmpdec_version__ = "2.4.0" # compatible libmpdec version +__libmpdec_version__ = "2.4.1" # compatible libmpdec version import math as _math import numbers as _numbers diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 8be9be6..f000887 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -39,8 +39,8 @@ #include "memory.h" -#if MPD_MAJOR_VERSION != 2 - #error "libmpdec major version 2 required" +#if !defined(MPD_VERSION_HEX) || MPD_VERSION_HEX < 0x02040100 + #error "libmpdec version >= 2.4.1 required" #endif diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index b43231c..5ca7413 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -108,9 +108,13 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) #define MPD_MAJOR_VERSION 2 #define MPD_MINOR_VERSION 4 -#define MPD_MICRO_VERSION 0 +#define MPD_MICRO_VERSION 1 -#define MPD_VERSION "2.4.0" +#define MPD_VERSION "2.4.1" + +#define MPD_VERSION_HEX ((MPD_MAJOR_VERSION << 24) | \ + (MPD_MINOR_VERSION << 16) | \ + (MPD_MICRO_VERSION << 8)) const char *mpd_version(void); |