diff --git a/stepmania/src/global.h b/stepmania/src/global.h index b2f144c051..2e65c2bdb3 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -13,6 +13,10 @@ #ifndef STDAFX_H #define STDAFX_H +#ifdef HAVE_CONFIG_H +#include +#endif + #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 @@ -95,29 +99,29 @@ using namespace std; #endif /* Define a few functions if necessary */ -/* This is the wrong way to do this; see my post to sm-devs. -glenn */ -#if 0 -#ifndef powf -#define powf (float)pow +/* You're right, that was the wrong way, how's this? */ +#include +#ifndef HAVE_POWF +inline float powf (float x, float y){ return float(pow(double(x),double(y))); } #endif -#ifndef sqrtf -#define sqrtf (float)sqrt +#ifndef HAVE_SQRTF +inline float sqrtf (float x) { return float(sqrt(double(x))); } #endif -#ifndef sinf -#define sinf (float)sin +#ifndef HAVE_SINF +inline float sinf (float x) { return float(sin(double(x))); } #endif -#ifndef cosf -#define cosf (float)cos +#ifndef HAVE_COSF +inline float cosf (float x) { return float(cos(double(x))); } #endif -#ifndef acosf -#define acosf (float)acos -#endif +#ifndef HAVE_ACOSF +inline float acosf (float x) { return float(acos(double(x))); } #endif + /* Don't include our own headers here, since they tend to change often. */ #endif