about summary refs log tree commit diff
path: root/wcsmbs
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/wcstof.c6
-rw-r--r--wcsmbs/wcstold.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/wcsmbs/wcstof.c b/wcsmbs/wcstof.c
index 7d91cf33d6..ef1448b096 100644
--- a/wcsmbs/wcstof.c
+++ b/wcsmbs/wcstof.c
@@ -27,5 +27,11 @@
 #define	MPN2FLOAT	__mpn_construct_float
 #define	FLOAT_HUGE_VAL	HUGE_VALF
 #define	USE_WIDE_CHAR	1
+#define SET_MANTISSA(flt, mant) \
+  do { union ieee754_float u;						      \
+       u.f = (flt);							      \
+       u.ieee.mantissa = (mant) & 0x7fffff;				      \
+       (flt) = u.f;							      \
+  } while (0)
 
 #include "../stdlib/strtod.c"
diff --git a/wcsmbs/wcstold.c b/wcsmbs/wcstold.c
index 4cb68af1f8..c94d47ea4f 100644
--- a/wcsmbs/wcstold.c
+++ b/wcsmbs/wcstold.c
@@ -27,5 +27,12 @@
 #define	MPN2FLOAT	__mpn_construct_long_double
 #define	FLOAT_HUGE_VAL	HUGE_VALL
 #define	USE_WIDE_CHAR	1
+#define SET_MANTISSA(flt, mant) \
+  do { union ieee854_long_double u;					      \
+       u.d = (flt);							      \
+       u.ieee.mantissa0 = ((mant) >> 32) & 0x7fffffff;			      \
+       u.ieee.mantissa1 = (mant) & 0xffffffff;				      \
+       (flt) = u.d;							      \
+  } while (0)
 
 #include "../stdlib/strtod.c"