Commit 9b42c5a1 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by Stefan Behnel

Work around missing Cygwin truncl.

parent 31a4969f
...@@ -2085,8 +2085,13 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin, ...@@ -2085,8 +2085,13 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
elif node.type.assignable_from(func_arg.type) or func_arg.type.is_float: elif node.type.assignable_from(func_arg.type) or func_arg.type.is_float:
return ExprNodes.TypecastNode(node.pos, operand=func_arg, type=node.type) return ExprNodes.TypecastNode(node.pos, operand=func_arg, type=node.type)
elif func_arg.type.is_float and node.type.is_numeric: elif func_arg.type.is_float and node.type.is_numeric:
if func_arg.type.math_h_modifier == 'l':
# Work around missing Cygwin definition.
truncl = '__Pyx_truncl'
else:
truncl = 'trunc' + func_arg.type.math_h_modifier
return ExprNodes.PythonCapiCallNode( return ExprNodes.PythonCapiCallNode(
node.pos, 'trunc' + func_arg.type.math_h_modifier, node.pos, truncl,
func_type=self.float_float_func_types[func_arg.type], func_type=self.float_float_func_types[func_arg.type],
args=[func_arg], args=[func_arg],
py_name='int', py_name='int',
......
...@@ -311,6 +311,12 @@ static CYTHON_INLINE float __PYX_NAN() { ...@@ -311,6 +311,12 @@ static CYTHON_INLINE float __PYX_NAN() {
} }
#endif #endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
/////////////// UtilityFunctionPredeclarations.proto /////////////// /////////////// UtilityFunctionPredeclarations.proto ///////////////
......
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