|
| 1 | +From f5f464c478f754a8f25c7fa4ddf37e7b41540885 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> |
| 3 | +Date: Mon, 6 Nov 2017 11:27:32 -0500 |
| 4 | +Subject: [PATCH 3/3] mpdecimal: Export inlined functions to support extension |
| 5 | + built-in on windows |
| 6 | + |
| 7 | +This commit ensures that symbols are available when building _freeze_importlib |
| 8 | +with all extensions built-in on windows. |
| 9 | + |
| 10 | +It addresses the following link error associated |
| 11 | +with CMakeBuild\libpython\_freeze_importlib.vcxproj: |
| 12 | + |
| 13 | + 3>_decimal.obj : error LNK2019: unresolved external symbol _mpd_del referenced in function _PyDec_AsTuple |
| 14 | + 3>io.obj : error LNK2001: unresolved external symbol _mpd_del |
| 15 | + 3>basearith.obj : error LNK2019: unresolved external symbol _mpd_uint_zero referenced in function __mpd_baseshiftl |
| 16 | + 3>io.obj : error LNK2019: unresolved external symbol _mpd_qresize referenced in function _mpd_qset_string |
| 17 | +--- |
| 18 | + Modules/_decimal/libmpdec/mpdecimal.c | 4 ++-- |
| 19 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
| 20 | + |
| 21 | +diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c |
| 22 | +index f1626df..1dbc85b 100644 |
| 23 | +--- a/Modules/_decimal/libmpdec/mpdecimal.c |
| 24 | ++++ b/Modules/_decimal/libmpdec/mpdecimal.c |
| 25 | +@@ -63,7 +63,7 @@ |
| 26 | + |
| 27 | + |
| 28 | + #if defined(_MSC_VER) |
| 29 | +- #define ALWAYS_INLINE __forceinline |
| 30 | ++ #define ALWAYS_INLINE extern __forceinline |
| 31 | + #elif defined (__IBMC__) || defined(LEGACY_COMPILER) |
| 32 | + #define ALWAYS_INLINE |
| 33 | + #undef inline |
| 34 | +@@ -517,7 +517,7 @@ mpd_qresize(mpd_t *result, mpd_ssize_t nwords, uint32_t *status) |
| 35 | + } |
| 36 | + |
| 37 | + /* Same as mpd_qresize, but do not set the result no NaN on failure. */ |
| 38 | +-static ALWAYS_INLINE int |
| 39 | ++static inline int |
| 40 | + mpd_qresize_cxx(mpd_t *result, mpd_ssize_t nwords) |
| 41 | + { |
| 42 | + assert(!mpd_isconst_data(result)); /* illegal operation for a const */ |
| 43 | +-- |
| 44 | +2.47.2 |
| 45 | + |
0 commit comments