summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-04 01:48:50 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-04 01:48:50 (GMT)
commit66ecda499052f1100770c2dabe5627f58153e963 (patch)
treed135669edb9062b38c395ef62d4e64b7326b6543 /Modules/mathmodule.c
parent654ede7ef49f10a3c1d2c6b0257e62c6d297e8cc (diff)
downloadcpython-66ecda499052f1100770c2dabe5627f58153e963.zip
cpython-66ecda499052f1100770c2dabe5627f58153e963.tar.gz
cpython-66ecda499052f1100770c2dabe5627f58153e963.tar.bz2
Fixed math.copysign() on Windows
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 2c6262d..44a9d93 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -133,14 +133,16 @@ FUNC1(cos, cos,
"cos(x)\n\nReturn the cosine of x (measured in radians).")
FUNC1(cosh, cosh,
"cosh(x)\n\nReturn the hyperbolic cosine of x.")
-#if defined(MS_WINDOWS) || defined(HAVE_COPYSIGN)
+
#ifdef MS_WINDOWS
-FUNC2(copysign, _copysign,
-#else
-FUNC2(copysign, copysign,
+# define copysign _copysign
+# define HAVE_COPYSIGN 1
#endif
- "copysign(x,y)\n\nReturn x with the sign of y.");
+#ifdef HAVE_COPYSIGN
+FUNC2(copysign, copysign,
+ "copysign(x,y)\n\nReturn x with the sign of y.");
#endif
+
FUNC1(exp, exp,
"exp(x)\n\nReturn e raised to the power of x.")
FUNC1(fabs, fabs,
@@ -383,7 +385,7 @@ static PyMethodDef math_methods[] = {
{"atan", math_atan, METH_O, math_atan_doc},
{"atan2", math_atan2, METH_VARARGS, math_atan2_doc},
{"ceil", math_ceil, METH_O, math_ceil_doc},
-#if defined(MS_WINDOWS) || defined(HAVE_COPYSIGN)
+#ifdef HAVE_COPYSIGN
{"copysign", math_copysign, METH_VARARGS, math_copysign_doc},
#endif
{"cos", math_cos, METH_O, math_cos_doc},