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
e449a8b2
Commit
e449a8b2
authored
Jul 28, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove gcc dependance for inline, branch prediction
parent
eebdac3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+14
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
No files found.
Cython/Compiler/Nodes.py
View file @
e449a8b2
...
...
@@ -2590,12 +2590,20 @@ class FromImportStatNode(StatNode):
utility_function_predeclarations
=
\
"""
#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INILNE __inline
#else
#define INLINE
#endif
typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static
inline
int __Pyx_PyObject_IsTrue(PyObject* x) {
static
INILNE
int __Pyx_PyObject_IsTrue(PyObject* x) {
if (x == Py_True) return 1;
else if (x == Py_False) return 0;
else return PyObject_IsTrue(x);
...
...
@@ -2606,8 +2614,13 @@ static inline int __Pyx_PyObject_IsTrue(PyObject* x) {
if
Options
.
gcc_branch_hints
:
branch_prediction_macros
=
\
"""
#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
"""
else
:
branch_prediction_macros
=
\
...
...
Cython/Compiler/Parsing.py
View file @
e449a8b2
...
...
@@ -1662,7 +1662,7 @@ def p_visibility(s, prev_visibility):
def
p_c_modifiers
(
s
):
if
s
.
systring
in
(
'inline'
,
):
modifier
=
s
.
systring
modifier
=
s
.
systring
.
upper
()
# uppercase is macro defined for various compilers
s
.
next
()
return
modifier
+
' '
+
p_c_modifiers
(
s
)
return
""
...
...
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