portability fixes
This commit is contained in:
parent
ae8b199313
commit
b05934e2cb
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user