diff options
author | luigi <luigi@FreeBSD.org> | 2010-03-04 21:52:40 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2010-03-04 21:52:40 +0000 |
commit | 8399f05e148b158d0972988fb044a007c81f466c (patch) | |
tree | ca6b650043920b33410eee245087a75a6e02110f | |
parent | 34f9fab9a3f681cb6d5262aab971706a0b6f5453 (diff) | |
download | FreeBSD-src-8399f05e148b158d0972988fb044a007c81f466c.zip FreeBSD-src-8399f05e148b158d0972988fb044a007c81f466c.tar.gz |
portability fixes
-rw-r--r-- | sys/netinet/ipfw/test/dn_test.h | 6 | ||||
-rw-r--r-- | sys/netinet/ipfw/test/test_dn_sched.c | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/netinet/ipfw/test/dn_test.h b/sys/netinet/ipfw/test/dn_test.h index c56aa6a..38ab94b 100644 --- a/sys/netinet/ipfw/test/dn_test.h +++ b/sys/netinet/ipfw/test/dn_test.h @@ -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) { diff --git a/sys/netinet/ipfw/test/test_dn_sched.c b/sys/netinet/ipfw/test/test_dn_sched.c index 667c42e..ee46c95 100644 --- a/sys/netinet/ipfw/test/test_dn_sched.c +++ b/sys/netinet/ipfw/test/test_dn_sched.c @@ -74,3 +74,16 @@ ipdn_bound_var(int *v, int dflt, int lo, int hi, const char *msg) 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 |