Skip to content

Commit afa9e42

Browse files
committed
Copy patches 3.11
1 parent e9a66c0 commit afa9e42

4 files changed

Lines changed: 131 additions & 0 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 3c373cfd1c38b0ab69f5f268dc67cf45ae8933b1 Mon Sep 17 00:00:00 2001
2+
From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
3+
Date: Mon, 6 Nov 2017 21:44:29 -0500
4+
Subject: [PATCH 1/3] Prevent incorrect include of "io.h" found in libmpdec
5+
directory
6+
7+
This commit improves support for building python with built-in extensions
8+
on windows where the header provided by libmpdec would be included instead
9+
of the system one.
10+
---
11+
Modules/_decimal/libmpdec/io.c | 2 +-
12+
Modules/_decimal/libmpdec/{io.h => mpd_io.h} | 0
13+
2 files changed, 1 insertion(+), 1 deletion(-)
14+
rename Modules/_decimal/libmpdec/{io.h => mpd_io.h} (100%)
15+
16+
diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c
17+
index e7bd6ae..ecebe82 100644
18+
--- a/Modules/_decimal/libmpdec/io.c
19+
+++ b/Modules/_decimal/libmpdec/io.c
20+
@@ -37,7 +37,7 @@
21+
#include <stdlib.h>
22+
#include <string.h>
23+
24+
-#include "io.h"
25+
+#include "mpd_io.h"
26+
#include "typearith.h"
27+
28+
29+
diff --git a/Modules/_decimal/libmpdec/io.h b/Modules/_decimal/libmpdec/mpd_io.h
30+
similarity index 100%
31+
rename from Modules/_decimal/libmpdec/io.h
32+
rename to Modules/_decimal/libmpdec/mpd_io.h
33+
--
34+
2.47.2
35+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From de2c387f6734745b5b5d0df0ee9291c2821174a9 Mon Sep 17 00:00:00 2001
2+
From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
3+
Date: Mon, 6 Nov 2017 10:37:50 -0500
4+
Subject: [PATCH 2/3] Prevent duplicated OverlappedType symbols with built-in
5+
extension on windows
6+
7+
This commit improves support for building python with built-in extensions
8+
on windows where the symbol from overlapped.c would clash with the one
9+
from _winapi.c
10+
---
11+
Modules/_winapi.c | 2 +-
12+
Modules/overlapped.c | 2 +-
13+
2 files changed, 2 insertions(+), 2 deletions(-)
14+
15+
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
16+
index f6bb07f..5164899 100644
17+
--- a/Modules/_winapi.c
18+
+++ b/Modules/_winapi.c
19+
@@ -175,7 +175,7 @@ overlapped_dealloc(OverlappedObject *self)
20+
21+
/*[clinic input]
22+
module _winapi
23+
-class _winapi.Overlapped "OverlappedObject *" "&OverlappedType"
24+
+class _winapi.Overlapped "OverlappedObject *" "&WinApiOverlappedType"
25+
[clinic start generated code]*/
26+
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c13d3f5fd1dabb84]*/
27+
28+
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
29+
index b9ca86c..ae0d96c 100644
30+
--- a/Modules/overlapped.c
31+
+++ b/Modules/overlapped.c
32+
@@ -62,7 +62,7 @@ class BOOL_converter(CConverter):
33+
34+
/*[clinic input]
35+
module _overlapped
36+
-class _overlapped.Overlapped "OverlappedObject *" "&OverlappedType"
37+
+class _overlapped.Overlapped "OverlappedObject *" "&WinApiOverlappedType"
38+
[clinic start generated code]*/
39+
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=92e5a799db35b96c]*/
40+
41+
--
42+
2.47.2
43+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+

patches/3.11/README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* ``0001-Prevent-incorrect-include-of-io.h-found-in-libmpdec-.patch``: Rename header files found in
2+
``Modules/_decimal/libmpdec`` directory to avoid conflicts with system headers of the same name.
3+
4+
* ``0002-Prevent-duplicated-OverlappedType-symbols-with-built.patch``: Prevent duplicated OverlappedType
5+
symbols with built-in extension on Windows.
6+
7+
* ``0003-mpdecimal-Export-inlined-functions-to-support-extens.patch``: Export inlined functions to
8+
support extension built-in on Windows.

0 commit comments

Comments
 (0)