summaryrefslogtreecommitdiff
path: root/sip4/patch
blob: abe2055c650ee6051fa8edb4c3c5e976db762f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
diff -r c0426a6b39a0 sipgen/metasrc/lexer.l
--- a/sipgen/metasrc/lexer.l	Fri Feb 26 15:26:24 2021 +0000
+++ b/sipgen/metasrc/lexer.l	Mon Dec 06 12:26:46 2021 +0100
@@ -179,6 +179,7 @@
 <directive>call_super_init  {return TK_CALLSUPERINIT;}
 <directive>default_VirtualErrorHandler  {return TK_DEFERRORHANDLER;}
 <directive>version          {return TK_VERSION;}
+<directive>py_ssize_t_clean {return;}
 
 <directive>True             {return TK_TRUE_VALUE;}
 <directive>False            {return TK_FALSE_VALUE;}
diff -r c0426a6b39a0 sipgen/metasrc/parser.y
--- a/sipgen/metasrc/parser.y	Fri Feb 26 15:26:24 2021 +0000
+++ b/sipgen/metasrc/parser.y	Mon Dec 06 12:26:46 2021 +0100
@@ -1908,7 +1908,7 @@
             if (notSkipping())
                 currentModule = configureModule(currentSpec, currentModule,
                         currentContext.filename, $2.name, $2.c_module,
-                        $2.kwargs, $2.use_arg_names, $2.use_limited_api,
+                        $2.kwargs, $2.use_arg_names, $2.use_limited_api, $2.py_ssize_t_clean,
                         $2.call_super_init, $2.all_raise_py_exc,
                         $2.def_error_handler, $3.docstring);
         }
@@ -1930,6 +1930,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = $1;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -1950,6 +1951,7 @@
             case TK_LANGUAGE: $$.c_module = $3.c_module; break;
             case TK_NAME: $$.name = $3.name; break;
             case TK_USEARGNAMES: $$.use_arg_names = $3.use_arg_names; break;
+            case TK_PYSSIZETCLEAN: $$.py_ssize_t_clean = $3.py_ssize_t_clean; break;
             case TK_USELIMITEDAPI: $$.use_limited_api = $3.use_limited_api; break;
             case TK_ALLRAISEPYEXC: $$.all_raise_py_exc = $3.all_raise_py_exc; break;
             case TK_CALLSUPERINIT: $$.call_super_init = $3.call_super_init; break;
@@ -1965,7 +1967,9 @@
             $$.kwargs = convertKwArgs($3);
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
             $$.def_error_handler = NULL;
@@ -1983,6 +1987,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -1995,6 +2000,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = $3;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -2007,6 +2013,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = $3;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -2019,6 +2026,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = $3;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -2031,6 +2039,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = $3;
             $$.call_super_init = -1;
@@ -2043,6 +2052,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = $3;
@@ -2055,6 +2065,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -2072,6 +2083,7 @@
             $$.kwargs = defaultKwArgs;
             $$.name = NULL;
             $$.use_arg_names = FALSE;
+            $$.py_ssize_t_clean = FALSE;
             $$.use_limited_api = FALSE;
             $$.all_raise_py_exc = FALSE;
             $$.call_super_init = -1;
@@ -9513,7 +9525,7 @@
  */
 static moduleDef *configureModule(sipSpec *pt, moduleDef *module,
         const char *filename, const char *name, int c_module, KwArgs kwargs,
-        int use_arg_names, int use_limited_api, int call_super_init,
+        int use_arg_names, int py_ssize_t_clean, int use_limited_api, int call_super_init,
         int all_raise_py_exc, const char *def_error_handler,
         docstringDef *docstring)
 {
diff -r c0426a6b39a0 sipgen/sip.h.in
--- a/sipgen/sip.h	Fri Feb 26 15:26:24 2021 +0000
+++ b/sipgen/sip.h	Mon Dec 06 12:26:46 2021 +0100
@@ -1631,6 +1631,7 @@
     const char *name;
     int use_arg_names;
     int use_limited_api;
+    int py_ssize_t_clean;
     int all_raise_py_exc;
     int call_super_init;
     const char *def_error_handler;