projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4446b1
)
util/ansi-print.cc: Use fallback implementation for lround on MSVC
author
Chun-wei Fan
<fanchunwei@src.gnome.org>
Mon, 3 Jun 2013 09:55:29 +0000
(17:55 +0800)
committer
Behdad Esfahbod
<behdad@behdad.org>
Mon, 3 Jun 2013 22:50:26 +0000
(18:50 -0400)
Unfortuately Visual Studio (still) does not support the C99 function
lround, so provide a fallback implementation for it.
util/ansi-print.cc
patch
|
blob
|
history
diff --git
a/util/ansi-print.cc
b/util/ansi-print.cc
index
873bee8
..
e166c91
100644
(file)
--- a/
util/ansi-print.cc
+++ b/
util/ansi-print.cc
@@
-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