util/ansi-print.cc: Use fallback implementation for lround on MSVC

Unfortuately Visual Studio (still) does not support the C99 function
lround, so provide a fallback implementation for it.
This commit is contained in:
Chun-wei Fan 2013-06-03 17:55:29 +08:00 committed by Behdad Esfahbod
parent a4446b10bf
commit b4c5c52944
1 changed files with 11 additions and 0 deletions

View File

@ -41,6 +41,17 @@
#include <unistd.h> /* for isatty() */
#endif
#ifdef _MSC_VER
static inline long int
lround (double x)
{
if (x >= 0)
return floor (x + 0.5);
else
return ceil (x - 0.5);
}
#endif
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define CELL_W 8