From 438d5cfbc80b128f49c31e57749f937fecfe01b2 Mon Sep 17 00:00:00 2001 From: meta Date: Tue, 18 Jan 2011 00:52:45 +0100 Subject: add some more missing C99 math.h functions diff --git a/src/mathc99.cc b/src/mathc99.cc index db71059..335446e 100644 --- a/src/mathc99.cc +++ b/src/mathc99.cc @@ -1,5 +1,18 @@ #include "mathc99.h" -double found(double a) { - return a > 0 ? floor(a+0.5) : ceil(a-0.5); +#ifdef WIN32 +#include + +double round(double a) { + return a > 0 ? floor(a+0.5) : ceil(a-0.5); +} + +float fmin(float a, float b) { + return std::min(a,b); } + +float fmax(float a, float b) { + return std::max(a,b); +} + +#endif diff --git a/src/mathc99.h b/src/mathc99.h index 4d5d3be..ebc2d66 100644 --- a/src/mathc99.h +++ b/src/mathc99.h @@ -6,6 +6,8 @@ #include //for native win32 builds we need to provide C99 math functions by ourselves double round(double a); +float fmin(float a, float b); +float fmax(float a, float b); #else -- cgit v0.10.1