]> git.mxchange.org Git - flightgear.git/commitdiff
Rather define our own truncf implementation for BSD alikes
authorehofman <ehofman>
Fri, 23 Jan 2004 18:27:55 +0000 (18:27 +0000)
committerehofman <ehofman>
Fri, 23 Jan 2004 18:27:55 +0000 (18:27 +0000)
src/Cockpit/panel.cxx

index 63185884ca897488190f72d78cf2c76f4f9dd351..7a26ead05eae4c35fea33456075bf352963338a6 100644 (file)
 // 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
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // 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;
     }