Package: stlport5.2
Severity: important
Version: 5.2.1-3
Tags: patch
User: glibc-bsd-de...@lists.alioth.debian.org
Usertags: kfreebsd
Hi,
the current version fails to build on GNU/kFreeBSD due to
mis-detection of float/double/long double support.
Please find attached patch with needed change
sed s/__linux__/__GLIBC__/
This support should not depend on kernel but
on the libc implementation and compiler.
It would also be nice if you can ask upstream
to include this change.
Thanks in advance
Petr
--- stlport5.2-5.2.1.orig/src/num_get_float.cpp
+++ stlport5.2-5.2.1/src/num_get_float.cpp
@@ -27,7 +27,7 @@
# include <stdint.h>
#endif
-#if defined (__linux__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
+#if defined (__GLIBC__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
defined (__BORLANDC__) || defined (__DMC__) || defined (__HP_aCC)
# if defined (__BORLANDC__)
@@ -50,7 +50,7 @@
} i32;
};
-# if defined (__linux__)
+# if defined (__GLIBC__)
# include <ieee754.h>
# else
union ieee854_long_double {
@@ -135,7 +135,7 @@
high = u1 * v1 + w2 + (x >> 32);
}
-#ifndef __linux__
+#ifndef __GLIBC__
# define bit11 ULL(0x7ff)
# define exponent_mask (bit11 << 52)
@@ -148,7 +148,7 @@
void _Stl_set_exponent(uint64 &val, uint64 exp)
{ val = (val & ~exponent_mask) | ((exp & bit11) << 52); }
-#endif // __linux__
+#endif // __GLIBC__
/* Power of ten fractions for tenscale*/
/* The constants are factored so that at most two constants
@@ -323,7 +323,7 @@
// Third argument is base-10 exponent.
/* IEEE representation */
-#if !defined (__linux__)
+#if !defined (__GLIBC__)
union _Double_rep {
uint64 ival;
@@ -475,7 +475,7 @@
#endif
-#if defined (__linux__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
+#if defined (__GLIBC__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
defined (__BORLANDC__) || defined (__DMC__) || defined (__HP_aCC)
template <class D, class IEEE, int M, int BIAS>
@@ -638,9 +638,9 @@
return v.d;
}
-#endif // __linux__
+#endif // __GLIBC__
-#ifndef __linux__
+#ifndef __GLIBC__
static double _Stl_string_to_double(const char *s) {
typedef numeric_limits<double> limits;
const int max_digits = limits::digits10 + 2;
@@ -741,7 +741,7 @@
#endif
-#if defined (__linux__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
+#if defined (__GLIBC__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
defined (__BORLANDC__) || defined (__DMC__) || defined (__HP_aCC)
template <class D, class IEEE, int M, int BIAS>
@@ -839,12 +839,12 @@
return Negate ? -x : x;
}
-#endif // __linux__
+#endif // __GLIBC__
void _STLP_CALL
__string_to_float(const __iostring& v, float& val)
{
-#if !defined (__linux__)
+#if !defined (__GLIBC__)
val = (float)_Stl_string_to_double(v.c_str());
#else
val = (float)_Stl_string_to_doubleT<double,ieee754_double,12,IEEE754_DOUBLE_BIAS>(v.c_str());
@@ -854,7 +854,7 @@
void _STLP_CALL
__string_to_float(const __iostring& v, double& val)
{
-#if !defined (__linux__)
+#if !defined (__GLIBC__)
val = _Stl_string_to_double(v.c_str());
#else
val = _Stl_string_to_doubleT<double,ieee754_double,12,IEEE754_DOUBLE_BIAS>(v.c_str());
@@ -864,7 +864,7 @@
#if !defined (_STLP_NO_LONG_DOUBLE)
void _STLP_CALL
__string_to_float(const __iostring& v, long double& val) {
-#if !defined (__linux__) && !defined (__MINGW32__) && !defined (__CYGWIN__) && \
+#if !defined (__GLIBC__) && !defined (__MINGW32__) && !defined (__CYGWIN__) && \
!defined (__BORLANDC__) && !defined (__DMC__) && !defined (__HP_aCC)
//The following function is valid only if long double is an alias for double.
_STLP_STATIC_ASSERT( sizeof(long double) <= sizeof(double) )