svn commit: r204736 - head/sys/netinet/ipfw/test

Luigi Rizzo luigi at FreeBSD.org
Thu Mar 4 21:52:40 UTC 2010


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


More information about the svn-src-all mailing list