[rtems commit] score: Avoid clash with <strings.h> provided fls()

Sebastian Huber sebh at rtems.org
Wed Jul 5 06:11:01 UTC 2017


Module:    rtems
Branch:    master
Commit:    4cd52cc456cdc2c6fa0b191f95c75e7bea75eff6
Changeset: http://git.rtems.org/rtems/commit/?id=4cd52cc456cdc2c6fa0b191f95c75e7bea75eff6

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jul  5 08:08:24 2017 +0200

score: Avoid clash with <strings.h> provided fls()

---

 cpukit/score/src/kern_tc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
index 65e6fea..f385e6d 100644
--- a/cpukit/score/src/kern_tc.c
+++ b/cpukit/score/src/kern_tc.c
@@ -75,10 +75,11 @@ ISR_LOCK_DEFINE(, _Timecounter_Lock, "Timecounter")
 #define bcopy(x, y, z) memcpy(y, x, z);
 #define log(...)
 static inline int
-fls(int x)
+builtin_fls(int x)
 {
         return x ? sizeof(x) * 8 - __builtin_clz(x) : 0;
 }
+#define fls(x) builtin_fls(x)
 /* FIXME: https://devel.rtems.org/ticket/2348 */
 #define ntp_update_second(a, b) do { (void) a; (void) b; } while (0)
 #endif /* __rtems__ */




More information about the vc mailing list