From: des Date: Wed, 13 Feb 2008 17:19:52 +0000 (+0000) Subject: Never mind trying to avoid libm, we already use it anyway. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f89166947934e413318cff5f932a117d5123d54b;p=varnish Never mind trying to avoid libm, we already use it anyway. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2459 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvarnish/Makefile.am b/varnish-cache/lib/libvarnish/Makefile.am index 692a485c..a0c2ff7c 100644 --- a/varnish-cache/lib/libvarnish/Makefile.am +++ b/varnish-cache/lib/libvarnish/Makefile.am @@ -20,7 +20,7 @@ libvarnish_la_SOURCES = \ vss.c \ vtmpfile.c -libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} +libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} TESTS = num_c_test @@ -29,6 +29,7 @@ noinst_PROGRAMS = ${TESTS} num_c_test_SOURCES = num.c num_c_test_CFLAGS = -DNUM_C_TEST -include config.h +num_c_test_LDADD = ${LIBM} test: ${TESTS} @for test in ${TESTS} ; do ./$${test} ; done diff --git a/varnish-cache/lib/libvarnish/num.c b/varnish-cache/lib/libvarnish/num.c index 517619a1..1ce3999f 100644 --- a/varnish-cache/lib/libvarnish/num.c +++ b/varnish-cache/lib/libvarnish/num.c @@ -98,8 +98,7 @@ str2bytes(const char *p, uintmax_t *r, uintmax_t rel) return ("Invalid suffix"); } - /* intentionally not round(fval) to avoid need for -lm */ - *r = (uintmax_t)(fval + 0.5); + *r = (uintmax_t)round(fval); return (NULL); }