svn commit: r203617 - user/luigi/ipfw3-head/sys/netinet/ipfw
Luigi Rizzo
luigi at FreeBSD.org
Sun Feb 7 17:53:10 UTC 2010
Author: luigi
Date: Sun Feb 7 17:53:10 2010
New Revision: 203617
URL: http://svn.freebsd.org/changeset/base/203617
Log:
add fls for a platform that does not have it
Modified:
user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c
Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c Sun Feb 7 17:51:53 2010 (r203616)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/dn_sched_qfq.c Sun Feb 7 17:53:10 2010 (r203617)
@@ -57,6 +57,16 @@ typedef unsigned long bitmap;
* bitmaps ops are critical. Some linux versions have __fls
* and the bitmap ops. Some machines have ffs
*/
+#if defined(_WIN32)
+static int fls(unsigned long n)
+{
+ int i = 0;
+ for (i = 0; n > 0; n >>= 1, i++)
+ ;
+ return i;
+}
+#endif
+
#if !defined(_KERNEL) || defined( __FreeBSD__ ) || defined(_WIN32)
static inline unsigned long __fls(unsigned long word)
{
More information about the svn-src-user
mailing list