Get rid of strict aliasing rule violations from libm (#3069)
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
committed by
Robert Fancsik
parent
f7391a94ae
commit
3763ac8371
@@ -48,13 +48,36 @@
|
||||
#endif /* !__LITTLE_ENDIAN */
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
#define __HI(x) *(1 + (int *) &x)
|
||||
#define __LO(x) *(int *) &x
|
||||
#define __HI(x) *(1 + (const int *) &x)
|
||||
#define __LO(x) *(const int *) &x
|
||||
typedef union
|
||||
{
|
||||
double dbl;
|
||||
struct
|
||||
{
|
||||
int lo;
|
||||
int hi;
|
||||
} as_int;
|
||||
} double_accessor;
|
||||
#else /* !__LITTLE_ENDIAN */
|
||||
#define __HI(x) *(int *) &x
|
||||
#define __LO(x) *(1 + (int *) &x)
|
||||
#define __HI(x) *(const int *) &x
|
||||
#define __LO(x) *(1 + (const int *) &x)
|
||||
|
||||
typedef union
|
||||
{
|
||||
double dbl;
|
||||
struct
|
||||
{
|
||||
int hi;
|
||||
int lo;
|
||||
} as_int;
|
||||
} double_accessor;
|
||||
#endif /* __LITTLE_ENDIAN */
|
||||
|
||||
#ifndef NAN
|
||||
#define NAN (0.0/0.0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ANSI/POSIX
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user