From b14160b848cc09149dda489800b32c8bea1aa127 Mon Sep 17 00:00:00 2001 From: Dag-Erling Smørgrav Date: Mon, 16 Feb 2004 18:37:00 +0000 Subject: Avoid code duplication on platforms where int and long are the same size. --- sys/sys/libkern.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys') diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index e4a7880a46af..48fd4b17d486 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -77,15 +77,23 @@ void *bsearch(const void *, const void *, size_t, #ifndef HAVE_INLINE_FFS int ffs(int); #endif +#if (__UINT_MAX == __ULONG_MAX) +#define ffsl(x) ffs((x)) +#else #ifndef HAVE_INLINE_FFSL int ffsl(long); #endif +#endif #ifndef HAVE_INLINE_FLS int fls(int); #endif +#if (__UINT_MAX == __ULONG_MAX) +#define flsl(x) fls((x)) +#else #ifndef HAVE_INLINE_FLSL int flsl(long); #endif +#endif int fnmatch(const char *, const char *, int); int locc(int, char *, u_int); void qsort(void *base, size_t nmemb, size_t size, -- cgit v1.3