aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-06 19:14:17 -0800
committerChris Robinson <[email protected]>2018-11-06 19:14:17 -0800
commit27fbccfb23bf6212c8e4a3ecf4bd61ff764fbfd4 (patch)
treeeaf46a0541cd0523784dacdbd8b4187e2ccb49ea
parentd76e9800dabcb1142be2daf69875e165a6da36ed (diff)
Don't directly declare standard function names
-rw-r--r--common/math_defs.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/math_defs.h b/common/math_defs.h
index aa79b695..1b24bec4 100644
--- a/common/math_defs.h
+++ b/common/math_defs.h
@@ -33,21 +33,23 @@ static const union msvc_inf_hack {
#endif
#ifndef HAVE_LOG2F
-static inline float log2f(float f)
+static inline float my_log2f(float f)
{
return logf(f) / logf(2.0f);
}
+#define log2f my_log2f
#endif
#ifndef HAVE_CBRTF
-static inline float cbrtf(float f)
+static inline float my_cbrtf(float f)
{
return powf(f, 1.0f/3.0f);
}
+#define cbrtf my_cbrtf
#endif
#ifndef HAVE_COPYSIGNF
-static inline float copysignf(float x, float y)
+static inline float my_copysignf(float x, float y)
{
union {
float f;
@@ -57,6 +59,7 @@ static inline float copysignf(float x, float y)
ux.u |= (uy.u&0x80000000u);
return ux.f;
}
+#define copysignf my_copysignf
#endif
#define DEG2RAD(x) ((float)(x) * (float)(M_PI/180.0))