Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/cad/freecad/files/ae641dc5278efaf.patch
16151 views
1
dos2unix fixed variant of https://github.com/FreeCAD/FreeCAD/commit/ae641dc5278efaf.patch
2
From ae641dc5278efafa22b168fc196875558b92e436 Mon Sep 17 00:00:00 2001
3
From: wmayer <[email protected]>
4
Date: Sun, 7 Jun 2020 12:53:47 +0200
5
Subject: [PATCH] Python: [skip ci] tp_print slot has been replaced with
6
tp_vectorcall_offset in Py3.8
7
8
---
9
src/Base/swigpyrun_1.3.25.h | 8 ++++++++
10
src/Base/swigpyrun_1.3.33.h | 8 ++++++++
11
src/Base/swigpyrun_1.3.36.h | 9 +++++++++
12
src/Base/swigpyrun_1.3.38.h | 8 ++++++++
13
src/Base/swigpyrun_1.3.40.h | 12 ++++++++++--
14
src/CXX/Python3/cxx_extensions.cxx | 6 ++++++
15
6 files changed, 49 insertions(+), 2 deletions(-)
16
17
diff --git a/src/Base/swigpyrun_1.3.25.h b/src/Base/swigpyrun_1.3.25.h
18
index 91717210b48..9ebadbc83a2 100644
19
--- a/src/Base/swigpyrun_1.3.25.h
20
+++ b/src/Base/swigpyrun_1.3.25.h
21
@@ -699,7 +699,11 @@ PySwigObject_type(void) {
22
0, /*tp_itemsize*/
23
/* methods */
24
(destructor)PySwigObject_dealloc, /*tp_dealloc*/
25
+#if PY_VERSION_HEX < 0x03080000
26
(printfunc)PySwigObject_print, /*tp_print*/
27
+#else
28
+ 0, /*tp_vectorcall_offset*/
29
+#endif
30
(getattrfunc)0, /*tp_getattr*/
31
(setattrfunc)0, /*tp_setattr*/
32
(cmpfunc)PySwigObject_compare, /*tp_compare*/
33
@@ -859,7 +863,11 @@ PySwigPacked_type(void) {
34
0, /*tp_itemsize*/
35
/* methods */
36
(destructor)PySwigPacked_dealloc, /*tp_dealloc*/
37
+#if PY_VERSION_HEX < 0x03080000
38
(printfunc)PySwigPacked_print, /*tp_print*/
39
+#else
40
+ 0, /*tp_vectorcall_offset*/
41
+#endif
42
(getattrfunc)0, /*tp_getattr*/
43
(setattrfunc)0, /*tp_setattr*/
44
(cmpfunc)PySwigPacked_compare, /*tp_compare*/
45
diff --git a/src/Base/swigpyrun_1.3.33.h b/src/Base/swigpyrun_1.3.33.h
46
index f83ac1e89c3..afd5a8c504f 100644
47
--- a/src/Base/swigpyrun_1.3.33.h
48
+++ b/src/Base/swigpyrun_1.3.33.h
49
@@ -1620,7 +1620,11 @@ _PySwigObject_type(void) {
50
sizeof(PySwigObject), /* tp_basicsize */
51
0, /* tp_itemsize */
52
(destructor)PySwigObject_dealloc, /* tp_dealloc */
53
+#if PY_VERSION_HEX < 0x03080000
54
(printfunc)PySwigObject_print, /* tp_print */
55
+#else
56
+ 0, /*tp_vectorcall_offset*/
57
+#endif
58
#if PY_VERSION_HEX < 0x02020000
59
(getattrfunc)PySwigObject_getattr, /* tp_getattr */
60
#else
61
@@ -1790,7 +1794,11 @@ _PySwigPacked_type(void) {
62
sizeof(PySwigPacked), /* tp_basicsize */
63
0, /* tp_itemsize */
64
(destructor)PySwigPacked_dealloc, /* tp_dealloc */
65
+#if PY_VERSION_HEX < 0x03080000
66
(printfunc)PySwigPacked_print, /* tp_print */
67
+#else
68
+ 0, /*tp_vectorcall_offset*/
69
+#endif
70
(getattrfunc)0, /* tp_getattr */
71
(setattrfunc)0, /* tp_setattr */
72
(cmpfunc)PySwigPacked_compare, /* tp_compare */
73
diff --git a/src/Base/swigpyrun_1.3.36.h b/src/Base/swigpyrun_1.3.36.h
74
index 02c58ad8ab9..12ad41e12a8 100644
75
--- a/src/Base/swigpyrun_1.3.36.h
76
+++ b/src/Base/swigpyrun_1.3.36.h
77
@@ -1628,7 +1628,12 @@ _PySwigObject_type(void) {
78
sizeof(PySwigObject), /* tp_basicsize */
79
0, /* tp_itemsize */
80
(destructor)PySwigObject_dealloc, /* tp_dealloc */
81
+#if PY_VERSION_HEX < 0x03080000
82
(printfunc)PySwigObject_print, /* tp_print */
83
+#else
84
+ 0, /*tp_vectorcall_offset*/
85
+#endif
86
+
87
#if PY_VERSION_HEX < 0x02020000
88
(getattrfunc)PySwigObject_getattr, /* tp_getattr */
89
#else
90
@@ -1798,7 +1803,11 @@ _PySwigPacked_type(void) {
91
sizeof(PySwigPacked), /* tp_basicsize */
92
0, /* tp_itemsize */
93
(destructor)PySwigPacked_dealloc, /* tp_dealloc */
94
+#if PY_VERSION_HEX < 0x03080000
95
(printfunc)PySwigPacked_print, /* tp_print */
96
+#else
97
+ 0, /*tp_vectorcall_offset*/
98
+#endif
99
(getattrfunc)0, /* tp_getattr */
100
(setattrfunc)0, /* tp_setattr */
101
(cmpfunc)PySwigPacked_compare, /* tp_compare */
102
diff --git a/src/Base/swigpyrun_1.3.38.h b/src/Base/swigpyrun_1.3.38.h
103
index dae058c202f..7cacc157970 100644
104
--- a/src/Base/swigpyrun_1.3.38.h
105
+++ b/src/Base/swigpyrun_1.3.38.h
106
@@ -1741,7 +1741,11 @@ _PySwigObject_type(void) {
107
sizeof(SwigPyObject), /* tp_basicsize */
108
0, /* tp_itemsize */
109
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
110
+#if PY_VERSION_HEX < 0x03080000
111
(printfunc)SwigPyObject_print, /* tp_print */
112
+#else
113
+ 0, /*tp_vectorcall_offset*/
114
+#endif
115
#if PY_VERSION_HEX < 0x02020000
116
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
117
#else
118
@@ -1919,7 +1923,11 @@ _PySwigPacked_type(void) {
119
sizeof(SwigPyPacked), /* tp_basicsize */
120
0, /* tp_itemsize */
121
(destructor)SwigPyPacked_dealloc, /* tp_dealloc */
122
+#if PY_VERSION_HEX < 0x03080000
123
(printfunc)SwigPyPacked_print, /* tp_print */
124
+#else
125
+ 0, /*tp_vectorcall_offset*/
126
+#endif
127
(getattrfunc)0, /* tp_getattr */
128
(setattrfunc)0, /* tp_setattr */
129
(cmpfunc)SwigPyPacked_compare, /* tp_compare */
130
diff --git a/src/Base/swigpyrun_1.3.40.h b/src/Base/swigpyrun_1.3.40.h
131
index 136ba809fb7..400db8b4784 100644
132
--- a/src/Base/swigpyrun_1.3.40.h
133
+++ b/src/Base/swigpyrun_1.3.40.h
134
@@ -1766,7 +1766,11 @@ _PySwigObject_type(void) {
135
sizeof(SwigPyObject), /* tp_basicsize */
136
0, /* tp_itemsize */
137
(destructor)SwigPyObject_dealloc, /* tp_dealloc */
138
+#if PY_VERSION_HEX < 0x03080000
139
(printfunc)SwigPyObject_print, /* tp_print */
140
+#else
141
+ 0, /*tp_vectorcall_offset*/
142
+#endif
143
#if PY_VERSION_HEX < 0x02020000
144
(getattrfunc)SwigPyObject_getattr, /* tp_getattr */
145
#else
146
@@ -1947,8 +1951,12 @@ _PySwigPacked_type(void) {
147
(char *)"SwigPyPacked", /* tp_name */
148
sizeof(SwigPyPacked), /* tp_basicsize */
149
0, /* tp_itemsize */
150
- (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
151
- (printfunc)SwigPyPacked_print, /* tp_print */
152
+ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
153
+#if PY_VERSION_HEX < 0x03080000
154
+ (printfunc)SwigPyPacked_print, /* tp_print */
155
+#else
156
+ 0, /*tp_vectorcall_offset*/
157
+#endif
158
(getattrfunc)0, /* tp_getattr */
159
(setattrfunc)0, /* tp_setattr */
160
#if PY_VERSION_HEX>=0x03000000
161
diff --git a/src/CXX/Python3/cxx_extensions.cxx b/src/CXX/Python3/cxx_extensions.cxx
162
index fb3da455f5b..9ff94612f07 100644
163
--- a/src/CXX/Python3/cxx_extensions.cxx
164
+++ b/src/CXX/Python3/cxx_extensions.cxx
165
@@ -381,7 +381,11 @@ PythonType::PythonType( size_t basic_size, int itemsize, const char *default_nam
166
167
// Methods to implement standard operations
168
table->tp_dealloc = (destructor)standard_dealloc;
169
+#if PY_VERSION_HEX < 0x03080000
170
table->tp_print = 0;
171
+#else
172
+ table->tp_vectorcall_offset = 0;
173
+#endif
174
table->tp_getattr = 0;
175
table->tp_setattr = 0;
176
table->tp_repr = 0;
177
@@ -524,7 +528,9 @@ PythonType &PythonType::supportClass()
178
#ifdef PYCXX_PYTHON_2TO3
179
PythonType &PythonType::supportPrint()
180
{
181
+#if PY_VERSION_HEX < 0x03080000
182
table->tp_print = print_handler;
183
+#endif
184
return *this;
185
}
186
#endif
187
188