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
f96286b3
Commit
f96286b3
authored
May 19, 2011
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work on pxd/public/api import/export
parent
0c2cc2a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
3 deletions
+17
-3
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+4
-1
tests/compile/publicapi_cimport.pyx
tests/compile/publicapi_cimport.pyx
+2
-0
tests/compile/publicapi_pxd_mix.pxd
tests/compile/publicapi_pxd_mix.pxd
+7
-2
tests/compile/publicapi_pxd_mix.pyx
tests/compile/publicapi_pxd_mix.pyx
+2
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
f96286b3
...
...
@@ -1006,6 +1006,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
type
=
entry
.
type
if
not
definition
and
entry
.
defined_in_pxd
:
storage_class
=
"static "
dll_linkage
=
None
type
=
CPtrType
(
type
)
header
=
type
.
declaration_code
(
entry
.
cname
,
dll_linkage
=
dll_linkage
)
...
...
Cython/Compiler/Symtab.py
View file @
f96286b3
...
...
@@ -582,7 +582,8 @@ class Scope(object):
api = 0, in_pxd = 0, modifiers = (), utility_code = None):
# Add an entry for a C function.
if not cname:
if api or visibility != 'private':
if (visibility == 'extern' or
visibility == 'public'and defining):
cname = name
else:
cname = self.mangle(Naming.func_prefix, name)
...
...
@@ -612,6 +613,8 @@ class Scope(object):
entry.type = type
else:
error(pos, "
Function
signature
does
not
match
previous
declaration
")
entry.cname = cname
entry.func_cname = cname
else:
entry = self.add_cfunction(name, type, pos, cname, visibility, modifiers)
entry.func_cname = cname
...
...
tests/compile/publicapi_cimport.pyx
0 → 100644
View file @
f96286b3
# mode: compile
from
publicapi_pxd_mix
cimport
*
tests/compile/publicapi_pxd_mix.pxd
View file @
f96286b3
...
...
@@ -49,12 +49,17 @@ cdef public api class Bar3 [type PyBar3_Type, object PyBar3_Object]: pass
# --
cdef
inline
void
bar0
():
pass
cdef
extern
from
*
:
void
foo
()
cdef
inline
void
bar
():
pass
cdef
void
bar0
()
cdef
public
void
bar1
()
cdef
api
void
bar2
()
cdef
public
api
void
bar3
()
cdef
inline
void
*
spam0
(
object
o
)
except
NULL
:
return
NULL
cdef
inline
void
*
spam
(
object
o
)
except
NULL
:
return
NULL
cdef
void
*
spam0
(
object
o
)
except
NULL
cdef
public
void
*
spam1
(
object
o
)
except
NULL
cdef
api
void
*
spam2
(
object
o
)
nogil
except
NULL
cdef
public
api
void
*
spam3
(
object
o
)
except
NULL
with
gil
...
...
tests/compile/publicapi_pxd_mix.pyx
View file @
f96286b3
...
...
@@ -8,10 +8,12 @@ cdef class Bar1: pass
cdef
class
Bar2
:
pass
cdef
class
Bar3
:
pass
cdef
void
bar0
():
pass
cdef
public
void
bar1
():
pass
cdef
api
void
bar2
():
pass
cdef
public
api
void
bar3
():
pass
cdef
void
*
spam0
(
object
o
)
except
NULL
:
return
NULL
cdef
public
void
*
spam1
(
object
o
)
except
NULL
:
return
NULL
cdef
api
void
*
spam2
(
object
o
)
nogil
except
NULL
:
return
NULL
cdef
public
api
void
*
spam3
(
object
o
)
except
NULL
with
gil
:
return
NULL
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