[rtems-libbsd commit] libkern.h: Add ffsll()

Sebastian Huber sebh at rtems.org
Mon Jul 10 06:34:10 UTC 2017


Module:    rtems-libbsd
Branch:    master
Commit:    9128d209e500087ade5744581e286ca1bcbc3924
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=9128d209e500087ade5744581e286ca1bcbc3924

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed May 10 14:39:19 2017 +0200

libkern.h: Add ffsll()

---

 freebsd/sys/sys/libkern.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/freebsd/sys/sys/libkern.h b/freebsd/sys/sys/libkern.h
index d236f33..416ffa7 100644
--- a/freebsd/sys/sys/libkern.h
+++ b/freebsd/sys/sys/libkern.h
@@ -160,9 +160,6 @@ int	 flsl(long);
 int	 flsll(long long);
 #endif
 #else /* __rtems__ */
-#define	ffs(_x) __builtin_ffs((unsigned int)(_x))
-#define	ffsl(_x) __builtin_ffsl((unsigned long)(_x))
-
 static inline int
 builtin_fls(int x)
 {
@@ -184,6 +181,9 @@ builtin_flsll(long long x)
   return (x != 0 ? sizeof(x) * 8 - __builtin_clzll((unsigned long long)x) : 0);
 }
 
+#define	ffs(_x)		__builtin_ffs((unsigned int)(_x))
+#define	ffsl(_x)	__builtin_ffsl((unsigned long)(_x))
+#define	ffsll(_x)	__builtin_ffsll((unsigned long long)(_x))
 #define	fls(_x)		builtin_fls(_x)
 #define	flsl(_x)	builtin_flsl(_x)
 #define	flsll(_x)	builtin_flsll(_x)




More information about the vc mailing list