diff options
-rw-r--r-- | vigra/vigra1.6.0.patch | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/vigra/vigra1.6.0.patch b/vigra/vigra1.6.0.patch index 43fc8cf09224..b784a590f764 100644 --- a/vigra/vigra1.6.0.patch +++ b/vigra/vigra1.6.0.patch @@ -739,6 +739,89 @@ diff -uprN misc/vigra1.6.0/include/vigra/gaussians.hxx misc/build/vigra1.6.0/inc } calculateHermitePolynomial(); } +diff -uprN misc/vigra1.6.0/include/vigra/mathutil.hxx misc/build/vigra1.6.0/include/vigra/mathutil.hxx +--- misc/vigra1.6.0/include/vigra/mathutil.hxx 2008-08-13 08:15:38.000000000 -0500 ++++ misc/build/vigra1.6.0/include/vigra/mathutil.hxx 2012-09-20 22:05:29.000000000 -0500 +@@ -88,7 +88,7 @@ using VIGRA_CSTD::ceil; + + // import abs(float), abs(double), abs(long double) from <cmath> + // and abs(int), abs(long), abs(long long) from <cstdlib> +-using std::abs; ++//using std::abs; + + // define the missing variants of abs() to avoid 'ambigous overload' + // errors in template functions +@@ -100,10 +100,39 @@ VIGRA_DEFINE_UNSIGNED_ABS(unsigned char) + VIGRA_DEFINE_UNSIGNED_ABS(unsigned short) + VIGRA_DEFINE_UNSIGNED_ABS(unsigned int) + VIGRA_DEFINE_UNSIGNED_ABS(unsigned long) ++#ifdef VIGRA_HAS_LONG_LONG + VIGRA_DEFINE_UNSIGNED_ABS(unsigned long long) ++#endif + + #undef VIGRA_DEFINE_UNSIGNED_ABS + ++#define VIGRA_DEFINE_SIGNED_ABS(T) \ ++ inline T abs(T t) { return (T)abs(t); } ++#define VIGRA_DEFINE_SIGNED_LABS(T) \ ++ inline T abs(T t) { return (T)labs(t); } ++#define VIGRA_DEFINE_SIGNED_LLABS(T) \ ++ inline T abs(T t) { return (T)llabs(t); } ++#define VIGRA_DEFINE_FABS(T) \ ++ inline T abs(T t) { return (T)fabs(t); } ++ ++VIGRA_DEFINE_SIGNED_ABS(signed char) ++VIGRA_DEFINE_SIGNED_ABS(signed short) ++VIGRA_DEFINE_SIGNED_ABS(signed int) ++VIGRA_DEFINE_SIGNED_LABS(signed long) ++#ifdef VIGRA_HAS_LONG_LONG ++VIGRA_DEFINE_SIGNED_LLABS(signed long long) ++#endif ++VIGRA_DEFINE_FABS(float) ++VIGRA_DEFINE_FABS(double) ++#ifdef VIGRA_HAS_LONG_DOUBLE ++VIGRA_DEFINE_FABS(long double) ++#endif ++ ++#undef VIGRA_DEFINE_SIGNED_ABS ++#undef VIGRA_DEFINE_SIGNED_LABS ++#undef VIGRA_DEFINE_SIGNED_LLABS ++#undef VIGRA_DEFINE_FABS ++ + #define VIGRA_DEFINE_MISSING_ABS(T) \ + inline T abs(T t) { return t < 0 ? -t : t; } + +@@ -134,12 +163,14 @@ inline double round(double t) + : ceil(t - 0.5); + } + ++#ifdef VIGRA_HAS_LONG_DOUBLE + inline long double round(long double t) + { + return t >= 0.0 + ? floor(t + 0.5) + : ceil(t - 0.5); + } ++#endif + + /*! Round up to the nearest power of 2. + +@@ -440,9 +471,15 @@ VIGRA_DEFINE_NORM(int) + VIGRA_DEFINE_NORM(unsigned int) + VIGRA_DEFINE_NORM(long) + VIGRA_DEFINE_NORM(unsigned long) ++#ifdef VIGRA_HAS_LONG_LONG ++VIGRA_DEFINE_NORM(long long) ++VIGRA_DEFINE_NORM(unsigned long long) ++#endif + VIGRA_DEFINE_NORM(float) + VIGRA_DEFINE_NORM(double) ++#ifdef VIGRA_HAS_LONG_DOUBLE + VIGRA_DEFINE_NORM(long double) ++#endif + + #undef VIGRA_DEFINE_NORM + diff -uprN misc/vigra1.6.0/include/vigra/numerictraits.hxx misc/build/vigra1.6.0/include/vigra/numerictraits.hxx --- misc/vigra1.6.0/include/vigra/numerictraits.hxx 2008-08-13 08:15:39.000000000 -0500 +++ misc/build/vigra1.6.0/include/vigra/numerictraits.hxx 2012-09-19 17:30:24.000000000 -0500 |