Merge "Avoid usage of LONG_BIT in signal headers."
diff --git a/libc/include/android/legacy_signal_inlines.h b/libc/include/android/legacy_signal_inlines.h
index 95c2320..f2bdcf6 100644
--- a/libc/include/android/legacy_signal_inlines.h
+++ b/libc/include/android/legacy_signal_inlines.h
@@ -89,7 +89,7 @@
errno = EINVAL;
return -1;
}
- return (int)((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
+ return (int)((local_set[bit / (8 * sizeof(long))] >> (bit % (8 * sizeof(long)))) & 1);
}
static __inline int sigaddset(sigset_t *set, int signum) {
@@ -100,7 +100,7 @@
errno = EINVAL;
return -1;
}
- local_set[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT);
+ local_set[bit / (8 * sizeof(long))] |= 1UL << (bit % (8 * sizeof(long)));
return 0;
}
@@ -112,7 +112,7 @@
errno = EINVAL;
return -1;
}
- local_set[bit / LONG_BIT] &= ~(1UL << (bit % LONG_BIT));
+ local_set[bit / (8 * sizeof(long))] &= ~(1UL << (bit % (8 * sizeof(long))));
return 0;
}
diff --git a/libc/include/bits/signal_types.h b/libc/include/bits/signal_types.h
index e1a155f..699e257 100644
--- a/libc/include/bits/signal_types.h
+++ b/libc/include/bits/signal_types.h
@@ -61,7 +61,7 @@
#if defined(__LP64__)
typedef sigset_t sigset64_t;
#else
-typedef struct { unsigned long __bits[_KERNEL__NSIG/LONG_BIT]; } sigset64_t;
+typedef struct { unsigned long __bits[_KERNEL__NSIG/(8*sizeof(long))]; } sigset64_t;
#endif
#if defined(__LP64__)