mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2024-12-04 22:46:59 +00:00
fix strict aliasing issue with mathlib.h IS_NAN() macro
I assume the memcpy will be nicely optimised away, but not really critical anyway. Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
352565504c
commit
726e4365c1
@ -57,7 +57,11 @@ struct mplane_s;
|
||||
extern vec3_t vec3_origin;
|
||||
extern int nanmask;
|
||||
|
||||
#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask)
|
||||
#define IS_NAN(x) ({ \
|
||||
int tmp; \
|
||||
memcpy(&tmp, &x, sizeof(int)); \
|
||||
((tmp & nanmask) == nanmask); \
|
||||
})
|
||||
|
||||
#define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
|
||||
#define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];}
|
||||
|
Loading…
Reference in New Issue
Block a user