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
Boxiang Sun
cython
Commits
4fc682ab
Commit
4fc682ab
authored
Feb 19, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complile/runtime version mismatch warning.
parent
c71adccb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+40
-0
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+2
-1
No files found.
Cython/Compiler/ModuleNode.py
View file @
4fc682ab
...
@@ -1744,6 +1744,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1744,6 +1744,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"#endif"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
"{"
)
code
.
putln
(
"{"
)
tempdecl_code
=
code
.
insertion_point
()
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
(
"#if CYTHON_REFNANNY"
)
code
.
putln
(
"void* __pyx_refnanny = NULL;"
)
code
.
putln
(
"void* __pyx_refnanny = NULL;"
)
...
@@ -2850,3 +2853,40 @@ packed_struct_utility_code = UtilityCode(proto="""
...
@@ -2850,3 +2853,40 @@ packed_struct_utility_code = UtilityCode(proto="""
#define __Pyx_PACKED
#define __Pyx_PACKED
#endif
#endif
"""
,
impl
=
""
,
proto_block
=
'utility_code_proto_before_types'
)
"""
,
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/Options.py
View file @
4fc682ab
...
@@ -45,7 +45,8 @@ init_local_none = 1
...
@@ -45,7 +45,8 @@ init_local_none = 1
# Whether or not to embed the Python interpreter, for use in making a
# Whether or not to embed the Python interpreter, for use in making a
# standalone executable or calling from external libraries.
# 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
embed
=
None
# Disables function redefinition, allowing all functions to be declared at
# Disables function redefinition, allowing all functions to be declared at
...
...
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