chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prep v233: Unmask now needed functions in src/basic
[elogind.git]
/
src
/
basic
/
macro.h
diff --git
a/src/basic/macro.h
b/src/basic/macro.h
index e41aa4260fb9a6adcc05f083ea2288476cc753c0..6b2aeb933fdd36bcbcc02cefea06bcc2324322ff 100644
(file)
--- a/
src/basic/macro.h
+++ b/
src/basic/macro.h
@@
-89,6
+89,15
@@
#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
#define UNIQ __COUNTER__
#define UNIQ_T(x, uniq) CONCATENATE(__unique_prefix_, CONCATENATE(x, uniq))
#define UNIQ __COUNTER__
+/* builtins */
+#if __SIZEOF_INT__ == 4
+#define BUILTIN_FFS_U32(x) __builtin_ffs(x);
+#elif __SIZEOF_LONG__ == 4
+#define BUILTIN_FFS_U32(x) __builtin_ffsl(x);
+#else
+#error "neither int nor long are four bytes long?!?"
+#endif
+
/* Rounds up */
#define ALIGN4(l) (((l) + 3) & ~3)
/* Rounds up */
#define ALIGN4(l) (((l) + 3) & ~3)