aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/patches/pr5233-backport-support-const.patch
blob: bb7a9c3f6ee354876fb699d9ff92885dd218d01f (plain) (blame)
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
https://github.com/cython/cython/pull/5233

--- contrib/tools/cython/Cython/Compiler/FusedNode.py	(index)
+++ contrib/tools/cython/Cython/Compiler/FusedNode.py	(working tree)
@@ -3,7 +3,8 @@ from __future__ import absolute_import
 import copy
 
 from . import (ExprNodes, PyrexTypes, MemoryView,
-               ParseTreeTransforms, StringEncoding, Errors)
+               ParseTreeTransforms, StringEncoding, Errors,
+               Naming)
 from .ExprNodes import CloneNode, ProxyNode, TupleNode
 from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode
 from ..Utils import OrderedSet
@@ -291,9 +292,10 @@ class FusedCFuncDefNode(StatListNode):
                 """)
 
     def _dtype_name(self, dtype):
+        name = str(dtype).replace('_', '__').replace(' ', '_')
         if dtype.is_typedef:
-            return '___pyx_%s' % dtype
-        return str(dtype).replace(' ', '_')
+            name = Naming.fused_dtype_prefix + name
+        return name
 
     def _dtype_type(self, dtype):
         if dtype.is_typedef:
--- contrib/tools/cython/Cython/Compiler/Naming.py	(index)
+++ contrib/tools/cython/Cython/Compiler/Naming.py	(working tree)
@@ -118,6 +118,7 @@ frame_cname      = pyrex_prefix + "frame"
 frame_code_cname = pyrex_prefix + "frame_code"
 binding_cfunc    = pyrex_prefix + "binding_PyCFunctionType"
 fused_func_prefix = pyrex_prefix + 'fuse_'
+fused_dtype_prefix = pyrex_prefix + 'fused_dtype_'
 quick_temp_cname = pyrex_prefix + "temp" # temp variable for quick'n'dirty temping
 tp_dict_version_temp = pyrex_prefix + "tp_dict_version"
 obj_dict_version_temp = pyrex_prefix + "obj_dict_version"