From owner-svn-src-all@FreeBSD.ORG Thu Mar 4 21:52:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAABB106564A; Thu, 4 Mar 2010 21:52:40 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89F08FC17; Thu, 4 Mar 2010 21:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24Lqe7L098954; Thu, 4 Mar 2010 21:52:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24Lqeee098951; Thu, 4 Mar 2010 21:52:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003042152.o24Lqeee098951@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 4 Mar 2010 21:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204736 - head/sys/netinet/ipfw/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2010 21:52:40 -0000 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 /* bzero, ffs, ... */ #include /* strcmp */ #include -#include #include #include - 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