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
43a9402d
Commit
43a9402d
authored
Sep 05, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move future division #defines out of ModuleNode.py.
parent
a3842d42
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-14
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+8
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
43a9402d
...
...
@@ -626,6 +626,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
from
..
import
__version__
code
.
putln
(
'#define CYTHON_ABI "%s"'
%
__version__
.
replace
(
'.'
,
'_'
))
code
.
putln
(
"#define CYTHON_FUTURE_DIVISION %d"
%
(
Future
.
division
in
env
.
context
.
future_directives
))
self
.
_put_setup_code
(
code
,
"CModulePreamble"
)
if
env
.
context
.
options
.
cplus
:
...
...
@@ -645,20 +647,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
}
"""
%
(
Naming
.
filename_cname
,
Naming
.
filetable_cname
,
Naming
.
lineno_cname
,
cinfo
))
code
.
put
(
"""
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
"""
)
if
Future
.
division
in
env
.
context
.
future_directives
:
code
.
putln
(
" #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)"
)
code
.
putln
(
" #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)"
)
else
:
code
.
putln
(
" #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)"
)
code
.
putln
(
" #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
""
)
self
.
generate_extern_c_macro_definition
(
code
)
code
.
putln
(
""
)
...
...
Cython/Utility/ModuleSetupCode.c
View file @
43a9402d
...
...
@@ -244,6 +244,14 @@
#define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
/* new Py3.3 unicode type (PEP 393) */
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
...
...
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