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.
* admin/merge-gnulib: Also remove the new Gnulib file
m4/off64_t.m4, as Emacs doesn’t need off64_t.
* configure.ac (gl_TYPE_OFF64_T): Define a nearly no-op.
Bruno Haible fixed Gnulib so that nstrftime no longer requires
locking code, which means we no longer need to avoid localename.
However, nstrftime now requires localename-unsafe-limited which
pulls in some Gnulib-specific locale code, and it’s likely this
needs to be replaced with Emacs-specific locale code. In the
meantime let’s continue to finess this by avoiding
localename-unsafe-limited.
* admin/merge-gnulib (AVOIDED_MODULES):
Avoid localename-unsafe-limited instead of localename.
Problem reported by Gerd Möllmann (Bug#68464).
* .gitignore: Ignore files in exec that are now copied from build-aux.
* admin/merge-gnulib (avoided_flags): Instead of clearing
autom4te.cache here ...
* autogen.sh (do_git): ... clear it here.
Use config.guess, config.sub and install-sh from
the Emacs repository, as they are more likely to be up to date.
This avoids unnecessary differences among different builders,
and avoids unnecessary ‘git diff’ output after autogen.sh.
Also, copy these files from build-aux to exec since there
should be no difference between the two copies.
* exec/config.guess, exec/config.sub, exec/install-sh:
Remove from repository, as autogen.sh now copies them from build-aux.
* admin/merge-gnulib (AVOIDED_MODULES): Add ‘access’,
since I don’t think Emacs cares about the Mac OS X 10.5
bug where faccessat ignores a trailing slash on a symlink
to a directory. This will matter the next time we run
admin/merge-gnulib.
Simplify Emacs proper by using Gnulib’s boot-time module
instead of doing it all by hand. This should port Emacs
better to obscurish hosts, as Bruno Haible has merged the
best of Emacs’s and Gnulib’s boot-time gathering.
* lib/boot-time-aux.h, lib/boot-time.c, lib/boot-time.h:
* lib/readutmp.h, m4/readutmp.m4: New files, copied from Gnulib.
* admin/merge-gnulib (GNULIB_MODULES): Add boot-time.
* configure.ac: Do not check for utmp.h;
the boot-time module now does this.
(BOOT_TIME_FILE): Remove; no longer used.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/filelock.c [__FreeBSD__]: Do not include <sys/sysctl.h>.
[HAVE_UTMP_H]: Do not include utmp.h.
Include boot-time instead: boot-time does the work now.
(BOOT_TIME) [HAVE_ANDROID && !ANDROID_STUBIFY]: Don’t undef.
(WTMP_FILE): Don’t define.
(boot_time, boot_time_initialized, get_boot_time_1, get_boot_time):
Remove.
(get_boot_sec): New function that simply calls Gnulib get_boot_time.
(lock_file_1, current_lock_owner): Use get_boot_sec instead
of get_boot_time.
It’s not worth the porting hassle, and as the glibc manual says,
“this function is generally a poor choice for processing strings”.
* admin/merge-gnulib (GNULIB_MODULES): Remove stpncpy.
* exec/configure.ac: Do not check for stpncpy.
* exec/exec.c (rpl_stpncpy, stpncpy): Remove this replacement.
(exec_0): Properly clear buffer1. Use memcpy instead of
stpncpy to add the trailing name. This code is clearly
still suboptimal but efficiency is not that important here
and I tried to minimize the change.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
The Gnulib regex module now pulls in some wide-char stuff
that I think Emacs doesn’t need.
* admin/merge-gnulib (AVOIDED_MODULES): Add iswblank, iswctype,
iswdigit, iswxdigit, wctype.
* m4, lib: Update from Gnulib.
* msdos/sedlibmk.inp: Remove variables deleted as part of previous
change.
* admin/merge-gnulib (GNULIB_MODULES): Remove vasprintf and
printf-posix.
* admin/merge-gnulib: Remove m4/locale-fr.m4.
* configure.ac (gt_LOCALE_FR_UTF8): Replace Gnulib’s
definition with a near no-op, as Emacs doesn’t care
about the Solaris 10 MB_CUR_MAX bug.
* lib/gnulib.mk.in: Regenerate.
* m4/locale-fr.m4: Remove; no longer needed due
to above changes.
This adds support for 64-bit time_t on 32-bit GNU/Linux ARM and
x86, where time_t was historically 32-bit. The resulting Emacs
should continue to work for timestamps after mid-January 2038.
* admin/merge-gnulib (GNULIB_MODULES): Add year2038.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* admin/merge-gnulib: Copy m4/codeset.m4 too. This is mostly for
documentation, as it’s now automatically copied by other modules.
* configure.ac (EMACS_PAPER_WIDTH): New macro. This relies on
Gnulib, to avoid duplicate tests for HAVE_LANGINFO_CODESET.
Run admin/merge-gnulib along with the following change:
* admin/merge-gnulib (GNULIB_MODULES): Replace ‘time’ with
‘time-h’, adjusting to a recent renaming in Gnulib modules.
Emacs doesn’t appear to need the new Gnulib ‘time’ module.
* .gitignore: Simplify cross/lib rule.
* admin/merge-gnulib (avoided_flags): Stop copying to cross/lib.
* configure.ac: Link gnulib source and header files to
cross/lib.
* cross/Makefile.in (LIB_SRCDIR): Make relative to builddir.
(maintainer-clean): Merge with distclean. Remove links created
by configure.
These are neccessary because Android's printf is missing basic format
modifiers such as t.
* admin/merge-gnulib (GNULIB_MODULES): Add printf-posix and
vasprintf-posix. Update from gnulib.
* configure.ac (CFLAGS): Add -DHAVE_CONFIG_H.
* src/android.c (android_run_select_thread, android_init_events)
(android_select): Add alternative android_select implementation
for API 16 and lower.
* src/androidterm.c (handle_one_android_event): Fix
use-after-frees.
cae528457c ; Add 2023 to copyright years.
b394359261 Improve documentation of 'isearch-open-overlay-temporary'
ab3210e709 Document 'use-package' in the 2 main manuals
# Conflicts:
# etc/refcards/ru-refcard.tex
# lib/explicit_bzero.c
# m4/explicit_bzero.m4
It’s no longer needed, as it is now merely a thin layer around
C23-style memset_explicit and we might as well just call the
C23 standard function; that’s more forward-looking.
* admin/merge-gnulib (GNULIB_MODULES):
Remove explicit_bzero, and add memset_explicit.
* lib/explicit_bzero.c, m4/explicit_bzero.m4:
Remove these files, which were copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/gnutls.c (gnutls_symmetric_aead):
Use memset_explicit instead of explicit_bzero.
C23 is adding the C++ keywords bool, true, and false;
prefer them to <stdbool.h> if they are available.
* admin/merge-gnulib (GNULIB_MODULES):
Add stdbool, which emulates C23 on pre-C23 platforms.
(AVOIDED_MODULES): Remove stdbool; Gnulib has renamed
this module to stdbool-c99 and nobody uses it so it does
not need to be avoided.
* m4/c-bool.m4: New file, from Gnulib stdbool module.
* lib-src/seccomp-filter.c, src/conf_post.h, src/dynlib.h:
* src/emacs-module.c, src/nsterm.m, src/systhread.h:
* test/src/emacs-module-resources/mod-test.c:
Use the C23 style and use bool without including <stdbool.h>.
The Gnulib stdbool module causes config.h to include stdbool.h
on pre-C23 platforms.
* src/emacs-module.h.in:
Don’t include <stdbool.h> if C23 or later, or if
it has already been included.
* admin/merge-gnulib (GNULIB_MODULES): Add the nanosleep module.
* m4/gnulib-comp.m4 (gl_EARLY):
* lib/gnulib.mk.in: Automatic update.
* m4/nanosleep.m4:
* lib/nanosleep.c: New module.
* nt/mingw-cfg.site (gl_cv_func_free_preserves_errno):
* nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_nanosleep): Omit nanosleep,
since mingw has it.
* src/gnutls.c (gnutls_try_handshake): Add some sleeping to the
busy-wait loop so that we don't use 100% CPU here (bug#32452).
This addresses a FIXME comment in lisp/emacs-lisp/comp.el,
relating to the number of subsidiary processes used by
comp-run-async-workers in native compilation.
* admin/merge-gnulib (GNULIB_MODULES): Add nproc.
* doc/lispref/processes.texi (Process Information), etc/NEWS:
Document num-processors.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/nproc.c, lib/nproc.h, m4/nproc.m4:
New files, copied from Gnulib by admin/merge-gnulib.
* lisp/emacs-lisp/comp.el (w32-get-nproc): Remove decl.
(comp-effective-async-max-jobs): Use num-processors.
* src/process.c: Include nproc.h.
(Fnum_processors): New function.
(syms_of_process): Define ‘all’, ‘current’, ‘num-processors’.
* src/w32proc.c (Fw32_get_nproc): Add FIXME comment.
* test/src/process-tests.el (process-num-processors): New test.
When configured --with-native-compilation, Emacs needs md5_stream.
Problem reported by Andy Moreton (Bug#50985#23).
* admin/merge-gnulib (GNULIB_MODULES): Add crypto/md5,
needed for --with-native-compilation.
(AVOIDED_MODULES): Avoid crypto/af_alg, since Emacs doesn’t
need to bother with kernel-supported cryptography algorithms.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate by running admin/merge-gnulib.
* lib/md5-stream.c: New file, copied from Gnulib.
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.