xref: /haiku/src/system/libroot/posix/glibc/stdlib/strtof.c (revision 5af32e752606778be5dd7379f319fe43cb3f6b8c)
1*5af32e75SAxel Dörfler /* The actual implementation for all floating point sizes is in strtod.c.
2*5af32e75SAxel Dörfler    These macros tell it to produce the `float' version, `strtof'.  */
3*5af32e75SAxel Dörfler 
4*5af32e75SAxel Dörfler #define	FLOAT		float
5*5af32e75SAxel Dörfler #define	FLT		FLT
6*5af32e75SAxel Dörfler #ifdef USE_IN_EXTENDED_LOCALE_MODEL
7*5af32e75SAxel Dörfler # define STRTOF		__strtof_l
8*5af32e75SAxel Dörfler #else
9*5af32e75SAxel Dörfler # define STRTOF		strtof
10*5af32e75SAxel Dörfler #endif
11*5af32e75SAxel Dörfler #define	MPN2FLOAT	__mpn_construct_float
12*5af32e75SAxel Dörfler #define	FLOAT_HUGE_VAL	HUGE_VALF
13*5af32e75SAxel Dörfler #define SET_MANTISSA(flt, mant) \
14*5af32e75SAxel Dörfler   do { union ieee754_float u;						      \
15*5af32e75SAxel Dörfler        u.f = (flt);							      \
16*5af32e75SAxel Dörfler        if ((mant & 0x7fffff) == 0)					      \
17*5af32e75SAxel Dörfler 	 mant = 0x400000;						      \
18*5af32e75SAxel Dörfler        u.ieee.mantissa = (mant) & 0x7fffff;				      \
19*5af32e75SAxel Dörfler        (flt) = u.f;							      \
20*5af32e75SAxel Dörfler   } while (0)
21*5af32e75SAxel Dörfler 
22*5af32e75SAxel Dörfler #include "strtod.c"
23