diff options
author | Chris Robinson <[email protected]> | 2017-06-29 09:57:19 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-06-29 09:57:19 -0700 |
commit | aefa11b6adf3bdd0e82d2c2f125d2bd62288e246 (patch) | |
tree | f4fc0e6c6cf69133fdc7ec5b1e21459b4eeb4610 /common/math_defs.h | |
parent | cee2d226d22786a7416704a39357759e0022750b (diff) |
Workaround for MSVC not liking 1.0f/0.0f for float infinity
Diffstat (limited to 'common/math_defs.h')
-rw-r--r-- | common/math_defs.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/math_defs.h b/common/math_defs.h index 8756488c..1b394976 100644 --- a/common/math_defs.h +++ b/common/math_defs.h @@ -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)) |