1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

utils: define macro for ffs

Provide ffs() macro using __builtin_ffs(), when there is missing
ffs() implementation in header file.

Reported-by: adamboardman of gemian
This commit is contained in:
Zdenek Kabelac 2021-09-24 21:43:30 +02:00
parent 6a186dd1e8
commit ef21ed78ae

View File

@ -89,6 +89,14 @@ static unsigned _dm_clzll(unsigned long long x)
#define clzll(x) _dm_clzll((x))
#endif /* ifdef HAVE___BUILTIN_CLZLL */
#ifndef HAVE_FFS
#ifdef HAVE___BUILTIN_FFS
#define ffs(x) __builtin_ffs((x))
#else
#error ffs() not implemented!
#endif /* ifdef HAVE___BUILTIN_FFS */
#endif /* ifndef HAVE_FFS */
#define KERNEL_VERSION(major, minor, release) (((major) << 16) + ((minor) << 8) + (release))
/* Define some portable printing types */