aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 8ee37f5298a..d61a4d5c982 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
23#include <alloca.h> 23#include <alloca.h>
24#include <setjmp.h> 24#include <setjmp.h>
25#include <stdarg.h> 25#include <stdarg.h>
26#include <stdbit.h>
26#include <stdckdint.h> 27#include <stdckdint.h>
27#include <stddef.h> 28#include <stddef.h>
28#include <string.h> 29#include <string.h>
@@ -37,7 +38,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
37 38
38#include <attribute.h> 39#include <attribute.h>
39#include <byteswap.h> 40#include <byteswap.h>
40#include <count-leading-zeros.h>
41#include <intprops.h> 41#include <intprops.h>
42#include <verify.h> 42#include <verify.h>
43 43
@@ -4148,11 +4148,12 @@ integer_to_uintmax (Lisp_Object num, uintmax_t *n)
4148 } 4148 }
4149} 4149}
4150 4150
4151/* Return floor (log2 (N)) as an int, where 0 < N <= ULLONG_MAX. */ 4151/* Return floor (log2 (N)) as an int. If N is zero, return -1. */
4152INLINE int 4152INLINE int
4153elogb (unsigned long long int n) 4153elogb (unsigned long long int n)
4154{ 4154{
4155 return ULLONG_WIDTH - 1 - count_leading_zeros_ll (n); 4155 int width = stdc_bit_width (n);
4156 return width - 1;
4156} 4157}
4157 4158
4158/* A modification count. These are wide enough, and incremented 4159/* A modification count. These are wide enough, and incremented