From 2c814f4fda1af996b99e730b0396ae97fce14455 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Fri, 9 May 2003 21:34:25 +0000 Subject: [PATCH] Added check for roundf function. If it's defined in a system library, redefining it in RageUtil.h causes stepmania to fail to link with g++. --- stepmania/src/RageUtil.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 689b32f56b..d3c088c0f1 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -110,8 +110,10 @@ inline double trunc( double f ) { return float(int(f)); }; #include #endif inline float truncf( float f ) { return float(int(f)); }; +#ifndef HAVE_ROUNDF inline float roundf( float f ) { if(f < 0) return truncf(f-0.5f); return truncf(f+0.5f); }; inline double roundf( double f ){ if(f < 0) return trunc(f-0.5); return trunc(f+0.5); }; +#endif inline float froundf( const float f, const float fRoundInterval ) { return int( (f + fRoundInterval/2)/fRoundInterval ) * fRoundInterval;