Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
e310ccb4
Commit
e310ccb4
authored
9 years ago
by
Jeroen Demeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use different mangling prefix in foo_api.h files
parent
c6a6dd71
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+4
-4
Cython/Compiler/Naming.py
Cython/Compiler/Naming.py
+2
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
e310ccb4
...
@@ -223,14 +223,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -223,14 +223,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
h_code
.
putln
(
""
)
h_code
.
putln
(
""
)
for
entry
in
api_funcs
:
for
entry
in
api_funcs
:
type
=
CPtrType
(
entry
.
type
)
type
=
CPtrType
(
entry
.
type
)
cname
=
env
.
mangle
(
Naming
.
func_prefix
,
entry
.
name
)
cname
=
env
.
mangle
(
Naming
.
func_prefix
_api
,
entry
.
name
)
h_code
.
putln
(
"static %s = 0;"
%
type
.
declaration_code
(
cname
))
h_code
.
putln
(
"static %s = 0;"
%
type
.
declaration_code
(
cname
))
h_code
.
putln
(
"#define %s %s"
%
(
entry
.
name
,
cname
))
h_code
.
putln
(
"#define %s %s"
%
(
entry
.
name
,
cname
))
if
api_vars
:
if
api_vars
:
h_code
.
putln
(
""
)
h_code
.
putln
(
""
)
for
entry
in
api_vars
:
for
entry
in
api_vars
:
type
=
CPtrType
(
entry
.
type
)
type
=
CPtrType
(
entry
.
type
)
cname
=
env
.
mangle
(
Naming
.
varptr_prefix
,
entry
.
name
)
cname
=
env
.
mangle
(
Naming
.
varptr_prefix
_api
,
entry
.
name
)
h_code
.
putln
(
"static %s = 0;"
%
type
.
declaration_code
(
cname
))
h_code
.
putln
(
"static %s = 0;"
%
type
.
declaration_code
(
cname
))
h_code
.
putln
(
"#define %s (*%s)"
%
(
entry
.
name
,
cname
))
h_code
.
putln
(
"#define %s (*%s)"
%
(
entry
.
name
,
cname
))
h_code
.
put
(
UtilityCode
.
load_as_string
(
"PyIdentifierFromString"
,
"ImportExport.c"
)[
0
])
h_code
.
put
(
UtilityCode
.
load_as_string
(
"PyIdentifierFromString"
,
"ImportExport.c"
)[
0
])
...
@@ -247,13 +247,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -247,13 +247,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
h_code
.
putln
(
'module = __Pyx_ImportModule("%s");'
%
env
.
qualified_name
)
h_code
.
putln
(
'module = __Pyx_ImportModule("%s");'
%
env
.
qualified_name
)
h_code
.
putln
(
"if (!module) goto bad;"
)
h_code
.
putln
(
"if (!module) goto bad;"
)
for
entry
in
api_funcs
:
for
entry
in
api_funcs
:
cname
=
env
.
mangle
(
Naming
.
func_prefix
,
entry
.
name
)
cname
=
env
.
mangle
(
Naming
.
func_prefix
_api
,
entry
.
name
)
sig
=
entry
.
type
.
signature_string
()
sig
=
entry
.
type
.
signature_string
()
h_code
.
putln
(
h_code
.
putln
(
'if (__Pyx_ImportFunction(module, "%s", (void (**)(void))&%s, "%s") < 0) goto bad;'
'if (__Pyx_ImportFunction(module, "%s", (void (**)(void))&%s, "%s") < 0) goto bad;'
%
(
entry
.
name
,
cname
,
sig
))
%
(
entry
.
name
,
cname
,
sig
))
for
entry
in
api_vars
:
for
entry
in
api_vars
:
cname
=
env
.
mangle
(
Naming
.
varptr_prefix
,
entry
.
name
)
cname
=
env
.
mangle
(
Naming
.
varptr_prefix
_api
,
entry
.
name
)
sig
=
entry
.
type
.
empty_declaration_code
()
sig
=
entry
.
type
.
empty_declaration_code
()
h_code
.
putln
(
h_code
.
putln
(
'if (__Pyx_ImportVoidPtr(module, "%s", (void **)&%s, "%s") < 0) goto bad;'
'if (__Pyx_ImportVoidPtr(module, "%s", (void **)&%s, "%s") < 0) goto bad;'
...
...
This diff is collapsed.
Click to expand it.
Cython/Compiler/Naming.py
View file @
e310ccb4
...
@@ -18,6 +18,7 @@ arg_prefix = pyrex_prefix + "arg_"
...
@@ -18,6 +18,7 @@ arg_prefix = pyrex_prefix + "arg_"
funcdoc_prefix
=
pyrex_prefix
+
"doc_"
funcdoc_prefix
=
pyrex_prefix
+
"doc_"
enum_prefix
=
pyrex_prefix
+
"e_"
enum_prefix
=
pyrex_prefix
+
"e_"
func_prefix
=
pyrex_prefix
+
"f_"
func_prefix
=
pyrex_prefix
+
"f_"
func_prefix_api
=
pyrex_prefix
+
"api_f_"
pyfunc_prefix
=
pyrex_prefix
+
"pf_"
pyfunc_prefix
=
pyrex_prefix
+
"pf_"
pywrap_prefix
=
pyrex_prefix
+
"pw_"
pywrap_prefix
=
pyrex_prefix
+
"pw_"
genbody_prefix
=
pyrex_prefix
+
"gb_"
genbody_prefix
=
pyrex_prefix
+
"gb_"
...
@@ -36,6 +37,7 @@ type_prefix = pyrex_prefix + "t_"
...
@@ -36,6 +37,7 @@ type_prefix = pyrex_prefix + "t_"
typeobj_prefix
=
pyrex_prefix
+
"type_"
typeobj_prefix
=
pyrex_prefix
+
"type_"
var_prefix
=
pyrex_prefix
+
"v_"
var_prefix
=
pyrex_prefix
+
"v_"
varptr_prefix
=
pyrex_prefix
+
"vp_"
varptr_prefix
=
pyrex_prefix
+
"vp_"
varptr_prefix_api
=
pyrex_prefix
+
"api_vp_"
wrapperbase_prefix
=
pyrex_prefix
+
"wrapperbase_"
wrapperbase_prefix
=
pyrex_prefix
+
"wrapperbase_"
pybuffernd_prefix
=
pyrex_prefix
+
"pybuffernd_"
pybuffernd_prefix
=
pyrex_prefix
+
"pybuffernd_"
pybufferstruct_prefix
=
pyrex_prefix
+
"pybuffer_"
pybufferstruct_prefix
=
pyrex_prefix
+
"pybuffer_"
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment