port.h: Add INFINITY macro.
This commit is contained in:
parent
7d24e59229
commit
cb8af0152c
|
@ -199,6 +199,15 @@ struct statvfs
|
|||
#define M_PI_2 1.570796326794896619
|
||||
#endif
|
||||
|
||||
#ifndef INFINITY
|
||||
static inline float __port_infinity(void)
|
||||
{
|
||||
static const unsigned __inf_bytes = 0x7f800000;
|
||||
return *(const float *)&__inf_bytes;
|
||||
}
|
||||
#define INFINITY __port_infinity()
|
||||
#endif
|
||||
|
||||
#ifndef NAN
|
||||
static inline float __port_nan(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue