[vte/vte-next] build: Add fallback for round on interix
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next] build: Add fallback for round on interix
- Date: Thu, 8 Mar 2012 21:03:30 +0000 (UTC)
commit 30a67d3f8364197ab4563a0203c69bd6d7af8d6a
Author: Markus Duft <mduft gentoo org>
Date: Thu Mar 8 21:44:14 2012 +0100
build: Add fallback for round on interix
configure.in | 2 +-
src/vte.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index 81133bc..23e44e2 100644
--- a/configure.in
+++ b/configure.in
@@ -244,7 +244,7 @@ if test x$have_recvmsg = x1 ; then
AC_DEFINE(HAVE_RECVMSG,1,[Define if you have the recvmsg function.])
fi
AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
-AC_CHECK_FUNCS([ceil floor])
+AC_CHECK_FUNCS([ceil floor round])
# Look for tgetent
diff --git a/src/vte.c b/src/vte.c
index 7a96499..ce2b035 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -61,6 +61,16 @@
#include <locale.h>
#endif
+#ifndef HAVE_ROUND
+static inline double round(double x) {
+ if(x - floor(x) < 0.5) {
+ return floor(x);
+ } else {
+ return ceil(x);
+ }
+}
+#endif
+
#ifndef HAVE_WINT_T
typedef gunichar wint_t;
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]