From: Thomas Haller Date: Thu, 23 Mar 2017 13:27:14 +0000 (+0100) Subject: all: don't use math.h or link with libm.so X-Git-Tag: libnl3_3_0~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54344bc0631b16eb623bfbd91e6f7b3d03b27c09;p=libnl all: don't use math.h or link with libm.so --- diff --git a/configure.ac b/configure.ac index 2739b99..66585db 100644 --- a/configure.ac +++ b/configure.ac @@ -74,7 +74,6 @@ AM_PROG_LIBTOOL AC_PROG_MKDIR_P AC_CHECK_PROGS(FLEX, 'flex') AC_CHECK_PROGS(YACC, 'bison -y') -AC_CHECK_LIB([m], [pow], [], AC_MSG_ERROR([libm is required])) AC_C_CONST AC_C_INLINE diff --git a/include/netlink-private/netlink.h b/include/netlink-private/netlink.h index dd07c10..728ca5c 100644 --- a/include/netlink-private/netlink.h +++ b/include/netlink-private/netlink.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/lib/utils.c b/lib/utils.c index 06273c5..aaa9513 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -405,7 +405,7 @@ long nl_prob2int(const char *str) if (*p && strcmp(p, "%") != 0) return -NLE_INVAL; - return rint(d * NL_PROB_MAX); + return (long) (((d * NL_PROB_MAX) + 0.5)); } /** @} */