aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/math_defs.h7
1 files changed, 7 insertions, 0 deletions
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))