From a69d608a1ec38e6afd903224e86c0bf29b8d0623 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 29 Jun 2017 10:11:31 -0700 Subject: Define a backup log2f if the compiler doesn't have it --- common/math_defs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/math_defs.h') diff --git a/common/math_defs.h b/common/math_defs.h index 1b394976..cbe9091f 100644 --- a/common/math_defs.h +++ b/common/math_defs.h @@ -22,6 +22,13 @@ static const union msvc_inf_hack { #define HUGE_VALF (msvc_inf_union.f) #endif +#ifndef HAVE_LOG2F +static inline float log2f(float f) +{ + return logf(f) / logf(2.0f); +} +#endif + #define DEG2RAD(x) ((float)(x) * (F_PI/180.0f)) #define RAD2DEG(x) ((float)(x) * (180.0f/F_PI)) -- cgit v1.2.3