diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/lisp.h b/src/lisp.h index c9a64f07427..57c1c7395c1 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3906,18 +3906,11 @@ integer_to_uintmax (Lisp_Object num, uintmax_t *n) | |||
| 3906 | } | 3906 | } |
| 3907 | 3907 | ||
| 3908 | /* Return floor (log2 (N)) as an int, where 0 < N <= ULLONG_MAX. */ | 3908 | /* Return floor (log2 (N)) as an int, where 0 < N <= ULLONG_MAX. */ |
| 3909 | #if (201112 <= __STDC_VERSION__ && INT_MAX <= UINT_MAX \ | 3909 | INLINE int |
| 3910 | && LONG_MAX <= ULONG_MAX && LLONG_MAX <= ULLONG_MAX) | 3910 | elogb (unsigned long long int n) |
| 3911 | # define elogb(n) \ | 3911 | { |
| 3912 | _Generic (+(n), \ | 3912 | return ULLONG_WIDTH - 1 - count_leading_zeros_ll (n); |
| 3913 | int: UINT_WIDTH - 1 - count_leading_zeros (n), \ | 3913 | } |
| 3914 | unsigned int: UINT_WIDTH - 1 - count_leading_zeros (n), \ | ||
| 3915 | long: ULONG_WIDTH - 1 - count_leading_zeros_l (n), \ | ||
| 3916 | unsigned long: ULONG_WIDTH - 1 - count_leading_zeros_l (n), \ | ||
| 3917 | default: ULLONG_WIDTH - 1 - count_leading_zeros_ll (n)) | ||
| 3918 | #else | ||
| 3919 | # define elogb(n) (ULLONG_WIDTH - 1 - count_leading_zeros_ll (n)) | ||
| 3920 | #endif | ||
| 3921 | 3914 | ||
| 3922 | /* A modification count. These are wide enough, and incremented | 3915 | /* A modification count. These are wide enough, and incremented |
| 3923 | rarely enough, so that they should never overflow a 60-bit counter | 3916 | rarely enough, so that they should never overflow a 60-bit counter |