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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
61a825b7
Commit
61a825b7
authored
Feb 20, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'upstream/master'
parents
6d2165ee
4fc682ab
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
2 deletions
+46
-2
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+40
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-0
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+2
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+2
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
61a825b7
...
...
@@ -1745,6 +1745,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"{"
)
tempdecl_code
=
code
.
insertion_point
()
env
.
use_utility_code
(
check_binary_version_utility_code
)
code
.
putln
(
"__Pyx_check_binary_version();"
)
code
.
putln
(
"#if CYTHON_REFNANNY"
)
code
.
putln
(
"void* __pyx_refnanny = NULL;"
)
code
.
putln
(
"__Pyx_RefNanny = __Pyx_RefNannyImportAPI(
\
"
refnanny
\
"
);"
)
...
...
@@ -2852,3 +2855,40 @@ packed_struct_utility_code = UtilityCode(proto="""
#define __Pyx_PACKED
#endif
"""
,
impl
=
""
,
proto_block
=
'utility_code_proto_before_types'
)
check_binary_version_utility_code
=
UtilityCode
(
proto
=
"""
static int __Pyx_check_binary_version(void);
"""
,
impl
=
"""
static int __Pyx_check_binary_version(void) {
int res = -1;
PyObject *major_info = NULL;
PyObject *minor_info = NULL;
PyObject *version_info = PySys_GetObject("version_info");
if (version_info == NULL) goto bad;
major_info = PySequence_GetItem(version_info, 0);
if (major_info == NULL || !PyInt_CheckExact(major_info)) goto bad;
minor_info = PySequence_GetItem(version_info, 1);
if (minor_info == NULL || !PyInt_CheckExact(minor_info)) goto bad;
if (PyInt_AsLong(major_info) == PY_MAJOR_VERSION && PyInt_AsLong(minor_info) == PY_MINOR_VERSION) {
res = 0;
} else {
char warning[200];
PyOS_snprintf(warning, sizeof(warning),
"compiletime version (%d, %d) of module %s does not match runtime version (%ld, %ld)",
PY_MAJOR_VERSION, PY_MINOR_VERSION,
__Pyx_MODULE_NAME,
PyInt_AsLong(major_info), PyInt_AsLong(minor_info));
#if PY_VERSION_HEX < 0x02050000
PyErr_Warn(NULL, warning);
#else
PyErr_WarnEx(NULL, warning, 0);
#endif
res = 1;
}
bad:
Py_XDECREF(version_info);
Py_XDECREF(major_info);
Py_XDECREF(minor_info);
return res;
}
"""
)
Cython/Compiler/Nodes.py
View file @
61a825b7
...
...
@@ -1057,6 +1057,8 @@ class CppClassNode(CStructOrUnionDefNode):
self
.
entry
=
env
.
declare_cpp_class
(
self
.
name
,
scope
,
self
.
pos
,
self
.
cname
,
base_class_types
,
visibility
=
self
.
visibility
,
templates
=
template_types
)
if
self
.
entry
is
None
:
return
self
.
entry
.
is_cpp_class
=
1
if
self
.
attributes
is
not
None
:
if
self
.
in_pxd
and
not
env
.
in_cinclude
:
...
...
Cython/Compiler/Options.py
View file @
61a825b7
...
...
@@ -45,7 +45,8 @@ init_local_none = 1
# Whether or not to embed the Python interpreter, for use in making a
# standalone executable or calling from external libraries.
# This will provide a method which simply executes the body of this module.
# This will provide a method which initalizes the interpreter and
# executes the body of this module.
embed
=
None
# Disables function redefinition, allowing all functions to be declared at
...
...
Cython/Compiler/Symtab.py
View file @
61a825b7
...
...
@@ -449,7 +449,8 @@ class Scope(object):
visibility = visibility, defining = scope is not None)
else:
if not (entry.is_type and entry.type.is_cpp_class):
warning(pos, "'%s'
redeclared
" % name, 0)
error(pos, "'%s'
redeclared
" % name)
return None
elif scope and entry.type.scope:
warning(pos, "'%s'
already
defined
(
ignoring
second
definition
)
" % name, 0)
else:
...
...
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