Workaround for MSVC not liking 1.0f/0.0f for float infinity

This commit is contained in:
Chris Robinson 2017-06-29 09:57:19 -07:00
parent cee2d226d2
commit aefa11b6ad

View File

@ -15,7 +15,11 @@
#endif
#ifndef HUGE_VALF
#define HUGE_VALF (1.0f/0.0f)
static const union msvc_inf_hack {
unsigned char b[4];
float f;
} msvc_inf_union = {{ 0x00, 0x00, 0x80, 0x7F }};
#define HUGE_VALF (msvc_inf_union.f)
#endif
#define DEG2RAD(x) ((float)(x) * (F_PI/180.0f))