1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-13 15:26:40 +00:00
termux-packages/packages/libtirpc/ffsl-func.patch
2020-06-07 03:32:48 +03:00

34 lines
1.1 KiB
Diff

diff -uNr libtirpc-1.2.6/src/svc.c libtirpc-1.2.6.mod/src/svc.c
--- libtirpc-1.2.6/src/svc.c 2020-04-07 16:24:34.000000000 +0300
+++ libtirpc-1.2.6.mod/src/svc.c 2020-06-07 03:10:30.231611990 +0300
@@ -630,6 +630,29 @@
svc_getreqset (&readfds);
}
+#ifdef __ANDROID__
+static int ffsl(int i)
+{
+ static const unsigned char table[] =
+ {
+ 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
+ };
+ unsigned int a;
+ unsigned int x = i & -i;
+
+ a = x <= 0xffff ? (x <= 0xff ? 0 : 8) : (x <= 0xffffff ? 16 : 24);
+
+ return table[x >> a] + a;
+}
+#endif
+
void
svc_getreqset (readfds)
fd_set *readfds;