Commit b947c556 authored by Mark Florisson's avatar Mark Florisson

Generate Lion fix only for outer parallel sections

parent 92812a61
...@@ -7736,20 +7736,22 @@ class ParallelStatNode(StatNode, ParallelNode): ...@@ -7736,20 +7736,22 @@ class ParallelStatNode(StatNode, ParallelNode):
""" """
A bug on OS X Lion disallows __builtin_expect macros. This code avoids them A bug on OS X Lion disallows __builtin_expect macros. This code avoids them
""" """
code.putln("#if %s" % self.redef_condition) if not self.parent:
code.putln(" #undef likely") code.putln("#if %s" % self.redef_condition)
code.putln(" #undef unlikely") code.putln(" #undef likely")
code.putln(" #define likely(x) (x)") code.putln(" #undef unlikely")
code.putln(" #define unlikely(x) (x)") code.putln(" #define likely(x) (x)")
code.putln("#endif") code.putln(" #define unlikely(x) (x)")
code.putln("#endif")
def redef_builtin_expect_apple_gcc_bug(self, code): def redef_builtin_expect_apple_gcc_bug(self, code):
code.putln("#if %s" % self.redef_condition) if not self.parent:
code.putln(" #undef likely") code.putln("#if %s" % self.redef_condition)
code.putln(" #undef unlikely") code.putln(" #undef likely")
code.putln(" #define likely(x) __builtin_expect(!!(x), 1)") code.putln(" #undef unlikely")
code.putln(" #define unlikely(x) __builtin_expect(!!(x), 0)") code.putln(" #define likely(x) __builtin_expect(!!(x), 1)")
code.putln("#endif") code.putln(" #define unlikely(x) __builtin_expect(!!(x), 0)")
code.putln("#endif")
class ParallelWithBlockNode(ParallelStatNode): class ParallelWithBlockNode(ParallelStatNode):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment