]> err.no Git - varnish/commitdiff
Never mind trying to avoid libm, we already use it anyway.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 13 Feb 2008 17:19:52 +0000 (17:19 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 13 Feb 2008 17:19:52 +0000 (17:19 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2459 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvarnish/Makefile.am
varnish-cache/lib/libvarnish/num.c

index 692a485c6fdd66d0477b268e1e26d9ea0d0247ce..a0c2ff7c77e3e788132b043e18a1d0037da1422a 100644 (file)
@@ -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
index 517619a13d73f025526b5202217c0085e500ccbe..1ce3999f8c9696eff855c2978391446cc71c0425 100644 (file)
@@ -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);
 }