1
0
Fork 0

Rather define our own truncf implementation for BSD alikes

This commit is contained in:
ehofman 2004-01-23 18:27:55 +00:00
parent 44108678f7
commit 74d163b51b

View file

@ -53,6 +53,12 @@
// my hardware/driver requires many more.
#define POFF_UNITS 4
#ifdef __FreeBSD__ // no truncf on FreeBSD
inline float truncf (float d) {
return (d < 0) ? -floorf(-d) : floorf(d);
}
#endif
////////////////////////////////////////////////////////////////////////
// Local functions.
@ -1119,7 +1125,7 @@ FGTextLayer::Chunk::getValue () const
break;
case DOUBLE_VALUE:
double d = _offs + _node->getFloatValue() * _mult;
if (_trunc) d = floorf(d);
if (_trunc) d = truncf(d);
sprintf(_buf, _fmt.c_str(), d);
break;
}