[vte/vte-0-32] build: Add fallback for round on interix
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-32] build: Add fallback for round on interix
- Date: Thu, 8 Mar 2012 21:00:57 +0000 (UTC)
commit be763b49aabc14fb48a5533a32645b6d88f31fbb
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 4a558da..b466699 100644
--- a/configure.in
+++ b/configure.in
@@ -236,7 +236,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 1255a61..271309e 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -63,6 +63,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
+
#if GTK_CHECK_VERSION (2, 90, 7)
#define GDK_KEY(symbol) GDK_KEY_##symbol
#else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]