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
Gwenaël Samain
cython
Commits
5ee84d80
Commit
5ee84d80
authored
Jul 14, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Need to pre-declare c method function in case it's referenced directly as an unbound method.
parent
9d928872
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-1
No files found.
Cython/Compiler/Nodes.py
View file @
5ee84d80
...
...
@@ -2144,6 +2144,7 @@ class CFuncDefNode(FuncDefNode):
# inline_in_pxd whether this is an inline function in a pxd file
# template_declaration String or None Used for c++ class methods
# is_const_method whether this is a const method
# is_c_class_method whether this is a cclass method
child_attrs
=
[
"base_type"
,
"declarator"
,
"body"
,
"py_func"
]
...
...
@@ -2159,6 +2160,7 @@ class CFuncDefNode(FuncDefNode):
return
self
.
entry
.
name
def
analyse_declarations
(
self
,
env
):
self
.
is_c_class_method
=
env
.
is_c_class_scope
if
self
.
directive_locals
is
None
:
self
.
directive_locals
=
{}
self
.
directive_locals
.
update
(
env
.
directives
[
'locals'
])
...
...
@@ -2375,8 +2377,13 @@ class CFuncDefNode(FuncDefNode):
header
=
self
.
return_type
.
declaration_code
(
entity
,
dll_linkage
=
dll_linkage
)
#print (storage_class, modifiers, header)
needs_proto
=
self
.
is_c_class_method
if
self
.
template_declaration
:
if
needs_proto
:
code
.
globalstate
.
parts
[
'module_declarations'
].
putln
(
self
.
template_declaration
)
code
.
putln
(
self
.
template_declaration
)
if
needs_proto
:
code
.
globalstate
.
parts
[
'module_declarations'
].
putln
(
"%s%s%s; /* proto*/"
%
(
storage_class
,
modifiers
,
header
))
code
.
putln
(
"%s%s%s {"
%
(
storage_class
,
modifiers
,
header
))
def
generate_argument_declarations
(
self
,
env
,
code
):
...
...
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