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:
89dbabf
)
hb-private.hh: Add fallback implementation for round()
author
Chun-wei Fan
<fanchunwei@src.gnome.org>
Mon, 12 Mar 2018 05:33:03 +0000
(13:33 +0800)
committer
Chun-wei Fan
<fanchunwei@src.gnome.org>
Tue, 13 Mar 2018 12:17:52 +0000
(20:17 +0800)
Add a simplistic round() implementation for our purposes, used when the
compiler does not support round() directly.
src/hb-private.hh
patch
|
blob
|
history
diff --git
a/src/hb-private.hh
b/src/hb-private.hh
index
daa496e
..
62a103c
100644
(file)
--- a/
src/hb-private.hh
+++ b/
src/hb-private.hh
@@
-1070,4
+1070,17
@@
struct hb_string_t
};
+/* fallback for round() */
+#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
+static inline double
+round (double x)
+{
+ if (x >= 0)
+ return floor (x + 0.5);
+ else
+ return ceil (x - 0.5);
+}
+#endif
+
+
#endif /* HB_PRIVATE_HH */