Don't implement anything in the ffs family in <machine/cpufunc.h>
in the non-_KERNEL case. This "fixes" applications that include this "kernel-only" header and also include <strings.h> (or get <strings.h> via the default _BSD_VISIBLE pollution in <string.h>. In C++ there was a fatal error: the declaration specifies C linkage but the implementation gives C++ linkage. In C there was only a static/extern mismatch if the headers were included in a certain order order, and a partially redundant declaration for all include orders; gcc emits incomplete or wrong diagnostics for these, but only for compiling with -Wsystem-headers and certain other warning options, so the problem was usually not seen for C. Ports breakage reported by: kris
This commit is contained in:
parent
9397290e76
commit
a67ef0a77a
@ -119,6 +119,8 @@ enable_intr(void)
|
||||
__asm __volatile("sti");
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#define HAVE_INLINE_FFS
|
||||
|
||||
static __inline int
|
||||
@ -162,6 +164,8 @@ flsl(long mask)
|
||||
return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1);
|
||||
}
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
static __inline void
|
||||
halt(void)
|
||||
{
|
||||
|
@ -98,6 +98,8 @@ enable_intr(void)
|
||||
__asm __volatile("sti");
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#define HAVE_INLINE_FFS
|
||||
|
||||
static __inline int
|
||||
@ -120,6 +122,8 @@ fls(int mask)
|
||||
return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1);
|
||||
}
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
static __inline void
|
||||
halt(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user