• Paul Eggert's avatar
    Prefer stdbit.h to count-one-bits.h etc · 88b0bb4d
    Paul Eggert authored
    C23's <stdbit.h> in the long run should be better supported than
    Gnulib's count-one-bits.h and similar headers, so switch to the
    C23 primitives, with a Gnulib fallback for platforms lacking C23.
    * admin/merge-gnulib (GNULIB_MODULES): Remove count-leading-zeros,
    count-one-bits, count-trailing-zeros.  Add stdc_bit_width,
    stdc_count_ones, stdc_trailing_zeros.
    * lib/count-leading-zeros.c, lib/count-leading-zeros.h:
    * lib/count-one-bits.c, lib/count-one-bits.h:
    * lib/count-trailing-zeros.c, lib/count-trailing-zeros.h: Remove.
    * lib/stdbit.c, lib/stdbit.in.h, lib/stdc_bit_width.c:
    * lib/stdc_count_ones.c, lib/stdc_leading_zeros.c:
    * lib/stdc_trailing_zeros.c, m4/stdbit_h.m4:
    New files, copied from Gnulib.
    * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
    * src/data.c: Do not include count-one-bits.h, count-trailing-zeros.h.
    Instead, rely on lisp.h including stdbit.h.
    (Flogcount, Fbool_vector_count_population)
    (Fbool_vector_count_consecutive): Use stdbit.h macros instead of
    count-one-bits.h and count-trailing-zeros.h macros.
    (shift_right_ull, count_one_bits_word, pre_value)
    (count_trailing_zero_bits): Remove; no longer needed.
    * src/lisp.h: Include stdbit.h instead of count-leading-zeros.h.
    (elogb): Use stdbit.h macro instead of count-leading-zeros.h macro.
    88b0bb4d