diff --git a/Examples/test-suite/li_math.i b/Examples/test-suite/li_math.i index 3aa3db303..db39cd3de 100644 --- a/Examples/test-suite/li_math.i +++ b/Examples/test-suite/li_math.i @@ -1,7 +1,2 @@ %module li_math -#ifdef SWIGPHP -// PHP already provides these functions with the same names, so just kill that -// warning. -%warnfilter(SWIGWARN_PARSE_KEYWORD); -#endif %include math.i diff --git a/Lib/math.i b/Lib/math.i index a37c92d19..ac8d9a6eb 100644 --- a/Lib/math.i +++ b/Lib/math.i @@ -9,6 +9,8 @@ #include %} +#ifndef SWIGPHP /* PHP already provides all these functions except fabs() */ + extern double cos(double x); /* Cosine of x */ @@ -54,9 +56,6 @@ extern double pow(double x, double y); extern double sqrt(double x); /* Square root. x >= 0 */ -extern double fabs(double x); -/* Absolute value of x */ - extern double ceil(double x); /* Smallest integer not less than x, as a double */ @@ -66,6 +65,13 @@ extern double floor(double x); extern double fmod(double x, double y); /* Floating-point remainder of x/y, with the same sign as x. */ +#endif + +extern double fabs(double x); +/* Absolute value of x */ + +#ifndef SWIGPHP /* PHP already provides these constants and it's an error to redefine them */ + #define M_E 2.7182818284590452354 #define M_LOG2E 1.4426950408889634074 #define M_LOG10E 0.43429448190325182765 @@ -80,3 +86,4 @@ extern double fmod(double x, double y); #define M_SQRT2 1.41421356237309504880 #define M_SQRT1_2 0.70710678118654752440 +#endif