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
f6d6e998
Commit
f6d6e998
authored
Nov 12, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group definition of Py2/Py3 bytes/str compatibility macros in generated C code
parent
c7bc0930
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-2
No files found.
Cython/Compiler/ModuleNode.py
View file @
f6d6e998
...
...
@@ -454,7 +454,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
" #define PyVarObject_HEAD_INIT(type, size)
\
\
"
)
code
.
putln
(
" PyObject_HEAD_INIT(type) size,"
)
code
.
putln
(
" #define PyType_Modified(t)"
)
code
.
putln
(
" #define PyBytes_CheckExact PyString_CheckExact"
)
code
.
putln
(
""
)
code
.
putln
(
" typedef struct {"
)
code
.
putln
(
" void *buf;"
)
...
...
@@ -497,6 +496,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
" #define PyBaseString_Type PyUnicode_Type"
)
code
.
putln
(
" #define PyString_Type PyUnicode_Type"
)
code
.
putln
(
" #define PyString_CheckExact PyUnicode_CheckExact"
)
code
.
putln
(
"#else"
)
code
.
putln
(
" #define PyBytes_Type PyString_Type"
)
code
.
putln
(
" #define PyBytes_CheckExact PyString_CheckExact"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
"#if PY_MAJOR_VERSION >= 3"
)
code
.
putln
(
" #define PyInt_Type PyLong_Type"
)
code
.
putln
(
" #define PyInt_Check(op) PyLong_Check(op)"
)
code
.
putln
(
" #define PyInt_CheckExact(op) PyLong_CheckExact(op)"
)
...
...
@@ -519,7 +524,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
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
(
" #define PyBytes_Type PyString_Type"
)
code
.
putln
(
"#endif"
)
code
.
putln
(
"#if PY_MAJOR_VERSION >= 3"
)
...
...
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