Date: Thu, 4 Mar 2010 21:52:40 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r204736 - head/sys/netinet/ipfw/test Message-ID: <201003042152.o24Lqeee098951@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Thu Mar 4 21:52:40 2010 New Revision: 204736 URL: http://svn.freebsd.org/changeset/base/204736 Log: portability fixes Modified: head/sys/netinet/ipfw/test/dn_test.h head/sys/netinet/ipfw/test/test_dn_sched.c Modified: head/sys/netinet/ipfw/test/dn_test.h ============================================================================== --- head/sys/netinet/ipfw/test/dn_test.h Thu Mar 4 21:01:59 2010 (r204735) +++ head/sys/netinet/ipfw/test/dn_test.h Thu Mar 4 21:52:40 2010 (r204736) @@ -12,11 +12,9 @@ #include <strings.h> /* bzero, ffs, ... */ #include <string.h> /* strcmp */ #include <errno.h> -#include <inttypes.h> #include <sys/queue.h> #include <sys/time.h> - extern int debug; #define ND(fmt, args...) do {} while (0) #define D1(fmt, args...) do {} while (0) @@ -141,6 +139,10 @@ struct dn_alg { #endif +#ifndef __FreeBSD__ +int fls(int); +#endif + static inline void mq_append(struct mq *q, struct mbuf *m) { Modified: head/sys/netinet/ipfw/test/test_dn_sched.c ============================================================================== --- head/sys/netinet/ipfw/test/test_dn_sched.c Thu Mar 4 21:01:59 2010 (r204735) +++ head/sys/netinet/ipfw/test/test_dn_sched.c Thu Mar 4 21:52:40 2010 (r204736) @@ -74,3 +74,16 @@ ipdn_bound_var(int *v, int dflt, int lo, return *v; } +#ifndef __FreeBSD__ +int +fls(int mask) +{ + int bit; + + if (mask == 0) + return (0); + for (bit = 1; mask != 1; bit++) + mask = (unsigned int)mask >> 1; + return (bit); +} +#endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003042152.o24Lqeee098951>