commit 5b9995052d547982281a4dd3db6d797f4006144a (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sun May 12 09:51:51 2024 +0300 ; Fix a recent change in fns.c * src/fns.c (value_cmp): Use 'subprocesses', not 'MSDOS', as conditional for process-related functionalities. diff --git a/src/fns.c b/src/fns.c index ab4fc237630..e7dc8dc1bb7 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3124,12 +3124,12 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth) return pa < pb ? -1 : pa > pb; } -#ifndef MSDOS +#ifdef subprocesses case PVEC_PROCESS: a = Fprocess_name (a); b = Fprocess_name (b); goto tail_recurse; -#endif /* MSDOS */ +#endif /* subprocesses */ case PVEC_BUFFER: { commit 67b1da215c9fc103d131e8c568a1e6a75d993f83 Author: Po Lu Date: Sun May 12 13:27:43 2024 +0800 Pacify warnings in gmalloc.c * src/gmalloc.c (__malloc_initialize_hook): Also declare in advance on Glibc 2.24 and later. (__after_morecore_hook, __morecore): Likewise on Glibc 2.34 and later. diff --git a/src/gmalloc.c b/src/gmalloc.c index 2b29f5c6c81..1faf6506167 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -47,11 +47,15 @@ License along with this library. If not, see . #ifndef __MALLOC_HOOK_VOLATILE # define __MALLOC_HOOK_VOLATILE volatile #endif -#ifndef HAVE_MALLOC_H +#if !defined HAVE_MALLOC_H \ + || (__GLIBC__ > 2 || __GLIBC_MINOR__ >= 34) extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void); -extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void); extern void *(*__morecore) (ptrdiff_t); -#endif +#endif /* !defined HAVE_MALLOC_H || glibc >= 2.34 */ +#if !defined HAVE_MALLOC_H \ + || (__GLIBC__ > 2 || __GLIBC_MINOR__ >= 24) +extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void); +#endif /* !defined HAVE_MALLOC_H || glibc >= 2.24 */ /* If HYBRID_MALLOC is defined, then temacs will use malloc, realloc... as defined in this file (and renamed gmalloc, commit 26a407cebebdaa5b21bc896cfb79c7ea8c37a922 Author: Po Lu Date: Sun May 12 13:21:09 2024 +0800 * oldXMenu/Activate.c (x_menu_grab_keyboard): Declare static. diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index ffc5d5ecef1..d876ed234f7 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -117,7 +117,7 @@ along with this program. If not, see . */ #include /* For debug, set this to 0 to not grab the keyboard on menu popup */ -int x_menu_grab_keyboard = 1; +static int x_menu_grab_keyboard = 1; static Wait_func wait_func; static void* wait_data; commit ed03b7ab9f301dba22519b529dfcaf9d83290c73 Author: Po Lu Date: Sun May 12 10:38:26 2024 +0800 Fix the DJGPP build * src/fns.c (value_cmp) [MSDOS]: Consider processes unordered on DOS. diff --git a/src/fns.c b/src/fns.c index 9be42aa8b68..ab4fc237630 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3124,10 +3124,12 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth) return pa < pb ? -1 : pa > pb; } +#ifndef MSDOS case PVEC_PROCESS: a = Fprocess_name (a); b = Fprocess_name (b); goto tail_recurse; +#endif /* MSDOS */ case PVEC_BUFFER: { commit 41596bd7110eac11d1309b9d5a40f86d92b7ff85 Author: Po Lu Date: Sun May 12 10:18:02 2024 +0800 * src/keyboard.c (lispy_function_keys): Define as static on Android. diff --git a/src/keyboard.c b/src/keyboard.c index 2995b3f906c..dff86bbca13 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5022,7 +5022,7 @@ static const char *const lispy_accent_keys[] = merely abstruse terminology for the ``select'' key frequently located in certain physical keyboards. */ -const char *const lispy_function_keys[] = +static const char *const lispy_function_keys[] = { /* All elements in this array default to 0, except for the few function keys that Emacs recognizes. */ commit 15fd1e2cb66884a61a84ce10a69b436e7b00772c Author: Po Lu Date: Sun May 12 10:16:56 2024 +0800 ; Update last change * msdos/sedlibmk.inp (STDDEF_NOT_IDEMPOTENT): Define to 1. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index fd3fde0ad0b..a68e6f6aed3 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -349,6 +349,7 @@ s/@PACKAGE@/emacs/ /^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/ /^STDCKDINT_H *=/s/@[^@\n]*@/stdckdint.h/ /^STDDEF_H *=/s/@[^@\n]*@/stddef.h/ +/^STDDEF_NOT_IDEMPOTENT *=/s/@[^@\n]*@/1/ /^STDINT_H *=/s/@[^@\n]*@/stdint.h/ /^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/ /^TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/ commit 47a0fc91dfc73c480fa5042810df304df647b758 Author: Po Lu Date: Sun May 12 10:13:41 2024 +0800 Fix the DJGPP build * msdos/sedlibmk.inp (HAVE_STRTOF, NULLPTR_T_NEEDS_STDDEF): Define to 1. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 1d8ae778168..fd3fde0ad0b 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -251,6 +251,7 @@ s/@PACKAGE@/emacs/ /^HAVE_STRPBRK *=/s/@HAVE_STRPBRK@/1/ /^HAVE_STRSEP *=/s/@HAVE_STRSEP@/1/ /^HAVE_STRTOD *=/s/@HAVE_STRTOD@/1/ +/^HAVE_STRTOF *=/s/@HAVE_STRTOF@/1/ /^HAVE_STRTOLL *=/s/@HAVE_STRTOLL@/1/ /^HAVE_STRTOULL *=/s/@HAVE_STRTOULL@/1/ /^HAVE_STRUCT_TIMEVAL *=/s/@HAVE_STRUCT_TIMEVAL@/1/ @@ -321,6 +322,7 @@ s/@PACKAGE@/emacs/ /^NEXT_TIME_H *=/s/@[^@\n]*@// /^NEXT_INTTYPES_H *=/s/@[^@\n]*@// /^NEXT_UNISTD_H *=/s/@[^@\n]*@// +/^NULLPTR_T_NEEDS_STDDEF *=/s/@[^@\n]*@/1/ /^OBJEXT *=/s/@[^@\n]*@/o/ /^PRAGMA_COLUMNS *=/s/@[^@\n]*@// /^PRAGMA_SYSTEM_HEADER *=/s/@[^@\n]*@/\\\#pragma GCC system_header/ commit 99a5c75f3b0916affdc8ea4a25d4bc87e67bca88 Author: Paul Eggert Date: Sat May 4 10:08:48 2024 -0700 Pacify gcc -Wmissing-variable-declarations This is a new warning diagnostic in GCC 14. * lib-src/etags.c (mercury_heuristics_ratio): * src/pgtkselect.c, src/xselect.c (selection_request_stack): * src/xselect.c (outstanding_transfers): * src/xterm.c (pending_selection_requests) (x_dnd_waiting_for_motif_finish_display): Now static. * lib-src/make-docfile.c (close_emacs_globals): Arrange for lispsym to be declared with extern first, when compiling lread.c. * src/alloc.c (gdb_make_enums_visible) [__GNUC__]: * src/emacs.c (RCS_Id): * src/keyboard.c (stop_character): * src/print.c (print_output_debug_flag): Now declared with extern first. * src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN) [MAIN_PROGRAM]: Arrange for ID to be declared extern first. * src/lisp.h (garbage_collection_inhibited): * src/xterm.h (x_frame_parm_handlers): Declare here, so that its interface is properly checked. Other decls removed. diff --git a/lib-src/etags.c b/lib-src/etags.c index 84dfa527e98..03bc55de03d 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -705,7 +705,7 @@ and optionally Prolog-like definitions (first rule for a predicate or \ function).\n\ To enable this behavior, run etags using --declarations."; static bool with_mercury_definitions = false; -float mercury_heuristics_ratio = MERCURY_HEURISTICS_RATIO; +static float mercury_heuristics_ratio = MERCURY_HEURISTICS_RATIO; static const char *Objc_suffixes [] = { "lm", /* Objective lex file */ diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index ac4f320f9a5..ee589e03397 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -660,11 +660,11 @@ close_emacs_globals (ptrdiff_t num_symbols) printf (("};\n" "extern struct emacs_globals globals;\n" "\n" - "#ifndef DEFINE_SYMBOLS\n" - "extern\n" - "#endif\n" - "struct Lisp_Symbol lispsym[%td];\n"), - num_symbols); + "extern struct Lisp_Symbol lispsym[%td];\n" + "#ifdef DEFINE_SYMBOLS\n" + "struct Lisp_Symbol lispsym[%td];\n" + "#endif\n"), + num_symbols, num_symbols); } static void diff --git a/src/alloc.c b/src/alloc.c index 4226cb1d1a0..28e32554472 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -8338,7 +8338,7 @@ enum defined_HAVE_PGTK { defined_HAVE_PGTK = false }; then xbacktrace could fail. Similarly for the other enums and their values. Some non-GCC compilers don't like these constructs. */ #ifdef __GNUC__ -union +extern union enums_for_gdb { enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; enum char_table_specials char_table_specials; @@ -8353,5 +8353,6 @@ union enum pvec_type pvec_type; enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS; enum defined_HAVE_PGTK defined_HAVE_PGTK; -} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; +} const gdb_make_enums_visible; +union enums_for_gdb const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; #endif /* __GNUC__ */ diff --git a/src/emacs.c b/src/emacs.c index 22da39a4d1c..58c751eaa6a 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -166,6 +166,7 @@ static const char emacs_copyright[] = COPYRIGHT; static const char emacs_bugreport[] = PACKAGE_BUGREPORT; /* Put version info into the executable in the form that 'ident' uses. */ +extern char const RCS_Id[]; char const EXTERNALLY_VISIBLE RCS_Id[] = "$Id" ": GNU Emacs " PACKAGE_VERSION " (" EMACS_CONFIGURATION " " EMACS_CONFIG_FEATURES ") $"; diff --git a/src/keyboard.c b/src/keyboard.c index bd1bb3bb4be..2995b3f906c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3650,6 +3650,7 @@ readable_events (int flags) } /* Set this for debugging, to have a way to get out */ +extern int stop_character; int stop_character EXTERNALLY_VISIBLE; static KBOARD * diff --git a/src/lisp.h b/src/lisp.h index 010d63e4dd9..41f8af35e8a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -55,7 +55,8 @@ INLINE_HEADER_BEGIN #define DECLARE_GDB_SYM(type, id) type const id EXTERNALLY_VISIBLE #ifdef MAIN_PROGRAM -# define DEFINE_GDB_SYMBOL_BEGIN(type, id) DECLARE_GDB_SYM (type, id) +# define DEFINE_GDB_SYMBOL_BEGIN(type, id) \ + extern DECLARE_GDB_SYM (type, id); DECLARE_GDB_SYM (type, id) # define DEFINE_GDB_SYMBOL_END(id) = id; #else # define DEFINE_GDB_SYMBOL_BEGIN(type, id) extern DECLARE_GDB_SYM (type, id) @@ -4435,6 +4436,7 @@ extern void parse_str_as_multibyte (const unsigned char *, ptrdiff_t, ptrdiff_t *, ptrdiff_t *); /* Defined in alloc.c. */ +extern intptr_t garbage_collection_inhibited; extern void *my_heap_start (void); extern void check_pure_size (void); unsigned char *resize_string_data (Lisp_Object, ptrdiff_t, int, int); diff --git a/src/pgtkselect.c b/src/pgtkselect.c index b0ab15c6069..271411b87ca 100644 --- a/src/pgtkselect.c +++ b/src/pgtkselect.c @@ -353,7 +353,7 @@ struct pgtk_selection_request /* Stack of selections currently being processed. NULL if all requests have been fully processed. */ -struct pgtk_selection_request *selection_request_stack; +static struct pgtk_selection_request *selection_request_stack; static void pgtk_push_current_selection_request (struct selection_input_event *se, diff --git a/src/print.c b/src/print.c index 612d63b7e94..7aacd2b2e90 100644 --- a/src/print.c +++ b/src/print.c @@ -90,6 +90,7 @@ static ptrdiff_t print_number_index; static void print_interval (INTERVAL interval, void *pprintcharfun); /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ +extern bool print_output_debug_flag; bool print_output_debug_flag EXTERNALLY_VISIBLE = 1; diff --git a/src/xdisp.c b/src/xdisp.c index a7cae804006..4b7d7e02c68 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13195,8 +13195,6 @@ truncate_message_1 (void *a1, Lisp_Object a2) return false; } -extern intptr_t garbage_collection_inhibited; - /* Set the current message to STRING. */ static void diff --git a/src/xselect.c b/src/xselect.c index fd0f06eeed9..6578358adc0 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -562,12 +562,12 @@ struct x_selection_request /* Stack of selections currently being processed. NULL if all requests have been fully processed. */ -struct x_selection_request *selection_request_stack; +static struct x_selection_request *selection_request_stack; /* List of all outstanding selection transfers which are currently being processed. */ -struct transfer outstanding_transfers; +static struct transfer outstanding_transfers; /* A counter for selection serials. */ diff --git a/src/xterm.c b/src/xterm.c index 33ef18d8da5..11ef9a4bd94 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -971,7 +971,7 @@ struct x_selection_request_event selection requests inside long-lasting modal event loops, such as the drag-and-drop loop. */ -struct x_selection_request_event *pending_selection_requests; +static struct x_selection_request_event *pending_selection_requests; struct x_atom_ref { @@ -1274,7 +1274,7 @@ static int x_dnd_waiting_for_motif_finish; /* The display the Motif drag receiver will send response data from. */ -struct x_display_info *x_dnd_waiting_for_motif_finish_display; +static struct x_display_info *x_dnd_waiting_for_motif_finish_display; /* Whether or not F1 was pressed during the drag-and-drop operation. @@ -31921,8 +31921,6 @@ x_activate_timeout_atimer (void) /* Set up use of X before we make the first connection. */ -extern frame_parm_handler x_frame_parm_handlers[]; - static struct redisplay_interface x_redisplay_interface = { x_frame_parm_handlers, diff --git a/src/xterm.h b/src/xterm.h index 437ef281b0c..bf402de326b 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1727,6 +1727,7 @@ SELECTION_EVENT_DISPLAY (struct selection_input_event *ev) /* From xfns.c. */ +extern frame_parm_handler x_frame_parm_handlers[]; extern void x_free_gcs (struct frame *); extern void x_relative_mouse_position (struct frame *, int *, int *); extern void x_real_pos_and_offsets (struct frame *, int *, int *, int *, commit 7ae091d933b03d0a1e1e0b39a949c2811c4c3618 Author: Paul Eggert Date: Sat May 11 13:16:48 2024 -0700 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/acl.h b/lib/acl.h index a3aeb8fc86a..0bf78a654d2 100644 --- a/lib/acl.h +++ b/lib/acl.h @@ -28,6 +28,11 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + + bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST; int file_has_acl (char const *, struct stat const *); int qset_acl (char const *, int, mode_t); @@ -36,4 +41,9 @@ int qcopy_acl (char const *, int, char const *, int, mode_t); int copy_acl (char const *, int, char const *, int, mode_t); int chmod_or_fchmod (char const *, int, mode_t); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/allocator.h b/lib/allocator.h index bb30a3440c2..53c8dfcacdf 100644 --- a/lib/allocator.h +++ b/lib/allocator.h @@ -22,6 +22,11 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + /* An object describing a memory allocator family. */ struct allocator @@ -55,4 +60,9 @@ struct allocator /* An allocator using the stdlib functions and a null DIE function. */ extern struct allocator const stdlib_allocator; + +#ifdef __cplusplus +} +#endif + #endif /* _GL_ALLOCATOR_H */ diff --git a/lib/binary-io.h b/lib/binary-io.h index 0cc5c11748c..1da018fad85 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h @@ -55,6 +55,11 @@ __gl_setmode (_GL_UNUSED int fd, _GL_UNUSED int mode) } #endif +#ifdef __cplusplus +extern "C" { +#endif + + /* Set FD's mode to MODE, which should be either O_TEXT or O_BINARY. Return the old mode if successful, -1 (setting errno) on failure. Ordinarily this function would be called 'setmode', since that is @@ -74,6 +79,11 @@ set_binary_mode (int fd, int mode) /* This macro is obsolescent. */ #define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY)) + +#ifdef __cplusplus +} +#endif + _GL_INLINE_HEADER_END #endif /* _BINARY_H */ diff --git a/lib/boot-time-aux.h b/lib/boot-time-aux.h index 8b966fe691f..7f8c5405e4c 100644 --- a/lib/boot-time-aux.h +++ b/lib/boot-time-aux.h @@ -304,18 +304,35 @@ get_windows_boot_time (struct timespec *p_boot_time) Instead, on Windows, the boot time can be retrieved by looking at the time stamp of a file that (normally) gets touched only during the boot process, namely C:\pagefile.sys. */ - const char * const boot_touched_file = - #if defined __CYGWIN__ && !defined _WIN32 - "/cygdrive/c/pagefile.sys" - #else - "C:\\pagefile.sys" - #endif - ; - struct stat statbuf; - if (stat (boot_touched_file, &statbuf) >= 0) + const char * const boot_touched_files[] = { - *p_boot_time = get_stat_mtime (&statbuf); - return 0; + #if defined __CYGWIN__ && !defined _WIN32 + /* It is more portable to use /proc/cygdrive/c than /cygdrive/c. */ + "/proc/cygdrive/c/pagefile.sys", + /* A fallback, working around a Cygwin 3.5.3 bug. It has a modification + time about 1.5 minutes after the last boot; but that's better than + nothing. */ + "/proc/cygdrive/c/ProgramData/Microsoft/Windows/DeviceMetadataCache/dmrc.idx" + #else + "C:\\pagefile.sys" + #endif + }; + for (idx_t i = 0; i < SIZEOF (boot_touched_files); i++) + { + const char *filename = boot_touched_files[i]; + struct stat statbuf; + if (stat (filename, &statbuf) >= 0) + { +# if defined __CYGWIN__ && !defined _WIN32 + /* Work around a Cygwin 3.5.3 bug. + */ + if (!S_ISDIR (statbuf.st_mode)) +# endif + { + *p_boot_time = get_stat_mtime (&statbuf); + return 0; + } + } } return -1; } diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h index 473e6531e67..2c552b692af 100644 --- a/lib/careadlinkat.h +++ b/lib/careadlinkat.h @@ -28,6 +28,11 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + + struct allocator; /* Assuming the current directory is FD, get the symbolic link value @@ -69,4 +74,9 @@ char *careadlinkat (int fd, char const *filename, # endif #endif + +#ifdef __cplusplus +} +#endif + #endif /* _GL_CAREADLINKAT_H */ diff --git a/lib/cloexec.h b/lib/cloexec.h index f52e5f2ec0f..a7944d6dd5d 100644 --- a/lib/cloexec.h +++ b/lib/cloexec.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ +#ifdef __cplusplus +extern "C" { +#endif + + /* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true, or clear the flag if VALUE is false. Return 0 on success, or -1 on error with 'errno' set. @@ -32,3 +37,8 @@ int set_cloexec_flag (int desc, bool value); be duplicated. */ int dup_cloexec (int fd); + + +#ifdef __cplusplus +} +#endif diff --git a/lib/close-stream.h b/lib/close-stream.h index 8a1b3c7ac2c..3c421dce513 100644 --- a/lib/close-stream.h +++ b/lib/close-stream.h @@ -17,4 +17,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + int close_stream (FILE *stream); + + +#ifdef __cplusplus +} +#endif diff --git a/lib/execinfo.in.h b/lib/execinfo.in.h index 0ffb2c386e7..e017947bca4 100644 --- a/lib/execinfo.in.h +++ b/lib/execinfo.in.h @@ -30,6 +30,11 @@ _GL_INLINE_HEADER_BEGIN # define _GL_EXECINFO_INLINE _GL_INLINE #endif +#ifdef __cplusplus +extern "C" { +#endif + + _GL_EXECINFO_INLINE int backtrace (void **buffer, int size) { @@ -54,6 +59,11 @@ backtrace_symbols_fd (void *const *buffer, int size, int fd) (void) fd; } + +#ifdef __cplusplus +} +#endif + _GL_INLINE_HEADER_END #endif diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index eea3b9542a5..1465ce594d7 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -51,7 +51,8 @@ #ifndef _@GUARD_PREFIX@_FCNTL_H /* Needed before . - May also define off_t to a 64-bit type on native Windows. */ + May also define off_t to a 64-bit type on native Windows. + Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */ #include /* On some systems other than glibc, is a prerequisite of . On glibc systems, we would like to avoid namespace pollution. diff --git a/lib/filevercmp.h b/lib/filevercmp.h index 8c549fcda00..81f821d5267 100644 --- a/lib/filevercmp.h +++ b/lib/filevercmp.h @@ -27,6 +27,11 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + /* Compare strings A and B as file names containing version numbers, and return an integer that is negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. @@ -80,4 +85,9 @@ int filevercmp (char const *a, char const *b) _GL_ATTRIBUTE_PURE; int filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen) _GL_ATTRIBUTE_PURE; + +#ifdef __cplusplus +} +#endif + #endif /* FILEVERCMP_H */ diff --git a/lib/fpending.h b/lib/fpending.h index 28db3b403d9..345c0bc71d9 100644 --- a/lib/fpending.h +++ b/lib/fpending.h @@ -30,6 +30,16 @@ # include #endif +#ifdef __cplusplus +extern "C" { +#endif + + #if !HAVE_DECL___FPENDING size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE; #endif + + +#ifdef __cplusplus +} +#endif diff --git a/lib/fsusage.h b/lib/fsusage.h index d7ae5f63a36..da87859060c 100644 --- a/lib/fsusage.h +++ b/lib/fsusage.h @@ -19,9 +19,14 @@ /* Space usage statistics for a file system. Blocks are 512-byte. */ #if !defined FSUSAGE_H_ -# define FSUSAGE_H_ +#define FSUSAGE_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif -# include struct fs_usage { @@ -36,4 +41,9 @@ struct fs_usage int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/lib/ftoastr.h b/lib/ftoastr.h index ed43c961a04..94554863a1e 100644 --- a/lib/ftoastr.h +++ b/lib/ftoastr.h @@ -24,6 +24,11 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + + /* Store into BUF (of size BUFSIZE) an accurate minimal-precision string representation of a floating point number. FLAGS affect the formatting of the number. Pad the output string with spaces as @@ -149,4 +154,9 @@ enum #define DBL_BUFSIZE_BOUND ( DBL_STRLEN_BOUND + 1) #define LDBL_BUFSIZE_BOUND (LDBL_STRLEN_BOUND + 1) + +#ifdef __cplusplus +} +#endif + #endif /* _GL_FTOASTR_H */ diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 711ddcf1260..a5c009cfb85 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -618,6 +618,7 @@ GL_GNULIB_STRSEP = @GL_GNULIB_STRSEP@ GL_GNULIB_STRSIGNAL = @GL_GNULIB_STRSIGNAL@ GL_GNULIB_STRSTR = @GL_GNULIB_STRSTR@ GL_GNULIB_STRTOD = @GL_GNULIB_STRTOD@ +GL_GNULIB_STRTOF = @GL_GNULIB_STRTOF@ GL_GNULIB_STRTOIMAX = @GL_GNULIB_STRTOIMAX@ GL_GNULIB_STRTOK_R = @GL_GNULIB_STRTOK_R@ GL_GNULIB_STRTOL = @GL_GNULIB_STRTOL@ @@ -809,6 +810,7 @@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MODULES = @HAVE_MODULES@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@ +HAVE_OFF64_T = @HAVE_OFF64_T@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OPENDIR = @HAVE_OPENDIR@ HAVE_OS_H = @HAVE_OS_H@ @@ -872,6 +874,7 @@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRTOD = @HAVE_STRTOD@ +HAVE_STRTOF = @HAVE_STRTOF@ HAVE_STRTOL = @HAVE_STRTOL@ HAVE_STRTOLD = @HAVE_STRTOLD@ HAVE_STRTOLL = @HAVE_STRTOLL@ @@ -922,12 +925,10 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ +IS_D8_R8 = @IS_D8_R8@ JARSIGNER = @JARSIGNER@ JAVAC = @JAVAC@ JPEG_CFLAGS = @JPEG_CFLAGS@ -JSON_CFLAGS = @JSON_CFLAGS@ -JSON_LIBS = @JSON_LIBS@ -JSON_OBJ = @JSON_OBJ@ KQUEUE_CFLAGS = @KQUEUE_CFLAGS@ KQUEUE_LIBS = @KQUEUE_LIBS@ KRB4LIB = @KRB4LIB@ @@ -1017,9 +1018,12 @@ NDK_BUILD_ARCH = @NDK_BUILD_ARCH@ NDK_BUILD_CC = @NDK_BUILD_CC@ NDK_BUILD_CFLAGS = @NDK_BUILD_CFLAGS@ NDK_BUILD_CXX = @NDK_BUILD_CXX@ +NDK_BUILD_CXX_LDFLAGS = @NDK_BUILD_CXX_LDFLAGS@ NDK_BUILD_CXX_SHARED = @NDK_BUILD_CXX_SHARED@ +NDK_BUILD_CXX_STL = @NDK_BUILD_CXX_STL@ NDK_BUILD_MODULES = @NDK_BUILD_MODULES@ NDK_BUILD_NASM = @NDK_BUILD_NASM@ +NDK_BUILD_READELF = @NDK_BUILD_READELF@ NDK_BUILD_SDK = @NDK_BUILD_SDK@ NEXT_ASSERT_H = @NEXT_ASSERT_H@ NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@ @@ -1068,6 +1072,7 @@ NS_OBJ = @NS_OBJ@ NS_OBJC_OBJ = @NS_OBJC_OBJ@ NTDIR = @NTDIR@ NTLIB = @NTLIB@ +NULLPTR_T_NEEDS_STDDEF = @NULLPTR_T_NEEDS_STDDEF@ OBJC = @OBJC@ OBJCFLAGS = @OBJCFLAGS@ OBJEXT = @OBJEXT@ @@ -1101,6 +1106,7 @@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ QCOPY_ACL_LIB = @QCOPY_ACL_LIB@ RALLOC_OBJ = @RALLOC_OBJ@ RANLIB = @RANLIB@ +READELF = @READELF@ REPLACE_ACCESS = @REPLACE_ACCESS@ REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ @@ -1258,6 +1264,7 @@ REPLACE_STRNLEN = @REPLACE_STRNLEN@ REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_STRTOD = @REPLACE_STRTOD@ +REPLACE_STRTOF = @REPLACE_STRTOF@ REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ REPLACE_STRTOL = @REPLACE_STRTOL@ @@ -1308,6 +1315,7 @@ SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ SQLITE3_LIBS = @SQLITE3_LIBS@ STDCKDINT_H = @STDCKDINT_H@ STDDEF_H = @STDDEF_H@ +STDDEF_NOT_IDEMPOTENT = @STDDEF_NOT_IDEMPOTENT@ STDINT_H = @STDINT_H@ SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ SYSTEM_TYPE = @SYSTEM_TYPE@ @@ -2195,6 +2203,7 @@ SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t' # Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that +# is its recipe's first line if and only if @NMD@ lines are absent. gl_V_at = $(AM_V_GEN) endif @@ -3078,9 +3087,11 @@ stddef.h: stddef.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ + -e 's|@''NULLPTR_T_NEEDS_STDDEF''@|$(NULLPTR_T_NEEDS_STDDEF)|g' \ + -e 's|@''STDDEF_NOT_IDEMPOTENT''@|$(STDDEF_NOT_IDEMPOTENT)|g' \ + -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ - -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ $(srcdir)/stddef.in.h > $@-t $(AM_V_at)mv $@-t $@ else @@ -3347,6 +3358,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_GNULIB_SECURE_GETENV)/g' \ -e 's/@''GNULIB_SETENV''@/$(GL_GNULIB_SETENV)/g' \ -e 's/@''GNULIB_STRTOD''@/$(GL_GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOF''@/$(GL_GNULIB_STRTOF)/g' \ -e 's/@''GNULIB_STRTOL''@/$(GL_GNULIB_STRTOL)/g' \ -e 's/@''GNULIB_STRTOLD''@/$(GL_GNULIB_STRTOLD)/g' \ -e 's/@''GNULIB_STRTOLL''@/$(GL_GNULIB_STRTOLL)/g' \ @@ -3399,6 +3411,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOF''@|$(HAVE_STRTOF)|g' \ -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \ -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ @@ -3444,6 +3457,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_STRTOF''@|$(REPLACE_STRTOF)|g' \ -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \ -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \ @@ -3833,6 +3847,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's|@''HAVE_OFF64_T''@|$(HAVE_OFF64_T)|g' \ -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \ $(srcdir)/sys_types.in.h > $@-t $(AM_V_at)mv $@-t $@ diff --git a/lib/idx.h b/lib/idx.h index f9ce0acd57d..43793f2d625 100644 --- a/lib/idx.h +++ b/lib/idx.h @@ -111,6 +111,11 @@ help producing good code and good warnings. The type 'idx_t' could then be typedef'ed to a range type that is signed after promotion. */ +#ifdef __cplusplus +extern "C" { +#endif + + /* In the future, idx_t could be typedef'ed to a signed range type. The clang "extended integer types", supported in Clang 11 or newer , @@ -131,4 +136,9 @@ typedef ptrdiff_t idx_t; Perhaps there should be another macro IDX_VALUE_BITS that does not count the sign bit and is therefore one less than PTRDIFF_WIDTH. */ + +#ifdef __cplusplus +} +#endif + #endif /* _IDX_H */ diff --git a/lib/intprops-internal.h b/lib/intprops-internal.h index c8a87d2bb27..443024c6657 100644 --- a/lib/intprops-internal.h +++ b/lib/intprops-internal.h @@ -169,7 +169,9 @@ /* Work around GCC bug 91450. */ # define _GL_INT_MULTIPLY_WRAPV(a, b, r) \ ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) && _GL_EXPR_SIGNED (b) \ - && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \ + && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, \ + (__typeof__ (*(r))) 0, \ + (__typeof__ (*(r))) -1)) \ ? ((void) __builtin_mul_overflow (a, b, r), 1) \ : __builtin_mul_overflow (a, b, r)) # endif @@ -183,10 +185,10 @@ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 https://llvm.org/bugs/show_bug.cgi?id=25390 - For now, assume all versions of GCC-like compilers generate bogus + For now, assume GCC < 14 and all Clang versions generate bogus warnings for _Generic. This matters only for compilers that lack relevant builtins. */ -#if __GNUC__ || defined __clang__ +#if (__GNUC__ && __GNUC__ < 14) || defined __clang__ # define _GL__GENERIC_BOGUS 1 #else # define _GL__GENERIC_BOGUS 0 diff --git a/lib/memset_explicit.c b/lib/memset_explicit.c index cf6cc647847..33c09873482 100644 --- a/lib/memset_explicit.c +++ b/lib/memset_explicit.c @@ -16,11 +16,7 @@ #include -/* memset_s need this define */ -#if HAVE_MEMSET_S -# define __STDC_WANT_LIB_EXT1__ 1 -#endif - +/* Specification. */ #include /* Set S's bytes to C, where S has LEN bytes. The compiler will not diff --git a/lib/mini-gmp.c b/lib/mini-gmp.c index 69a72bfd460..c580a8fc025 100644 --- a/lib/mini-gmp.c +++ b/lib/mini-gmp.c @@ -2809,6 +2809,7 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v) mpz_t tu, tv, s0, s1, t0, t1; mp_bitcnt_t uz, vz, gz; mp_bitcnt_t power; + int cmp; if (u->_mp_size == 0) { @@ -2960,12 +2961,21 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v) mpz_tdiv_q_2exp (t0, t0, 1); } - /* Arrange so that |s| < |u| / 2g */ + /* Choose small cofactors (they should generally satify + + |s| < |u| / 2g and |t| < |v| / 2g, + + with some documented exceptions). Always choose the smallest s, + if there are two choices for s with same absolute value, choose + the one with smallest corresponding t (this asymmetric condition + is needed to prefer s = 0, |t| = 1 when g = |a| = |b|). */ mpz_add (s1, s0, s1); - if (mpz_cmpabs (s0, s1) > 0) + mpz_sub (t1, t0, t1); + cmp = mpz_cmpabs (s0, s1); + if (cmp > 0 || (cmp == 0 && mpz_cmpabs (t0, t1) > 0)) { mpz_swap (s0, s1); - mpz_sub (t0, t0, t1); + mpz_swap (t0, t1); } if (u->_mp_size < 0) mpz_neg (s0, s0); diff --git a/lib/openat-priv.h b/lib/openat-priv.h index 7fd4beb5a73..63093f4597e 100644 --- a/lib/openat-priv.h +++ b/lib/openat-priv.h @@ -24,6 +24,11 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + + /* Maximum number of bytes that it is safe to allocate as a single array on the stack, and that is known as a compile-time constant. The assumption is that we'll touch the array very quickly, or a @@ -61,4 +66,9 @@ int at_func2 (int fd1, char const *file1, int fd2, char const *file2, int (*func) (char const *file1, char const *file2)); + +#ifdef __cplusplus +} +#endif + #endif /* _GL_HEADER_OPENAT_PRIV */ diff --git a/lib/openat.h b/lib/openat.h index dc34092bb3f..b6b94f68c75 100644 --- a/lib/openat.h +++ b/lib/openat.h @@ -33,6 +33,11 @@ _GL_INLINE_HEADER_BEGIN +#ifdef __cplusplus +extern "C" { +#endif + + #if !HAVE_OPENAT int openat_permissive (int fd, char const *file, int flags, mode_t mode, @@ -122,6 +127,11 @@ lstatat (int fd, char const *name, struct stat *st) wrappers are not provided for accessat or euidaccessat, so as to avoid dragging in -lgen on some platforms. */ + +#ifdef __cplusplus +} +#endif + _GL_INLINE_HEADER_END #endif /* _GL_HEADER_OPENAT */ diff --git a/lib/save-cwd.h b/lib/save-cwd.h index 692e4b97be2..9d314c2cf45 100644 --- a/lib/save-cwd.h +++ b/lib/save-cwd.h @@ -19,7 +19,12 @@ /* Written by Jim Meyering. */ #ifndef SAVE_CWD_H -# define SAVE_CWD_H 1 +#define SAVE_CWD_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + struct saved_cwd { @@ -31,4 +36,9 @@ int save_cwd (struct saved_cwd *cwd); int restore_cwd (const struct saved_cwd *cwd); void free_cwd (struct saved_cwd *cwd); + +#ifdef __cplusplus +} +#endif + #endif /* SAVE_CWD_H */ diff --git a/lib/stddef.in.h b/lib/stddef.in.h index fa8998d9b72..63bb500e262 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h @@ -27,13 +27,21 @@ #endif @PRAGMA_COLUMNS@ -#if defined __need_wchar_t || defined __need_size_t \ - || defined __need_ptrdiff_t || defined __need_NULL \ - || defined __need_wint_t +#if (defined __need_wchar_t || defined __need_size_t \ + || defined __need_ptrdiff_t || defined __need_NULL \ + || defined __need_wint_t) \ + /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \ + in Fedora 40 with gcc 14.0.1. \ + . */ \ + && !@STDDEF_NOT_IDEMPOTENT@ /* Special invocation convention inside gcc header files. In - particular, gcc provides a version of that blindly - redefines NULL even when __need_wint_t was defined, even though - wint_t is not normally provided by . Hence, we must + particular, in some ancient versions of GCC blindly + redefined NULL when __need_wint_t was defined, even though wint_t + is not normally provided by . + (FIXME: It's not clear what GCC versions those were - perhaps so + ancient that we can stop worrying about this?) + Although glibc 2.26 (2017) and later do not use __need_wint_t, + for portability to macOS, Cygwin, Haiku, and older Glibc + GCC, remember if special invocation has ever been used to obtain wint_t, in which case we need to clean up NULL yet again. */ @@ -52,6 +60,13 @@ # endif #else +/* For @STDDEF_NOT_IDEMPOTENT@. */ +# undef __need_wchar_t +# undef __need_size_t +# undef __need_ptrdiff_t +# undef __need_NULL +# undef __need_wint_t + /* Normal invocation convention. */ # ifndef _@GUARD_PREFIX@_STDDEF_H @@ -74,6 +89,12 @@ typedef long max_align_t; # endif # endif +# if !defined _GCC_NULLPTR_T && !@NULLPTR_T_NEEDS_STDDEF@ + /* Suppress unwanted nullptr_t typedef. See + . */ +# define _GCC_NULLPTR_T +# endif + /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 4947307e578..1c0c9661bfe 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -77,7 +77,8 @@ /* Get off_t and ssize_t. Needed on many systems, including glibc 2.8 and eglibc 2.11.2. - May also define off_t to a 64-bit type on native Windows. */ + May also define off_t to a 64-bit type on native Windows. + Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */ #include /* Solaris 10 and NetBSD 7.0 declare renameat in , not in . */ @@ -907,14 +908,14 @@ _GL_CXXALIAS_SYS (fwrite, size_t, && !defined __cplusplus) # undef fwrite # undef fwrite_unlocked -extern size_t __REDIRECT (rpl_fwrite, - (const void *__restrict, size_t, size_t, - FILE *__restrict), - fwrite); -extern size_t __REDIRECT (rpl_fwrite_unlocked, - (const void *__restrict, size_t, size_t, - FILE *__restrict), - fwrite_unlocked); +_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite, + (const void *__restrict, size_t, size_t, + FILE *__restrict), + fwrite); +_GL_EXTERN_C size_t __REDIRECT (rpl_fwrite_unlocked, + (const void *__restrict, size_t, size_t, + FILE *__restrict), + fwrite_unlocked); # define fwrite rpl_fwrite # define fwrite_unlocked rpl_fwrite_unlocked # endif diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index b901d175aeb..e74e7c18d19 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1591,6 +1591,38 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - " # endif #endif +#if @GNULIB_STRTOF@ + /* Parse a float from STRING, updating ENDP if appropriate. */ +# if @REPLACE_STRTOF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define strtof rpl_strtof +# endif +# define GNULIB_defined_strtof_function 1 +_GL_FUNCDECL_RPL (strtof, float, + (const char *restrict str, char **restrict endp) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (strtof, float, + (const char *restrict str, char **restrict endp)); +# else +# if !@HAVE_STRTOF@ +_GL_FUNCDECL_SYS (strtof, float, + (const char *restrict str, char **restrict endp) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (strtof, float, + (const char *restrict str, char **restrict endp)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (strtof); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtof +# if HAVE_RAW_DECL_STRTOF +_GL_WARN_ON_USE (strtof, "strtof is unportable - " + "use gnulib module strtof for portability"); +# endif +#endif + #if @GNULIB_STRTOLD@ /* Parse a 'long double' from STRING, updating ENDP if appropriate. */ # if @REPLACE_STRTOLD@ diff --git a/lib/strftime.c b/lib/strftime.c index 128176cad40..9b205e48023 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -141,6 +141,15 @@ extern char *tzname[]; ? (a) >> (b) \ : ((a) + ((a) < 0)) / (1 << (b)) - ((a) < 0)) +enum pad_style +{ + ZERO_PAD, /* (default) Pad with 0 unless format says otherwise. */ + ALWAYS_ZERO_PAD, /* '0' Always pad with 0. */ + SIGN_PAD, /* '+' Always output a sign. */ + SPACE_PAD, /* '_' Pad with space. */ + NO_PAD /* '-' Do not pad. */ +}; + #define TM_YEAR_BASE 1900 #ifndef __isleap @@ -193,7 +202,7 @@ extern char *tzname[]; do \ { \ size_t _n = (n); \ - size_t _w = pad == L_('-') || width < 0 ? 0 : width; \ + size_t _w = pad == NO_PAD || width < 0 ? 0 : width; \ size_t _incr = _n < _w ? _w : _n; \ if (_incr >= maxsize - i) \ { \ @@ -205,7 +214,7 @@ extern char *tzname[]; if (_n < _w) \ { \ size_t _delta = _w - _n; \ - if (pad == L_('0') || pad == L_('+')) \ + if (pad == ALWAYS_ZERO_PAD || pad == SIGN_PAD) \ memset_zero (p, _delta); \ else \ memset_space (p, _delta); \ @@ -825,7 +834,7 @@ static CHAR_T const c_month_names[][sizeof "September"] = static size_t __strftime_internal (STREAM_OR_CHAR_T *, STRFTIME_ARG (size_t) const CHAR_T *, const struct tm *, - bool, int, int, bool * + bool, enum pad_style, int, bool * extra_args_spec LOCALE_PARAM); /* Write information from TP into S according to the format @@ -841,7 +850,8 @@ my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) { bool tzset_called = false; return __strftime_internal (s, STRFTIME_ARG (maxsize) format, tp, false, - 0, -1, &tzset_called extra_args LOCALE_ARG); + ZERO_PAD, -1, + &tzset_called extra_args LOCALE_ARG); } libc_hidden_def (my_strftime) @@ -853,7 +863,7 @@ static size_t __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) const CHAR_T *format, const struct tm *tp, bool upcase, - int yr_spec, int width, bool *tzset_called + enum pad_style yr_spec, int width, bool *tzset_called extra_args_spec LOCALE_PARAM) { #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL @@ -977,7 +987,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) for (f = format; *f != '\0'; width = -1, f++) { - int pad = 0; /* Padding for number ('_', '-', '+', '0', or 0). */ + enum pad_style pad = ZERO_PAD; int modifier; /* Field modifier ('E', 'O', or 0). */ int digits = 0; /* Max digits for numeric format. */ int number_value; /* Numeric value to be printed. */ @@ -1095,12 +1105,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) switch (*++f) { /* This influences the number formats. */ - case L_('_'): - case L_('-'): - case L_('+'): - case L_('0'): - pad = *f; - continue; + case L_('_'): pad = SPACE_PAD; continue; + case L_('-'): pad = NO_PAD; continue; + case L_('+'): pad = SIGN_PAD; continue; + case L_('0'): pad = ALWAYS_ZERO_PAD; continue; /* This changes textual output. */ case L_('^'): @@ -1336,7 +1344,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) # endif if (len != 0) { -# if defined __NetBSD__ || defined __sun /* NetBSD, Solaris */ +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 31) || defined __NetBSD__ || defined __sun /* glibc < 2.31, NetBSD, Solaris */ if (format_char == L_('c')) { /* The output of the strftime %c directive consists of the @@ -1374,7 +1382,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) } } } -# if REQUIRE_GNUISH_STRFTIME_AM_PM +# if (defined __NetBSD__ || defined __sun) && REQUIRE_GNUISH_STRFTIME_AM_PM /* The output of the strftime %p and %r directives contains an AM/PM indicator even for locales where it is not suitable, such as French. Remove this indicator. */ @@ -1483,17 +1491,17 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) goto do_number_body; do_yearish: - if (pad == 0) + if (pad == ZERO_PAD) pad = yr_spec; always_output_a_sign - = (pad == L_('+') + = (pad == SIGN_PAD && ((digits == 2 ? 99 : 9999) < u_number_value || digits < width)); goto do_maybe_signed_number; do_number_spacepad: - if (pad == 0) - pad = L_('_'); + if (pad == ZERO_PAD) + pad = SPACE_PAD; do_number: /* Format NUMBER_VALUE according to the MODIFIER flag. */ @@ -1551,8 +1559,8 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) while (u_number_value != 0 || tz_colon_mask != 0); do_number_sign_and_padding: - if (pad == 0) - pad = L_('0'); + if (pad == ZERO_PAD) + pad = ALWAYS_ZERO_PAD; if (width < 0) width = digits; @@ -1562,11 +1570,11 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) : 0); int numlen = buf + sizeof buf / sizeof buf[0] - bufp; int shortage = width - !!sign_char - numlen; - int padding = pad == L_('-') || shortage <= 0 ? 0 : shortage; + int padding = pad == NO_PAD || shortage <= 0 ? 0 : shortage; if (sign_char) { - if (pad == L_('_')) + if (pad == SPACE_PAD) { if (p) memset_space (p, padding); @@ -1584,9 +1592,9 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) case L_('F'): if (modifier != 0) goto bad_format; - if (pad == 0 && width < 0) + if (pad == ZERO_PAD && width < 0) { - pad = L_('+'); + pad = SIGN_PAD; subwidth = 4; } else @@ -1653,8 +1661,8 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) ndigs--, n /= 10; for (int j = ndigs; 0 < j; j--) buf[j - 1] = n % 10 + L_('0'), n /= 10; - if (!pad) - pad = L_('0'); + if (pad == ZERO_PAD) + pad = ALWAYS_ZERO_PAD; width_cpy (0, ndigs, buf); width_add (width - ndigs, 0, (void) 0); } @@ -1864,7 +1872,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) # else subfmt = era->era_format; # endif - if (pad == 0) + if (pad == ZERO_PAD) pad = yr_spec; goto subformat; } @@ -1887,7 +1895,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) if (era) { int delta = tp->tm_year - era->start_date[0]; - if (pad == 0) + if (pad == ZERO_PAD) pad = yr_spec; DO_NUMBER (2, (era->offset + delta * era->absolute_direction)); @@ -1916,7 +1924,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) { /* The zone string is always given in multibyte form. We have to convert it to wide character. */ - size_t w = pad == L_('-') || width < 0 ? 0 : width; + size_t w = pad == NO_PAD || width < 0 ? 0 : width; char const *z = zone; mbstate_t st = {0}; size_t len = __mbsrtowcs_l (p, &z, maxsize - i, &st, loc); @@ -1934,7 +1942,8 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) { size_t delta = w - len; __wmemmove (p + delta, p, len); - wchar_t wc = pad == L_('0') || pad == L_('+') ? L'0' : L' '; + wchar_t wc = (pad == ALWAYS_ZERO_PAD || pad == SIGN_PAD + ? L'0' : L' '); wmemset (p, wc, delta); } p += incr; diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h index 0a0ccc3c379..4eb2e926960 100644 --- a/lib/sys_types.in.h +++ b/lib/sys_types.in.h @@ -60,6 +60,15 @@ # define _GL_WINDOWS_64_BIT_OFF_T 1 #endif +/* Define the off64_t type. */ +#if !@HAVE_OFF64_T@ +# if !GNULIB_defined_off64_t +/* Define off64_t to int64_t always. */ +typedef long long off64_t; +# define GNULIB_defined_off64_t 1 +# endif +#endif + /* Override dev_t and ino_t if distinguishable inodes support is requested on native Windows. */ #if @WINDOWS_STAT_INODES@ diff --git a/lib/u64.h b/lib/u64.h index 63339cca0fc..4eca03e985e 100644 --- a/lib/u64.h +++ b/lib/u64.h @@ -29,6 +29,11 @@ _GL_INLINE_HEADER_BEGIN # define _GL_U64_INLINE _GL_INLINE #endif +#ifdef __cplusplus +extern "C" { +#endif + + /* Return X rotated left by N bits, where 0 < N < 64. */ #define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n)) @@ -178,4 +183,9 @@ u64shr (u64 x, int n) #endif + +#ifdef __cplusplus +} +#endif + _GL_INLINE_HEADER_END diff --git a/lib/unistd.in.h b/lib/unistd.in.h index b412966367d..fa99d7472f4 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -159,8 +159,9 @@ #endif /* MSVC defines off_t in . - May also define off_t to a 64-bit type on native Windows. */ -/* Get off_t, ssize_t, mode_t. */ + May also define off_t to a 64-bit type on native Windows. + Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */ +/* Get off_t, off64_t, ssize_t, mode_t. */ #include /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ diff --git a/lib/utimens.h b/lib/utimens.h index 7c740afd36d..b20d4f4f7ee 100644 --- a/lib/utimens.h +++ b/lib/utimens.h @@ -23,11 +23,22 @@ #endif #include + +#ifdef __cplusplus +extern "C" { +#endif + int fdutimens (int, char const *, struct timespec const [2]); int utimens (char const *, struct timespec const [2]); int lutimens (char const *, struct timespec const [2]); +#ifdef __cplusplus +} +#endif + + #if GNULIB_FDUTIMENSAT + # include # include @@ -36,6 +47,10 @@ _GL_INLINE_HEADER_BEGIN # define _GL_UTIMENS_INLINE _GL_INLINE #endif +#ifdef __cplusplus +extern "C" { +#endif + int fdutimensat (int fd, int dir, char const *name, struct timespec const [2], int atflag); @@ -46,6 +61,10 @@ lutimensat (int dir, char const *file, struct timespec const times[2]) return utimensat (dir, file, times, AT_SYMLINK_NOFOLLOW); } +#ifdef __cplusplus +} +#endif + _GL_INLINE_HEADER_END #endif diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4 index 99c99d1b0fb..cd16771848c 100644 --- a/m4/00gnulib.m4 +++ b/m4/00gnulib.m4 @@ -1,4 +1,5 @@ -# 00gnulib.m4 serial 9 +# 00gnulib.m4 +# serial 9 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/__inline.m4 b/m4/__inline.m4 index 992e16f4ea7..20baf16437f 100644 --- a/m4/__inline.m4 +++ b/m4/__inline.m4 @@ -1,9 +1,12 @@ -# Test for __inline keyword +# __inline.m4 +# serial 1 dnl Copyright 2017-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Test for __inline keyword + AC_DEFUN([gl___INLINE], [ AC_CACHE_CHECK([whether the compiler supports the __inline keyword], diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4 index 0e9f9ba763a..0abd6d9002c 100644 --- a/m4/absolute-header.m4 +++ b/m4/absolute-header.m4 @@ -1,4 +1,5 @@ -# absolute-header.m4 serial 18 +# absolute-header.m4 +# serial 18 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/acl.m4 b/m4/acl.m4 index 2050d108b0c..c7b6ec2b14e 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,10 +1,11 @@ -# acl.m4 - check for access control list (ACL) primitives +# acl.m4 # serial 30 +dnl Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Check for access control list (ACL) primitives # Written by Paul Eggert and Jim Meyering. diff --git a/m4/alloca.m4 b/m4/alloca.m4 index 90960215382..dc78dc19a87 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,4 +1,5 @@ -# alloca.m4 serial 21 +# alloca.m4 +# serial 21 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index d3d4c42519f..b90d0f19390 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -1,4 +1,5 @@ -# assert-h.m4 +# assert_h.m4 +# serial 1 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/builtin-expect.m4 b/m4/builtin-expect.m4 index 8faffc50354..c7af926b34c 100644 --- a/m4/builtin-expect.m4 +++ b/m4/builtin-expect.m4 @@ -1,10 +1,12 @@ -dnl Check for __builtin_expect. - +# builtin-expect.m4 +# serial 1 dnl Copyright 2016-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl Check for __builtin_expect. + dnl Written by Paul Eggert. AC_DEFUN([gl___BUILTIN_EXPECT], diff --git a/m4/byteswap.m4 b/m4/byteswap.m4 index 5493d901916..0c76fe9312d 100644 --- a/m4/byteswap.m4 +++ b/m4/byteswap.m4 @@ -1,4 +1,5 @@ -# byteswap.m4 serial 5 +# byteswap.m4 +# serial 5 dnl Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/c-bool.m4 b/m4/c-bool.m4 index 44fba3c012f..0fb0de3b59e 100644 --- a/m4/c-bool.m4 +++ b/m4/c-bool.m4 @@ -1,10 +1,12 @@ -# Check for bool that conforms to C2023. - +# c-bool.m4 +# serial 1 dnl Copyright 2022-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Check for bool that conforms to C2023. + AC_DEFUN([gl_C_BOOL], [ AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool], diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4 index 05dc6dd264d..b63391a6ad7 100644 --- a/m4/canonicalize.m4 +++ b/m4/canonicalize.m4 @@ -1,4 +1,5 @@ -# canonicalize.m4 serial 39 +# canonicalize.m4 +# serial 39 dnl Copyright (C) 2003-2007, 2009-2024 Free Software Foundation, Inc. diff --git a/m4/clock_time.m4 b/m4/clock_time.m4 index c016575c8ea..27f6fd153a3 100644 --- a/m4/clock_time.m4 +++ b/m4/clock_time.m4 @@ -1,4 +1,5 @@ -# clock_time.m4 serial 14 +# clock_time.m4 +# serial 14 dnl Copyright (C) 2002-2006, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/codeset.m4 b/m4/codeset.m4 index 94dccce7775..e69b7402fc2 100644 --- a/m4/codeset.m4 +++ b/m4/codeset.m4 @@ -1,4 +1,5 @@ -# codeset.m4 serial 5 (gettext-0.18.2) +# codeset.m4 +# serial 5 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/copy-file-range.m4 b/m4/copy-file-range.m4 index 443e598ba55..4ef75f62d40 100644 --- a/m4/copy-file-range.m4 +++ b/m4/copy-file-range.m4 @@ -1,4 +1,5 @@ -# copy-file-range.m4 serial 5 +# copy-file-range.m4 +# serial 5 dnl Copyright 2019-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/d-type.m4 b/m4/d-type.m4 index b06bca5a7dc..0ef89b86b15 100644 --- a/m4/d-type.m4 +++ b/m4/d-type.m4 @@ -1,15 +1,13 @@ +# d-type.m4 # serial 12 +dnl Copyright (C) 1997, 1999-2004, 2006, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. dnl dnl Check whether struct dirent has a member named d_type. -dnl - -# Copyright (C) 1997, 1999-2004, 2006, 2009-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE], [AC_CACHE_CHECK([for d_type member in directory struct], diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index 3e3d967f499..037ae369a2d 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -1,4 +1,5 @@ -# dirent_h.m4 serial 22 +# dirent_h.m4 +# serial 22 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index e58582e6145..605cb706c0a 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,12 +1,12 @@ +# dirfd.m4 # serial 30 -*- Autoconf -*- +dnl Copyright (C) 2001-2006, 2008-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl Find out how to get the file descriptor associated with an open DIR*. -# Copyright (C) 2001-2006, 2008-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - dnl From Jim Meyering AC_DEFUN([gl_FUNC_DIRFD], diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4 index 00f23a70b0c..3437c699ada 100644 --- a/m4/double-slash-root.m4 +++ b/m4/double-slash-root.m4 @@ -1,4 +1,5 @@ -# double-slash-root.m4 serial 4 -*- Autoconf -*- +# double-slash-root.m4 +# serial 4 -*- Autoconf -*- dnl Copyright (C) 2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/dup2.m4 b/m4/dup2.m4 index f6759b647a6..786121fd8f3 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 @@ -1,4 +1,5 @@ -#serial 28 +# dup2.m4 +# serial 28 dnl Copyright (C) 2002, 2005, 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/eealloc.m4 b/m4/eealloc.m4 index d8862a1e0f3..8a15e705541 100644 --- a/m4/eealloc.m4 +++ b/m4/eealloc.m4 @@ -1,4 +1,5 @@ -# eealloc.m4 serial 3 +# eealloc.m4 +# serial 3 dnl Copyright (C) 2003, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/environ.m4 b/m4/environ.m4 index 5b9e06b0088..107960b2e77 100644 --- a/m4/environ.m4 +++ b/m4/environ.m4 @@ -1,4 +1,5 @@ -# environ.m4 serial 8 +# environ.m4 +# serial 8 dnl Copyright (C) 2001-2004, 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/errno_h.m4 b/m4/errno_h.m4 index 8900d6c7257..b6050e5d8e0 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,4 +1,5 @@ -# errno_h.m4 serial 14 +# errno_h.m4 +# serial 14 dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/euidaccess.m4 b/m4/euidaccess.m4 index e3d828f6ca5..3ade282f4ec 100644 --- a/m4/euidaccess.m4 +++ b/m4/euidaccess.m4 @@ -1,4 +1,5 @@ -# euidaccess.m4 serial 17 +# euidaccess.m4 +# serial 17 dnl Copyright (C) 2002-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/execinfo.m4 b/m4/execinfo.m4 index a76c33525e6..9dc8d6d489d 100644 --- a/m4/execinfo.m4 +++ b/m4/execinfo.m4 @@ -1,10 +1,12 @@ -# Check for GNU-style execinfo.h. - +# execinfo.m4 +# serial 1 dnl Copyright 2012-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Check for GNU-style execinfo.h. + AC_DEFUN([gl_EXECINFO_H], [ AC_CHECK_HEADERS_ONCE([execinfo.h]) diff --git a/m4/extensions.m4 b/m4/extensions.m4 index 6fc2e300e0a..1fb68956b33 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 @@ -1,10 +1,11 @@ -# serial 23 -*- Autoconf -*- -# Enable extensions on systems that normally disable them. +# extensions.m4 +# serial 25 -*- Autoconf -*- +dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Enable extensions on systems that normally disable them. dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+. @@ -229,4 +230,15 @@ AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], [Define to enable the declarations of ISO C 11 types and functions.]) ;; esac + + dnl On OpenSolaris derivatives, the include files contains a couple of + dnl declarations that are only activated with an explicit + dnl -D__STDC_WANT_LIB_EXT1__. + AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS], +[/* Define to enable the declarations of ISO C 23 Annex K types and functions. */ +#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__) +#undef/**/__STDC_WANT_LIB_EXT1__ +#define __STDC_WANT_LIB_EXT1__ 1 +#endif +]) ]) diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index 680250ec774..547da82afa5 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 @@ -1,10 +1,12 @@ -dnl 'extern inline' a la ISO C99. - +# extern-inline.m4 +# serial 1 dnl Copyright 2012-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl 'extern inline' a la ISO C99. + AC_DEFUN([gl_EXTERN_INLINE], [ AC_CACHE_CHECK([whether ctype.h defines __header_inline], diff --git a/m4/faccessat.m4 b/m4/faccessat.m4 index b8c058cef28..c5f40e52900 100644 --- a/m4/faccessat.m4 +++ b/m4/faccessat.m4 @@ -1,11 +1,12 @@ +# faccessat.m4 # serial 12 -# See if we need to provide faccessat replacement. - dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# See if we need to provide faccessat replacement. + # Written by Eric Blake. AC_DEFUN([gl_FUNC_FACCESSAT], diff --git a/m4/fchmodat.m4 b/m4/fchmodat.m4 index 9750572a5a3..e71ee8e8ef6 100644 --- a/m4/fchmodat.m4 +++ b/m4/fchmodat.m4 @@ -1,4 +1,5 @@ -# fchmodat.m4 serial 8 +# fchmodat.m4 +# serial 8 dnl Copyright (C) 2004-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/fcntl.m4 b/m4/fcntl.m4 index 02b93f8357c..f6d0f377319 100644 --- a/m4/fcntl.m4 +++ b/m4/fcntl.m4 @@ -1,4 +1,5 @@ -# fcntl.m4 serial 11 +# fcntl.m4 +# serial 12 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -82,7 +83,7 @@ AC_DEFUN([gl_FUNC_FCNTL], esac dnl Many systems lack F_DUPFD_CLOEXEC. - dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD. + dnl NetBSD 10.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD. AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC], [gl_cv_func_fcntl_f_dupfd_cloexec], [AC_RUN_IFELSE( diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4 index ba4eb4494db..b69f7a0ca81 100644 --- a/m4/fcntl_h.m4 +++ b/m4/fcntl_h.m4 @@ -1,10 +1,12 @@ +# fcntl_h.m4 # serial 20 -# Configure fcntl.h. dnl Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Configure fcntl.h. + dnl Written by Paul Eggert. AC_DEFUN_ONCE([gl_FCNTL_H], diff --git a/m4/fdopendir.m4 b/m4/fdopendir.m4 index bf361ff154c..e9268378d6e 100644 --- a/m4/fdopendir.m4 +++ b/m4/fdopendir.m4 @@ -1,11 +1,12 @@ +# fdopendir.m4 # serial 15 -# See if we need to provide fdopendir. - dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# See if we need to provide fdopendir. + # Written by Eric Blake. AC_DEFUN([gl_FUNC_FDOPENDIR], diff --git a/m4/filemode.m4 b/m4/filemode.m4 index b72317281b3..cb87a564cfd 100644 --- a/m4/filemode.m4 +++ b/m4/filemode.m4 @@ -1,4 +1,5 @@ -# filemode.m4 serial 9 +# filemode.m4 +# serial 9 dnl Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/flexmember.m4 b/m4/flexmember.m4 index 9df6c03cd3b..73fb6142faf 100644 --- a/m4/flexmember.m4 +++ b/m4/flexmember.m4 @@ -1,10 +1,11 @@ +# flexmember.m4 # serial 5 -# Check for flexible array member support. +dnl Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Check for flexible array member support. # Written by Paul Eggert. diff --git a/m4/fpending.m4 b/m4/fpending.m4 index 05064b851ec..9f2d83fb117 100644 --- a/m4/fpending.m4 +++ b/m4/fpending.m4 @@ -1,9 +1,9 @@ +# fpending.m4 # serial 23 - -# Copyright (C) 2000-2001, 2004-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl Copyright (C) 2000-2001, 2004-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering dnl Using code from emacs, based on suggestions from Paul Eggert diff --git a/m4/fpieee.m4 b/m4/fpieee.m4 index 239cf4a7e2d..665543d0ed8 100644 --- a/m4/fpieee.m4 +++ b/m4/fpieee.m4 @@ -1,4 +1,5 @@ -# fpieee.m4 serial 2 -*- coding: utf-8 -*- +# fpieee.m4 +# serial 2 -*- coding: utf-8 -*- dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/free.m4 b/m4/free.m4 index 4f6dc2e256d..a2b596d67f7 100644 --- a/m4/free.m4 +++ b/m4/free.m4 @@ -1,8 +1,9 @@ -# free.m4 serial 6 -# Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# free.m4 +# serial 6 +dnl Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. # Written by Paul Eggert and Bruno Haible. diff --git a/m4/fstatat.m4 b/m4/fstatat.m4 index c22569b7961..c5ef7dfb197 100644 --- a/m4/fstatat.m4 +++ b/m4/fstatat.m4 @@ -1,4 +1,5 @@ -# fstatat.m4 serial 5 +# fstatat.m4 +# serial 5 dnl Copyright (C) 2004-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index 31d424c857d..1ce90660858 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -1,11 +1,11 @@ +# fsusage.m4 # serial 35 -# Obtaining file system usage information. +dnl Copyright (C) 1997-1998, 2000-2001, 2003-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# Copyright (C) 1997-1998, 2000-2001, 2003-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Obtaining file system usage information. # Written by Jim Meyering. diff --git a/m4/fsync.m4 b/m4/fsync.m4 index 08e3db8931e..6f49321c2db 100644 --- a/m4/fsync.m4 +++ b/m4/fsync.m4 @@ -1,4 +1,5 @@ -# fsync.m4 serial 2 +# fsync.m4 +# serial 2 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/futimens.m4 b/m4/futimens.m4 index ac961e7bde5..b5f22605f49 100644 --- a/m4/futimens.m4 +++ b/m4/futimens.m4 @@ -1,11 +1,12 @@ +# futimens.m4 # serial 11 -# See if we need to provide futimens replacement. - dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# See if we need to provide futimens replacement. + # Written by Eric Blake. AC_DEFUN([gl_FUNC_FUTIMENS], diff --git a/m4/getdelim.m4 b/m4/getdelim.m4 index 0dbd8bc6f8b..61139039554 100644 --- a/m4/getdelim.m4 +++ b/m4/getdelim.m4 @@ -1,4 +1,5 @@ -# getdelim.m4 serial 19 +# getdelim.m4 +# serial 19 dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc. dnl diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4 index 3b89456baf9..aaefe9b2983 100644 --- a/m4/getdtablesize.m4 +++ b/m4/getdtablesize.m4 @@ -1,4 +1,5 @@ -# getdtablesize.m4 serial 8 +# getdtablesize.m4 +# serial 8 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/getgroups.m4 b/m4/getgroups.m4 index f6e0cbd3fce..5457275e9e1 100644 --- a/m4/getgroups.m4 +++ b/m4/getgroups.m4 @@ -1,14 +1,13 @@ +# getgroups.m4 # serial 25 +dnl Copyright (C) 1996-1997, 1999-2004, 2008-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. -# Copyright (C) 1996-1997, 1999-2004, 2008-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - # This is taken from the following Autoconf patch: # https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 AC_DEFUN([AC_FUNC_GETGROUPS], diff --git a/m4/getline.m4 b/m4/getline.m4 index 1a7e89034bc..36513cd4171 100644 --- a/m4/getline.m4 +++ b/m4/getline.m4 @@ -1,4 +1,5 @@ -# getline.m4 serial 33 +# getline.m4 +# serial 33 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2024 Free Software Foundation, dnl Inc. diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index 9d0236f77fe..0918bcd21ec 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -1,13 +1,12 @@ -# Check for getloadavg. - -# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free Software -# Foundation, Inc. +# getloadavg.m4 +# serial 13 +dnl Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free Software +dnl Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 13 +# Check for getloadavg. # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. # New applications should use gl_GETLOADAVG instead. diff --git a/m4/getopt.m4 b/m4/getopt.m4 index be812d8459b..297722eae44 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -1,4 +1,5 @@ -# getopt.m4 serial 49 +# getopt.m4 +# serial 49 dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 55be445c31a..0051c9c4218 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,5 @@ -# getrandom.m4 serial 13 +# getrandom.m4 +# serial 13 dnl Copyright 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/gettime.m4 b/m4/gettime.m4 index 1ec018d5154..299f3d1b788 100644 --- a/m4/gettime.m4 +++ b/m4/gettime.m4 @@ -1,4 +1,5 @@ -# gettime.m4 serial 15 +# gettime.m4 +# serial 15 dnl Copyright (C) 2002, 2004-2006, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 35269914ced..8135f89e584 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,9 +1,9 @@ +# gettimeofday.m4 # serial 30 - -# Copyright (C) 2001-2003, 2005, 2007, 2009-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl Copyright (C) 2001-2003, 2005, 2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index d8d0904f787..cb730449507 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,5 @@ -# gnulib-common.m4 serial 92 +# gnulib-common.m4 +# serial 93 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -504,8 +505,10 @@ AC_DEFUN([gl_COMMON_BODY], [ minimizing the memory required. */ /* Applies to: struct members, struct, union, in C++ also: class. */ +/* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__)) despite + __has_attribute OK. */ #ifndef _GL_ATTRIBUTE_PACKED -# if _GL_HAS_ATTRIBUTE (packed) +# if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C # define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) # else # define _GL_ATTRIBUTE_PACKED diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index d8b92e7b122..37f180a8955 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -192,6 +192,7 @@ AC_DEFUN([gl_EARLY], # Code from module sys_stat: # Code from module sys_time: # Code from module sys_types: + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) # Code from module tempname: # Code from module time-h: # Code from module time_r: @@ -1538,6 +1539,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/nocrash.m4 m4/nproc.m4 m4/nstrftime.m4 + m4/off64_t.m4 m4/off_t.m4 m4/open-cloexec.m4 m4/open-slash.m4 diff --git a/m4/group-member.m4 b/m4/group-member.m4 index 60b3d526db2..f8ceb1d8186 100644 --- a/m4/group-member.m4 +++ b/m4/group-member.m4 @@ -1,10 +1,9 @@ +# group-member.m4 # serial 14 - -# Copyright (C) 1999-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl Copyright (C) 1999-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl Written by Jim Meyering diff --git a/m4/ieee754-h.m4 b/m4/ieee754-h.m4 index cc8ef32bd32..fa41db5c945 100644 --- a/m4/ieee754-h.m4 +++ b/m4/ieee754-h.m4 @@ -1,10 +1,12 @@ -# Configure ieee754-h module - +# ieee754-h.m4 +# serial 1 dnl Copyright 2018-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Configure ieee754-h module + AC_DEFUN([gl_IEEE754_H], [ AC_REQUIRE([AC_C_BIGENDIAN]) diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 70cb746f435..03e852518e4 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,4 +1,5 @@ -# include_next.m4 serial 27 +# include_next.m4 +# serial 27 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 6abf9dbe280..c43cd16207b 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,5 @@ -# inttypes.m4 serial 37 +# inttypes.m4 +# serial 37 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/largefile.m4 b/m4/largefile.m4 index cbe9bc1f63d..2f824089b0a 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -1,11 +1,13 @@ +# largefile.m4 +# serial 1 +dnl Copyright 1992-1996, 1998-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + # Enable large files on systems where this is not the default. # Enable support for files on Linux file systems with 64-bit inode numbers. -# Copyright 1992-1996, 1998-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - # The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO: # It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this # setting of _LARGEFILE_SOURCE is needed so that declares fseeko @@ -24,9 +26,20 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE], ]]) ) +dnl Remove AC_SYS_YEAR2038_RECOMMENDED if unpatched Autoconf 2.72 or earlier. +dnl Autoconf 2.72 still uses -n32, which is not a C preprocessor option, +dnl and which was useful only on IRIX which is no longer supported. +dnl This should be fixed in Autoconf 2.73. +m4_ifdef([AC_SYS_YEAR2038_RECOMMENDED], + [m4_bmatch(m4_ifdef([_AC_SYS_LARGEFILE_OPTIONS], + [m4_defn([_AC_SYS_LARGEFILE_OPTIONS])], + ["-n32"]), + ["-n32"], + [m4_undefine([AC_SYS_YEAR2038_RECOMMENDED])])]) + m4_ifndef([AC_SYS_YEAR2038_RECOMMENDED], [ -# Support AC_SYS_YEAR2038_RECOMMENDED and related macros, even if -# Autoconf 2.71 or earlier. This code is taken from Autoconf master. +# Fix up AC_SYS_YEAR2038_RECOMMENDED and related macros, even if +# unpatched Autoconf 2.72 or earlier. This code is taken from Autoconf master. # _AC_SYS_YEAR2038_TEST_CODE # -------------------------- @@ -75,7 +88,7 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize( # If you change this macro you may also need to change # _AC_SYS_YEAR2038_OPTIONS. AC_DEFUN([_AC_SYS_YEAR2038_PROBE], -[AC_CACHE_CHECK([for $CC option for timestamps after 2038], +[AC_CACHE_CHECK([for $CPPFLAGS option for timestamps after 2038], [ac_cv_sys_year2038_opts], [ac_save_CPPFLAGS="$CPPFLAGS" ac_opt_found=no @@ -205,7 +218,6 @@ m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize( ["none needed"] dnl Most current systems ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec ["-D_LARGE_FILES=1"] dnl 32-bit AIX 4.2.1+, 32-bit z/OS - ["-n32"] dnl 32-bit IRIX 6, SGI cc (obsolete) )) # _AC_SYS_LARGEFILE_PROBE @@ -222,25 +234,25 @@ m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize( # If you change this macro you may also need to change # _AC_SYS_LARGEFILE_OPTIONS. AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], -[AC_CACHE_CHECK([for $CC option to enable large file support], +[AC_CACHE_CHECK([for $CPPFLAGS option for large files], [ac_cv_sys_largefile_opts], - [ac_save_CC="$CC" + [ac_save_CPPFLAGS=$CPPFLAGS ac_opt_found=no for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do AS_IF([test x"$ac_opt" != x"none needed"], - [CC="$ac_save_CC $ac_opt"]) + [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])], [AS_IF([test x"$ac_opt" = x"none needed"], [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. - CC="$CC -DFTYPE=ino_t" + CPPFLAGS="$CPPFLAGS -DFTYPE=ino_t" AC_COMPILE_IFELSE([], [], - [CC="$CC -D_FILE_OFFSET_BITS=64" + [CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])]) ac_cv_sys_largefile_opts=$ac_opt ac_opt_found=yes]) test $ac_opt_found = no || break done - CC="$ac_save_CC" + CPPFLAGS=$ac_save_CPPFLAGS dnl Gnulib implements large file support for native Windows, based on the dnl variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE. m4_ifdef([gl_LARGEFILE], [ @@ -270,9 +282,6 @@ AS_CASE([$ac_cv_sys_largefile_opts], [AC_DEFINE([_LARGE_FILES], [1], [Define to 1 on platforms where this makes off_t a 64-bit type.])], - ["-n32"], - [CC="$CC -n32"], - [AC_MSG_ERROR( [internal error: bad value for \$ac_cv_sys_largefile_opts])]) diff --git a/m4/lchmod.m4 b/m4/lchmod.m4 index 7b263a241eb..797cb446938 100644 --- a/m4/lchmod.m4 +++ b/m4/lchmod.m4 @@ -1,5 +1,5 @@ -#serial 10 - +# lchmod.m4 +# serial 10 dnl Copyright (C) 2005-2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/libgmp.m4 b/m4/libgmp.m4 index 782dfbae2e1..a82a6fa1b71 100644 --- a/m4/libgmp.m4 +++ b/m4/libgmp.m4 @@ -1,4 +1,5 @@ -# libgmp.m4 serial 8 +# libgmp.m4 +# serial 8 # Configure the GMP library or a replacement. dnl Copyright 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/limits-h.m4 b/m4/limits-h.m4 index 1825328380b..1b619e1eb2e 100644 --- a/m4/limits-h.m4 +++ b/m4/limits-h.m4 @@ -1,10 +1,12 @@ -dnl Check whether limits.h has needed features. - +# limits-h.m4 +# serial 1 dnl Copyright 2016-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl Check whether limits.h has needed features. + dnl From Paul Eggert. AC_DEFUN_ONCE([gl_LIMITS_H], diff --git a/m4/lstat.m4 b/m4/lstat.m4 index 48cc8653fe6..f838e2cc1e8 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,10 +1,9 @@ +# lstat.m4 # serial 36 - -# Copyright (C) 1997-2001, 2003-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl Copyright (C) 1997-2001, 2003-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. diff --git a/m4/malloc.m4 b/m4/malloc.m4 index 635d6726b11..41a46937ead 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,4 +1,5 @@ -# malloc.m4 serial 31 +# malloc.m4 +# serial 31 dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 3c6795ceb28..14bc5041eaa 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,4 +1,5 @@ -# manywarnings.m4 serial 25 +# manywarnings.m4 +# serial 26 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -110,6 +111,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], -Wduplicated-cond \ -Wextra \ -Wformat-signedness \ + -Wflex-array-member-not-at-end \ -Winit-self \ -Winline \ -Winvalid-pch \ @@ -117,6 +119,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], -Wmissing-declarations \ -Wmissing-include-dirs \ -Wmissing-prototypes \ + -Wmissing-variable-declarations \ -Wnested-externs \ -Wnull-dereference \ -Wold-style-definition \ diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4 index b2bcba45e96..66d65cd7c11 100644 --- a/m4/mbstate_t.m4 +++ b/m4/mbstate_t.m4 @@ -1,4 +1,5 @@ -# mbstate_t.m4 serial 14 +# mbstate_t.m4 +# serial 14 dnl Copyright (C) 2000-2002, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/md5.m4 b/m4/md5.m4 index 7af56a8a3d1..a7b33d771ff 100644 --- a/m4/md5.m4 +++ b/m4/md5.m4 @@ -1,4 +1,5 @@ -# md5.m4 serial 14 +# md5.m4 +# serial 14 dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/memmem.m4 b/m4/memmem.m4 index 7985266f8b7..a9bc277813b 100644 --- a/m4/memmem.m4 +++ b/m4/memmem.m4 @@ -1,4 +1,5 @@ -# memmem.m4 serial 29 +# memmem.m4 +# serial 29 dnl Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4 index 94ce05d1a6a..377fda3caca 100644 --- a/m4/mempcpy.m4 +++ b/m4/mempcpy.m4 @@ -1,4 +1,5 @@ -# mempcpy.m4 serial 14 +# mempcpy.m4 +# serial 14 dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/memrchr.m4 b/m4/memrchr.m4 index b4ccdfa3c8d..d8c931e90cc 100644 --- a/m4/memrchr.m4 +++ b/m4/memrchr.m4 @@ -1,4 +1,5 @@ -# memrchr.m4 serial 11 +# memrchr.m4 +# serial 11 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/memset_explicit.m4 b/m4/memset_explicit.m4 index 19514ff917e..499a95968ab 100644 --- a/m4/memset_explicit.m4 +++ b/m4/memset_explicit.m4 @@ -1,4 +1,5 @@ -# memset_explicit.m4 serial 2 +# memset_explicit.m4 +# serial 3 dnl Copyright 2022-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +8,8 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_MEMSET_EXPLICIT], [ AC_REQUIRE([gl_STRING_H_DEFAULTS]) + dnl Persuade OpenSolaris derivatives' to declare memset_s(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) gl_CHECK_FUNCS_ANDROID([memset_explicit], [[#include ]]) if test $ac_cv_func_memset_explicit = no; then diff --git a/m4/minmax.m4 b/m4/minmax.m4 index 5c0a927da66..bc7d0c345fa 100644 --- a/m4/minmax.m4 +++ b/m4/minmax.m4 @@ -1,4 +1,5 @@ -# minmax.m4 serial 4 +# minmax.m4 +# serial 4 dnl Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/mkostemp.m4 b/m4/mkostemp.m4 index 1c22b8d51b4..57a033b859e 100644 --- a/m4/mkostemp.m4 +++ b/m4/mkostemp.m4 @@ -1,4 +1,5 @@ -# mkostemp.m4 serial 4 +# mkostemp.m4 +# serial 4 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/mktime.m4 b/m4/mktime.m4 index 0565e5e61fe..85c52454aa5 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,6 +1,6 @@ +# mktime.m4 # serial 39 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/m4/mode_t.m4 b/m4/mode_t.m4 index af88da51285..0d5c2808289 100644 --- a/m4/mode_t.m4 +++ b/m4/mode_t.m4 @@ -1,4 +1,5 @@ -# mode_t.m4 serial 2 +# mode_t.m4 +# serial 2 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/multiarch.m4 b/m4/multiarch.m4 index 5f8339f5c7d..3af29d39a0b 100644 --- a/m4/multiarch.m4 +++ b/m4/multiarch.m4 @@ -1,4 +1,5 @@ -# multiarch.m4 serial 9 +# multiarch.m4 +# serial 9 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/musl.m4 b/m4/musl.m4 index 34d2c1ff22a..0d4de8926a2 100644 --- a/m4/musl.m4 +++ b/m4/musl.m4 @@ -1,4 +1,5 @@ -# musl.m4 serial 4 +# musl.m4 +# serial 4 dnl Copyright (C) 2019-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4 index ff730b676cd..a7281b8ac5f 100644 --- a/m4/nanosleep.m4 +++ b/m4/nanosleep.m4 @@ -1,15 +1,13 @@ +# nanosleep.m4 # serial 47 +dnl Copyright (C) 1999-2001, 2003-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. dnl Check for the nanosleep function. dnl If not found, use the supplied replacement. -dnl - -# Copyright (C) 1999-2001, 2003-2024 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_NANOSLEEP], [ diff --git a/m4/nocrash.m4 b/m4/nocrash.m4 index 9730fc09034..cbe8fe82d5d 100644 --- a/m4/nocrash.m4 +++ b/m4/nocrash.m4 @@ -1,4 +1,5 @@ -# nocrash.m4 serial 5 +# nocrash.m4 +# serial 5 dnl Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/nproc.m4 b/m4/nproc.m4 index e4065776a86..317741d9b8d 100644 --- a/m4/nproc.m4 +++ b/m4/nproc.m4 @@ -1,4 +1,5 @@ -# nproc.m4 serial 6 +# nproc.m4 +# serial 6 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4 index aa5d63a54b5..f73bca40ec1 100644 --- a/m4/nstrftime.m4 +++ b/m4/nstrftime.m4 @@ -1,10 +1,9 @@ +# nstrftime.m4 # serial 38 - -# Copyright (C) 1996-1997, 1999-2007, 2009-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl Copyright (C) 1996-1997, 1999-2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. # Written by Jim Meyering and Paul Eggert. diff --git a/m4/off_t.m4 b/m4/off_t.m4 index f3259f9c245..db6035dbeb3 100644 --- a/m4/off_t.m4 +++ b/m4/off_t.m4 @@ -1,4 +1,5 @@ -# off_t.m4 serial 1 +# off_t.m4 +# serial 1 dnl Copyright (C) 2012-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/open-cloexec.m4 b/m4/open-cloexec.m4 index a2d50329b97..6defdfb4005 100644 --- a/m4/open-cloexec.m4 +++ b/m4/open-cloexec.m4 @@ -1,10 +1,12 @@ -# Test whether O_CLOEXEC is defined. - +# open-cloexec.m4 +# serial 1 dnl Copyright 2017-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Test whether O_CLOEXEC is defined. + AC_DEFUN([gl_PREPROC_O_CLOEXEC], [ AC_CACHE_CHECK([for O_CLOEXEC], diff --git a/m4/open-slash.m4 b/m4/open-slash.m4 index 45310c0c581..03460e422d9 100644 --- a/m4/open-slash.m4 +++ b/m4/open-slash.m4 @@ -1,4 +1,5 @@ -# open-slash.m4 serial 2 +# open-slash.m4 +# serial 2 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/open.m4 b/m4/open.m4 index 91e5c31b59a..62a11a110c5 100644 --- a/m4/open.m4 +++ b/m4/open.m4 @@ -1,4 +1,5 @@ -# open.m4 serial 16 +# open.m4 +# serial 16 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 index a0fc296c9b2..4280837f1e1 100644 --- a/m4/pathmax.m4 +++ b/m4/pathmax.m4 @@ -1,4 +1,5 @@ -# pathmax.m4 serial 11 +# pathmax.m4 +# serial 11 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/pid_t.m4 b/m4/pid_t.m4 index 8f8d39d81db..8bedcc6bcd3 100644 --- a/m4/pid_t.m4 +++ b/m4/pid_t.m4 @@ -1,4 +1,5 @@ -# pid_t.m4 serial 4 +# pid_t.m4 +# serial 4 dnl Copyright (C) 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/pipe2.m4 b/m4/pipe2.m4 index 74b7b284b3e..e8ace7f077e 100644 --- a/m4/pipe2.m4 +++ b/m4/pipe2.m4 @@ -1,4 +1,5 @@ -# pipe2.m4 serial 4 +# pipe2.m4 +# serial 4 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/pselect.m4 b/m4/pselect.m4 index 005b722b965..23d1fadd637 100644 --- a/m4/pselect.m4 +++ b/m4/pselect.m4 @@ -1,4 +1,5 @@ -# pselect.m4 serial 11 +# pselect.m4 +# serial 11 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4 index cb2ee900313..437869f6dbe 100644 --- a/m4/pthread_sigmask.m4 +++ b/m4/pthread_sigmask.m4 @@ -1,4 +1,5 @@ -# pthread_sigmask.m4 serial 23 +# pthread_sigmask.m4 +# serial 23 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/rawmemchr.m4 b/m4/rawmemchr.m4 index 57d1c2915e3..6e0fa0a55e8 100644 --- a/m4/rawmemchr.m4 +++ b/m4/rawmemchr.m4 @@ -1,4 +1,5 @@ -# rawmemchr.m4 serial 3 +# rawmemchr.m4 +# serial 3 dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/readlink.m4 b/m4/readlink.m4 index 6d78ec84a03..bc9a5deb06e 100644 --- a/m4/readlink.m4 +++ b/m4/readlink.m4 @@ -1,4 +1,5 @@ -# readlink.m4 serial 17 +# readlink.m4 +# serial 17 dnl Copyright (C) 2003, 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/readlinkat.m4 b/m4/readlinkat.m4 index 99822102294..8a33c169136 100644 --- a/m4/readlinkat.m4 +++ b/m4/readlinkat.m4 @@ -1,11 +1,12 @@ +# readlinkat.m4 # serial 8 -# See if we need to provide readlinkat replacement. - dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# See if we need to provide readlinkat replacement. + # Written by Eric Blake. AC_DEFUN([gl_FUNC_READLINKAT], diff --git a/m4/readutmp.m4 b/m4/readutmp.m4 index ec40019735f..1d9071fe65a 100644 --- a/m4/readutmp.m4 +++ b/m4/readutmp.m4 @@ -1,4 +1,5 @@ -# readutmp.m4 serial 31 +# readutmp.m4 +# serial 31 dnl Copyright (C) 2002-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/realloc.m4 b/m4/realloc.m4 index a59af2807c9..eb90d5885c7 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,4 +1,5 @@ -# realloc.m4 serial 29 +# realloc.m4 +# serial 29 dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/regex.m4 b/m4/regex.m4 index 3dfeabea057..f0101fe67c6 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,10 +1,9 @@ +# regex.m4 # serial 75 - -# Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl Initially derived from code in GNU grep. dnl Mostly written by Jim Meyering. diff --git a/m4/sha1.m4 b/m4/sha1.m4 index c0a87536a5c..51f2afe8d0d 100644 --- a/m4/sha1.m4 +++ b/m4/sha1.m4 @@ -1,4 +1,5 @@ -# sha1.m4 serial 12 +# sha1.m4 +# serial 12 dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sha256.m4 b/m4/sha256.m4 index 2dd754c1778..ad5596a488f 100644 --- a/m4/sha256.m4 +++ b/m4/sha256.m4 @@ -1,4 +1,5 @@ -# sha256.m4 serial 8 +# sha256.m4 +# serial 8 dnl Copyright (C) 2005, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sha512.m4 b/m4/sha512.m4 index 19d03b50271..86e5518beec 100644 --- a/m4/sha512.m4 +++ b/m4/sha512.m4 @@ -1,4 +1,5 @@ -# sha512.m4 serial 9 +# sha512.m4 +# serial 9 dnl Copyright (C) 2005-2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sig2str.m4 b/m4/sig2str.m4 index ab3786b8954..096d0253fcb 100644 --- a/m4/sig2str.m4 +++ b/m4/sig2str.m4 @@ -1,3 +1,4 @@ +# sig2str.m4 # serial 7 dnl Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/sigdescr_np.m4 b/m4/sigdescr_np.m4 index d844e2f9db7..72da5e957ca 100644 --- a/m4/sigdescr_np.m4 +++ b/m4/sigdescr_np.m4 @@ -1,4 +1,5 @@ -# sigdescr_np.m4 serial 2 +# sigdescr_np.m4 +# serial 2 dnl Copyright (C) 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/signal_h.m4 b/m4/signal_h.m4 index 6f7dcc733b4..65afa2a1dee 100644 --- a/m4/signal_h.m4 +++ b/m4/signal_h.m4 @@ -1,4 +1,5 @@ -# signal_h.m4 serial 22 +# signal_h.m4 +# serial 22 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/socklen.m4 b/m4/socklen.m4 index 9c46db18937..9ece0abb6d0 100644 --- a/m4/socklen.m4 +++ b/m4/socklen.m4 @@ -1,4 +1,5 @@ -# socklen.m4 serial 11 +# socklen.m4 +# serial 11 dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 index 25b28d77e4e..c15f948adb7 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,4 +1,5 @@ -# ssize_t.m4 serial 6 +# ssize_t.m4 +# serial 6 dnl Copyright (C) 2001-2003, 2006, 2010-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/stat-time.m4 b/m4/stat-time.m4 index 8bec2f5f815..e8ee7d5125e 100644 --- a/m4/stat-time.m4 +++ b/m4/stat-time.m4 @@ -1,11 +1,11 @@ -# Checks for stat-related time functions. - -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free Software -# Foundation, Inc. +# stat-time.m4 +# serial 1 +dnl Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Checks for stat-related time functions. dnl From Paul Eggert. diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4 index 59998c17cf7..37324c158e7 100644 --- a/m4/std-gnu11.m4 +++ b/m4/std-gnu11.m4 @@ -1,3 +1,6 @@ +# std-gnu11.m4 +# serial 1 + # Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- # This implementation is taken from GNU Autoconf lib/autoconf/c.m4 diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index e3c1e609236..2b4762f3200 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -1,10 +1,12 @@ -# Check for alignas and alignof that conform to C23. - +# stdalign.m4 +# serial 1 dnl Copyright 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# Check for alignas and alignof that conform to C23. + dnl Written by Paul Eggert and Bruno Haible. # Prepare for substituting if it is not supported. diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4 index 1bf9eb39b66..998fe12fa83 100644 --- a/m4/stddef_h.m4 +++ b/m4/stddef_h.m4 @@ -1,4 +1,5 @@ -# stddef_h.m4 serial 14 +# stddef_h.m4 +# serial 16 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -83,6 +84,36 @@ AC_DEFUN_ONCE([gl_STDDEF_H], GL_GENERATE_STDDEF_H=true fi + dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869 + AC_CACHE_CHECK([whether nullptr_t needs ], + [gl_cv_nullptr_t_needs_stddef], + [AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]], + [gl_cv_nullptr_t_needs_stddef=no], + [gl_cv_nullptr_t_needs_stddef=yes])]) + if test "$gl_cv_nullptr_t_needs_stddef" = no; then + NULLPTR_T_NEEDS_STDDEF=0 + GL_GENERATE_STDDEF_H=true + fi + + AC_CACHE_CHECK([for clean definition of __STDC_VERSION_STDDEF_H__], + [gl_cv_clean_version_stddef], + [AC_PREPROC_IFELSE( + [AC_LANG_SOURCE( + [[/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 */ + #include + #undef __STDC_VERSION_STDDEF_H__ + #include + #ifdef __STDC_VERSION_STDDEF_H__ + # error " defines __STDC_VERSION_STDDEF_H__" + #endif + ]])], + [gl_cv_clean_version_stddef=yes], + [gl_cv_clean_version_stddef=no])]) + if test "$gl_cv_clean_version_stddef" = no; then + STDDEF_NOT_IDEMPOTENT=1 + GL_GENERATE_STDDEF_H=true + fi + if $GL_GENERATE_STDDEF_H; then gl_NEXT_HEADERS([stddef.h]) fi @@ -113,6 +144,8 @@ AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS], AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. + NULLPTR_T_NEEDS_STDDEF=1; AC_SUBST([NULLPTR_T_NEEDS_STDDEF]) + STDDEF_NOT_IDEMPOTENT=0; AC_SUBST([STDDEF_NOT_IDEMPOTENT]) REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T]) HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 4aa250827cc..2dea846914b 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,5 @@ -# stdint.m4 serial 63 +# stdint.m4 +# serial 63 dnl Copyright (C) 2001-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index c19feefe717..8eb5816ad7e 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,4 +1,5 @@ -# stdio_h.m4 serial 63 +# stdio_h.m4 +# serial 63 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 92e67a74bb5..a4662f29955 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,5 @@ -# stdlib_h.m4 serial 76 +# stdlib_h.m4 +# serial 77 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -145,6 +146,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL]) @@ -205,6 +207,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE]) HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) + HAVE_STRTOF=1; AC_SUBST([HAVE_STRTOF]) HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL]) HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) @@ -248,6 +251,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + REPLACE_STRTOF=0; AC_SUBST([REPLACE_STRTOF]) REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL]) REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD]) REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL]) diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4 index 04c8bbe4c94..c4d71dd9fa5 100644 --- a/m4/stpcpy.m4 +++ b/m4/stpcpy.m4 @@ -1,4 +1,5 @@ -# stpcpy.m4 serial 11 +# stpcpy.m4 +# serial 11 dnl Copyright (C) 2002, 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/string_h.m4 b/m4/string_h.m4 index 9ea748cc774..f31264ae85b 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -1,11 +1,11 @@ -# Configure a GNU-like replacement for . - -# Copyright (C) 2007-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - +# string_h.m4 # serial 39 +dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Configure a GNU-like replacement for . # Written by Paul Eggert. diff --git a/m4/strnlen.m4 b/m4/strnlen.m4 index 3eac8e629d7..b4d2778524e 100644 --- a/m4/strnlen.m4 +++ b/m4/strnlen.m4 @@ -1,4 +1,5 @@ -# strnlen.m4 serial 14 +# strnlen.m4 +# serial 14 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 index b58fa48ff6e..2a0b50b3428 100644 --- a/m4/strtoimax.m4 +++ b/m4/strtoimax.m4 @@ -1,4 +1,5 @@ -# strtoimax.m4 serial 17 +# strtoimax.m4 +# serial 17 dnl Copyright (C) 2002-2004, 2006, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index 130b9094d88..03a50dec2f1 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,4 +1,5 @@ -# strtoll.m4 serial 12 +# strtoll.m4 +# serial 12 dnl Copyright (C) 2002, 2004, 2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/symlink.m4 b/m4/symlink.m4 index 62062cf1499..47968a1d33f 100644 --- a/m4/symlink.m4 +++ b/m4/symlink.m4 @@ -1,11 +1,12 @@ +# symlink.m4 # serial 10 -# See if we need to provide symlink replacement. - dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# See if we need to provide symlink replacement. + # Written by Eric Blake. AC_DEFUN([gl_FUNC_SYMLINK], diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4 index b050d079b92..62fd519e365 100644 --- a/m4/sys_random_h.m4 +++ b/m4/sys_random_h.m4 @@ -1,4 +1,5 @@ -# sys_random_h.m4 serial 8 +# sys_random_h.m4 +# serial 8 dnl Copyright (C) 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4 index 9e279fbab8d..550e066e171 100644 --- a/m4/sys_select_h.m4 +++ b/m4/sys_select_h.m4 @@ -1,4 +1,5 @@ -# sys_select_h.m4 serial 23 +# sys_select_h.m4 +# serial 23 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4 index af524849f03..3bf3cb47778 100644 --- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -1,4 +1,5 @@ -# sys_socket_h.m4 serial 29 +# sys_socket_h.m4 +# serial 29 dnl Copyright (C) 2005-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 index 75018537d57..3cc50ce6776 100644 --- a/m4/sys_stat_h.m4 +++ b/m4/sys_stat_h.m4 @@ -1,4 +1,5 @@ -# sys_stat_h.m4 serial 42 -*- Autoconf -*- +# sys_stat_h.m4 +# serial 42 -*- Autoconf -*- dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index dc5353f3785..d3203088934 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -1,10 +1,11 @@ -# Configure a replacement for . +# sys_time_h.m4 # serial 12 +dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Configure a replacement for . # Written by Paul Eggert and Martin Lambers. diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4 index 37d0ccad403..7c7f2655272 100644 --- a/m4/sys_types_h.m4 +++ b/m4/sys_types_h.m4 @@ -1,4 +1,5 @@ -# sys_types_h.m4 serial 13 +# sys_types_h.m4 +# serial 14 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,6 +23,9 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], dnl Whether to override the 'off_t' type. AC_REQUIRE([gl_TYPE_OFF_T]) + dnl Whether to define the 'off64_t' type. + AC_REQUIRE([gl_TYPE_OFF64_T]) + dnl Whether to override the 'dev_t' and 'ino_t' types. m4_ifdef([gl_WINDOWS_STAT_INODES], [ AC_REQUIRE([gl_WINDOWS_STAT_INODES]) diff --git a/m4/tempname.m4 b/m4/tempname.m4 index 31d35c83eb5..795a9803fd0 100644 --- a/m4/tempname.m4 +++ b/m4/tempname.m4 @@ -1,9 +1,9 @@ -#serial 5 - -# Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# tempname.m4 +# serial 5 +dnl Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. # glibc provides __gen_tempname as a wrapper for mk[ds]temp. Expose # it as a public API, and provide it on systems that are lacking. diff --git a/m4/time_h.m4 b/m4/time_h.m4 index 32fade0f401..d2f3c9701cb 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -1,12 +1,11 @@ -# Configure a more-standard replacement for . - -# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. - +# time_h.m4 # serial 25 +dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Configure a more-standard replacement for . # Written by Paul Eggert and Jim Meyering. diff --git a/m4/time_r.m4 b/m4/time_r.m4 index 4ee2175b690..3675390e871 100644 --- a/m4/time_r.m4 +++ b/m4/time_r.m4 @@ -1,10 +1,12 @@ -dnl Reentrant time functions: localtime_r, gmtime_r. - +# time_r.m4 +# serial 1 dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl Reentrant time functions: localtime_r, gmtime_r. + dnl Written by Paul Eggert. AC_DEFUN([gl_TIME_R], diff --git a/m4/time_rz.m4 b/m4/time_rz.m4 index c3b72b7603b..8f45f2b1d3d 100644 --- a/m4/time_rz.m4 +++ b/m4/time_rz.m4 @@ -1,10 +1,12 @@ -dnl Time zone functions: tzalloc, localtime_rz, etc. - +# time_rz.m4 +# serial 1 dnl Copyright (C) 2015-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl Time zone functions: tzalloc, localtime_rz, etc. + dnl Written by Paul Eggert. AC_DEFUN([gl_TIME_RZ], diff --git a/m4/timegm.m4 b/m4/timegm.m4 index 84336043e5d..c1ff26777b8 100644 --- a/m4/timegm.m4 +++ b/m4/timegm.m4 @@ -1,4 +1,5 @@ -# timegm.m4 serial 16 +# timegm.m4 +# serial 16 dnl Copyright (C) 2003, 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/timer_time.m4 b/m4/timer_time.m4 index 10b7654d30f..59a4cade539 100644 --- a/m4/timer_time.m4 +++ b/m4/timer_time.m4 @@ -1,4 +1,5 @@ -# timer_time.m4 serial 6 +# timer_time.m4 +# serial 6 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/timespec.m4 b/m4/timespec.m4 index 59a0db9966e..5333920ef5e 100644 --- a/m4/timespec.m4 +++ b/m4/timespec.m4 @@ -1,10 +1,9 @@ -#serial 15 - -# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# timespec.m4 +# serial 15 +dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering diff --git a/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4 index f2e51597fdf..0c7dcb2a09a 100644 --- a/m4/tm_gmtoff.m4 +++ b/m4/tm_gmtoff.m4 @@ -1,4 +1,5 @@ -# tm_gmtoff.m4 serial 3 +# tm_gmtoff.m4 +# serial 3 dnl Copyright (C) 2002, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index e078bd617a7..81d1b9f6169 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,5 @@ -# unistd_h.m4 serial 95 +# unistd_h.m4 +# serial 95 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4 index 558f57d809b..e96cf5f8736 100644 --- a/m4/unlocked-io.m4 +++ b/m4/unlocked-io.m4 @@ -1,10 +1,9 @@ -# unlocked-io.m4 serial 16 - -# Copyright (C) 1998-2006, 2009-2024 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# unlocked-io.m4 +# serial 16 +dnl Copyright (C) 1998-2006, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. dnl From Jim Meyering. dnl diff --git a/m4/utimens.m4 b/m4/utimens.m4 index 0f5bfd4c843..9996e3ef336 100644 --- a/m4/utimens.m4 +++ b/m4/utimens.m4 @@ -1,10 +1,10 @@ +# utimens.m4 +# serial 16 dnl Copyright (C) 2003-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -dnl serial 16 - AC_DEFUN([gl_UTIMENS], [ dnl Prerequisites of lib/utimens.c. diff --git a/m4/utimensat.m4 b/m4/utimensat.m4 index 4af7f6f81c8..a583f376687 100644 --- a/m4/utimensat.m4 +++ b/m4/utimensat.m4 @@ -1,11 +1,12 @@ +# utimensat.m4 # serial 12 -# See if we need to provide utimensat replacement. - dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +# See if we need to provide utimensat replacement. + # Written by Eric Blake. AC_DEFUN([gl_FUNC_UTIMENSAT], diff --git a/m4/vararrays.m4 b/m4/vararrays.m4 index 164bf0c49a9..9211f69d4d8 100644 --- a/m4/vararrays.m4 +++ b/m4/vararrays.m4 @@ -1,13 +1,13 @@ -# Check for variable-length arrays. - +# vararrays.m4 # serial 6 +dnl Copyright (C) 2001, 2009-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# From Paul Eggert +# Check for variable-length arrays. -# Copyright (C) 2001, 2009-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# From Paul Eggert m4_version_prereq([2.70], [], [ diff --git a/m4/warnings.m4 b/m4/warnings.m4 index d487636aa36..fe7af01fc50 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,4 +1,5 @@ -# warnings.m4 serial 20 +# warnings.m4 +# serial 20 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 index 94353571b00..968832cb296 100644 --- a/m4/wchar_t.m4 +++ b/m4/wchar_t.m4 @@ -1,4 +1,5 @@ -# wchar_t.m4 serial 4 (gettext-0.18.2) +# wchar_t.m4 +# serial 4 (gettext-0.18.2) dnl Copyright (C) 2002-2003, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/xattr.m4 b/m4/xattr.m4 index 7f72a81eeab..d8c08486834 100644 --- a/m4/xattr.m4 +++ b/m4/xattr.m4 @@ -1,10 +1,11 @@ -# xattr.m4 - check for Extended Attributes (Linux) +# xattr.m4 # serial 7 +dnl Copyright (C) 2003-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -# Copyright (C) 2003-2024 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Check for Extended Attributes (Linux) AC_DEFUN([gl_FUNC_XATTR], [ diff --git a/m4/zzgnulib.m4 b/m4/zzgnulib.m4 index eed5ecbfe1e..710fba4e297 100644 --- a/m4/zzgnulib.m4 +++ b/m4/zzgnulib.m4 @@ -1,4 +1,5 @@ -# zzgnulib.m4 serial 1 +# zzgnulib.m4 +# serial 1 dnl Copyright (C) 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, commit 2e13c2adbad4fc609f560926f6e536b25281f925 Author: Paul Eggert Date: Sat May 4 09:55:27 2024 -0700 Adjust to recent Gnulib changes * 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. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 41531d573b0..c4daaded015 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -126,6 +126,7 @@ rm -- "$src"lib/gl_openssl.h \ "$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \ "$src"m4/locale-fr.m4 \ "$src"m4/manywarnings-c++.m4 \ + "$src"m4/off64_t.m4 \ "$src"m4/warn-on-use.m4 "$src"m4/wint_t.m4 && cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc && cp -- "$gnulib_srcdir"/build-aux/config.guess \ diff --git a/configure.ac b/configure.ac index 69a8ba0a9f8..626e09aad8a 100644 --- a/configure.ac +++ b/configure.ac @@ -1584,6 +1584,10 @@ AC_DEFUN([gt_TYPE_WINT_T], AC_DEFUN_ONCE([gl_STDLIB_H], [AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_NEXT_HEADERS([stdlib.h])]) +# Emacs does not need to check for off64_t. +AC_DEFUN([gl_TYPE_OFF64_T], + [HAVE_OFF64_T=1 + AC_SUBST([HAVE_OFF64_T])]) # Initialize gnulib right after choosing the compiler. dnl Amongst other things, this sets AR and ARFLAGS. commit dcb6a9ebcbf92a4ca7c0e2c393d7a8dd9b1d351e Author: Eli Zaretskii Date: Sat May 11 20:13:17 2024 +0300 ; * lisp/cus-edit.el (custom-save-all): Remove offensive commentary. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 54d648f7ec0..19449afbd2b 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4970,13 +4970,10 @@ if only the first line of the docstring is shown.")) ;; can cause problems when read back, so print them ;; readably. (Bug#52554) (print-escape-control-characters t)) + ;; Insert lexical cookie, but only if the buffer is empty. (save-restriction (widen) (atomic-change-group - ;; The previous test `eobp' was written with an appalling - ;; lack of forethought or testing, being easily misled if - ;; the user should have left point at eob in a buffer - ;; visiting the custom file. (when (eq (point-min) (point-max)) (save-excursion (goto-char (point-min)) commit 6d4179957a830fa03348c47067d9d5c1ae6e3eba Author: Po Lu Date: Sat May 11 22:24:23 2024 +0800 Fix test of whether to insert lexical-binding cookies in custom files * lisp/cus-edit.el (custom-save-all): Test whether the buffer is empty, not whether point is at EOB. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 2c1ba9bb9d7..54d648f7ec0 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4970,12 +4970,20 @@ if only the first line of the docstring is shown.")) ;; can cause problems when read back, so print them ;; readably. (Bug#52554) (print-escape-control-characters t)) - (atomic-change-group - (when (eobp) - (insert ";;; -*- lexical-binding: t -*-\n")) - (custom-save-variables) - (custom-save-faces) - (custom-save-icons))) + (save-restriction + (widen) + (atomic-change-group + ;; The previous test `eobp' was written with an appalling + ;; lack of forethought or testing, being easily misled if + ;; the user should have left point at eob in a buffer + ;; visiting the custom file. + (when (eq (point-min) (point-max)) + (save-excursion + (goto-char (point-min)) + (insert ";;; -*- lexical-binding: t -*-\n"))) + (custom-save-variables) + (custom-save-faces) + (custom-save-icons)))) (let ((file-precious-flag t)) (save-buffer)) (if old-buffer commit b990c37b9adbb4cbbcd6ef652c2a1737cf80269d Author: Po Lu Date: Sat May 11 21:35:42 2024 +0800 ; More coding style fixes * src/sort.c (reverse_sortslice, tim_sort): Correct not-so egregious misformattings. diff --git a/src/sort.c b/src/sort.c index 94cea4a18db..dc9f49016aa 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1052,9 +1052,9 @@ merge_compute_minrun (ptrdiff_t n) static void reverse_sortslice (sortslice *s, const ptrdiff_t n) { - reverse_slice(s->keys, &s->keys[n]); + reverse_slice (s->keys, &s->keys[n]); if (s->values != NULL) - reverse_slice(s->values, &s->values[n]); + reverse_slice (s->values, &s->values[n]); } static Lisp_Object @@ -1161,7 +1161,7 @@ tim_sort (Lisp_Object predicate, Lisp_Object keyfunc, ms.pending[ms.n].len = n; ++ms.n; /* Advance to find the next run. */ - sortslice_advance(&lo, n); + sortslice_advance (&lo, n); nremaining -= n; } while (nremaining); commit f43f7d7a43962aae4ec1ad353eda237f5348b40c Author: Po Lu Date: Sat May 11 21:34:30 2024 +0800 ; Fix coding style in timsort.c * src/sort.c (reverse_slice, sortslice): Fix egregious coding style inconsistencies. diff --git a/src/sort.c b/src/sort.c index 02dad327cd4..94cea4a18db 100644 --- a/src/sort.c +++ b/src/sort.c @@ -36,15 +36,16 @@ along with GNU Emacs. If not, see . */ /* Reverse a slice of a vector in place, from lo up to (exclusive) hi. */ static void -reverse_slice(Lisp_Object *lo, Lisp_Object *hi) +reverse_slice (Lisp_Object *lo, Lisp_Object *hi) { - --hi; - while (lo < hi) { - Lisp_Object t = *lo; - *lo = *hi; - *hi = t; - ++lo; - --hi; + --hi; + while (lo < hi) + { + Lisp_Object t = *lo; + *lo = *hi; + *hi = t; + ++lo; + --hi; } } @@ -56,7 +57,8 @@ reverse_slice(Lisp_Object *lo, Lisp_Object *hi) Several convenience routines are provided here, so that keys and values are always moved in sync. */ -typedef struct { +typedef struct +{ Lisp_Object *keys; Lisp_Object *values; } sortslice; commit 733ff78581a7d659fee53e5bfd7cc8904a31082e Author: Eli Zaretskii Date: Sat May 11 13:54:35 2024 +0300 ; Fix byte-compilation warnings in lua-ts-mode.el * lisp/progmodes/lua-ts-mode.el (treesit-node-eq) (treesit-node-prev-sibling): Declare. diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index f15edd040cc..0568e0d273c 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -40,8 +40,10 @@ (declare-function treesit-induce-sparse-tree "treesit.c") (declare-function treesit-node-child-by-field-name "treesit.c") (declare-function treesit-node-child-count "treesit.c") +(declare-function treesit-node-eq "treesit.c") (declare-function treesit-node-first-child-for-pos "treesit.c") (declare-function treesit-node-parent "treesit.c") +(declare-function treesit-node-prev-sibling "treesit.c") (declare-function treesit-node-start "treesit.c") (declare-function treesit-node-end "treesit.c") (declare-function treesit-node-type "treesit.c") commit 48c9285c19ffa484fc5163c55eca5a9f3ef41cc7 Merge: 6380806196f 0ec9a02a0d5 Author: Eli Zaretskii Date: Sat May 11 06:50:56 2024 -0400 Merge from origin/emacs-29 0ec9a02a0d5 ; Fix doc strings of two scroll-bar functions. 2f8bccf9d8c ; * doc/emacs/frames.texi (Scroll Bars): Improve formatting. f9832e80b89 ; * lisp/textmodes/ispell.el (ispell-message): Add commen... a7d247be90c ; * etc/PROBLEMS: Document macOS problems with Emacs.clr ... 8560ee7b5ca ; * doc/misc/auth.texi (The Unix password store): Fix var... 74c6b59af15 ; Advertise scroll bars some more 3d65d4306b9 Avoid errors in 'image-dired-tag-thumbnail' commit 6380806196f3806b6c2bff60ff6cddae3eee2a19 Author: kobarity Date: Fri May 10 00:39:10 2024 +0900 Support Python 3 in 'package-test-update-archives-async' * test/lisp/emacs-lisp/package-resources/package-test-server.py: Support Python 3. * test/lisp/emacs-lisp/package-tests.el (package-test-update-archives-async): Search for an executable named "python", "python3", or "python2". (Bug#70722) Co-authored-by: Lin Sun diff --git a/test/lisp/emacs-lisp/package-resources/package-test-server.py b/test/lisp/emacs-lisp/package-resources/package-test-server.py index 128b4249ec3..16f3e391aa1 100644 --- a/test/lisp/emacs-lisp/package-resources/package-test-server.py +++ b/test/lisp/emacs-lisp/package-resources/package-test-server.py @@ -1,23 +1,19 @@ import sys -import BaseHTTPServer -from SimpleHTTPServer import SimpleHTTPRequestHandler +try: + from http.server import HTTPServer, SimpleHTTPRequestHandler +except ImportError: + from BaseHTTPServer import HTTPServer + from SimpleHTTPServer import SimpleHTTPRequestHandler -HandlerClass = SimpleHTTPRequestHandler -ServerClass = BaseHTTPServer.HTTPServer -Protocol = "HTTP/1.0" - -if sys.argv[1:]: - port = int(sys.argv[1]) -else: - port = 0 -server_address = ('127.0.0.1', port) -HandlerClass.protocol_version = Protocol -httpd = ServerClass(server_address, HandlerClass) +HandlerClass = SimpleHTTPRequestHandler +HandlerClass.protocol_version = "HTTP/1.0" +server_address = ("127.0.0.1", int(sys.argv[1]) if sys.argv[1:] else 0) +httpd = HTTPServer(server_address, HandlerClass) ip, port = httpd.socket.getsockname()[0:2] -print ("Server started, http://%s:%s/" % (ip, port)) +print("Server started, http://%s:%s/" % (ip, port)) # Flush in case we're in full buffering mode (instead of line # buffering), this might happen if python is a cygwin program and we # run it from a native w32 program. diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index d95b94f2145..692d6550250 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -634,14 +634,15 @@ but with a different end of line convention (bug#48137)." (ert-deftest package-test-update-archives-async () "Test updating package archives asynchronously." :tags '(:expensive-test) - (skip-unless (executable-find "python2")) (let* ((package-menu-async t) (default-directory package-test-data-dir) - (process (start-process + (python-interpreter (seq-some #'executable-find '("python" "python3" "python2"))) + process addr) + (skip-unless python-interpreter) + (setq process (start-process "package-server" "package-server-buffer" - (executable-find "python2") + python-interpreter "package-test-server.py")) - (addr nil)) (unwind-protect (progn (with-current-buffer "package-server-buffer" commit 5fdc6d835710512921cb46cd8ef55bd0052c4e01 Author: Eli Zaretskii Date: Sat May 11 12:16:48 2024 +0300 Fix Rmail summary by thread * lisp/mail/rmailsum.el (rmail-summary-by-thread): Use value of 'rmail-total-messages' local to 'rmail-buffer'. Patch by Andrea Monaco . diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 48c5cb70b33..d2dcedce93e 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -437,7 +437,9 @@ headers of the messages." (= (length rmail-summary-message-parents-vector) (1+ rmail-total-messages))) (rmail-summary-fill-message-parents-and-descs-vectors))) - (let ((enc-msgs (make-bool-vector (1+ rmail-total-messages) nil))) + (let ((enc-msgs + (with-current-buffer rmail-buffer + (make-bool-vector (1+ rmail-total-messages) nil)))) (rmail-summary--walk-thread-message-recursively msgnum enc-msgs) (rmail-new-summary (format "thread containing message %d" msgnum) (list 'rmail-summary-by-thread msgnum) commit 3eca0bc307f02592a509d8c243a6c9ee9b8dea61 Author: Eli Zaretskii Date: Sat May 11 11:17:34 2024 +0300 ; * lisp/net/dictionary.el (dictionary-default-strategy): Doc fix. diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 313e825b4d8..9fb8b8ffaed 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -115,7 +115,15 @@ via `dictionary-dictionaries'." (defcustom dictionary-default-strategy "." - "The default strategy for listing matching words." + "The default strategy for listing matching words. +The value should be a string. The special value \".\" means +the default search strategy for `dictionary-server' in use. +Other values are specific to servers and dictionaries. +In a `dictionary-mode' buffer, you can use +\\[dictionary-select-strategy] to change the buffer-local value; +it will show the available strategies from which you can choose. +To change the value for other buffers, customize this option +using \\[customize-option]." :group 'dictionary :type 'string :version "28.1") commit b43c31d2f50dc71680dfd62412ce9b9afb6c65a4 Author: Michael Albinus Date: Sat May 11 10:03:45 2024 +0200 New Tramp method "run0" * doc/misc/tramp.texi (Quick Start Guide, Inline methods) (Password handling, Predefined connection information) (Ad-hoc multi-hops): Add "run0". (Remote processes): Mention tramp-use-connection-share. * etc/NEWS: New Tramp method "run0". * lisp/net/tramp.el (tramp-completion-dissect-file-name): * lisp/net/tramp-cmds.el (tramp-list-remote-buffers): * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Use `tramp-compat-keep-seq'. * lisp/net/tramp-cmds.el (tramp-file-name-with-method): Add "run0". * lisp/net/tramp-sh.el (tramp-enable-run0-method): New defun. (tramp-sh-handle-expand-file-name): Add "run0". (tramp-maybe-open-connection): Simplify setting timeout. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 2b0a982e7f9..6c36429fb79 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -489,14 +489,16 @@ an @command{ssh} server: @file{@trampfn{plink,user@@host,/path/to/file}}. -@anchor{Quick Start Guide su, sudo, doas, androidsu and sg methods} -@section Using @option{su}, @option{sudo}, @option{doas}, @option{androidsu} and @option{sg} +@anchor{Quick Start Guide su, sudo, doas, run0, androidsu and sg methods} +@section Using @option{su}, @option{sudo}, @option{doas}, @option{run0}, @option{androidsu} and @option{sg} @cindex method @option{su} @cindex @option{su} method @cindex method @option{sudo} @cindex @option{sudo} method @cindex method @option{doas} @cindex @option{doas} method +@cindex method @option{run0} +@cindex @option{run0} method @cindex method @option{androidsu} @cindex @option{androidsu} method @cindex method @option{sg} @@ -504,9 +506,11 @@ an @command{ssh} server: Sometimes, it is necessary to work on your local host under different permissions. For this, you can use the @option{su} or @option{sudo} -connection method. On OpenBSD systems, the @option{doas} connection -method offers the same functionality. If your local system is -Android, use the method @option{androidsu} instead of @option{su}. +connection method. If your system is @code{systemd}-based, there is +the @option{run0} connection method. On OpenBSD systems, the +@option{doas} connection method offers the same functionality. If +your local system is Android, use the method @option{androidsu} +instead of @option{su}. These methods use @samp{root} as default user name and the return value of @code{(system-name)} as default host name. Therefore, it is @@ -516,8 +520,8 @@ The method @option{sg} stands for ``switch group''; here the user name is used as the group to change to. The default host name is the same. -@anchor{Quick Start Guide Combining ssh, plink, su, sudo and doas methods} -@section Combining @option{ssh} or @option{plink} with @option{su}, @option{sudo} or @option{doas} +@anchor{Quick Start Guide Combining ssh, plink, su, sudo, doas and run0 methods} +@section Combining @option{ssh} or @option{plink} with @option{su}, @option{sudo}, @option{doas} or @option{run0} @cindex method @option{ssh} @cindex @option{ssh} method @cindex method @option{plink} @@ -528,13 +532,15 @@ is used as the group to change to. The default host name is the same. @cindex @option{sudo} method @cindex method @option{doas} @cindex @option{doas} method - -If the @option{su}, @option{sudo} or @option{doas} option should be -performed on another host, it can be combined with a leading -@option{ssh} or @option{plink} option. That means that @value{tramp} -connects first to the other host with non-administrative credentials, -and changes to administrative credentials on that host afterwards. In -a simple case, the syntax looks like +@cindex method @option{run0} +@cindex @option{run0} method + +If the @option{su}, @option{sudo}, @option{doas} or @option{run0} +method should be performed on another host, it can be combined with a +leading @option{ssh} or @option{plink} method. That means that +@value{tramp} connects first to the other host with non-administrative +credentials, and changes to administrative credentials on that host +afterwards. In a simple case, the syntax looks like @file{@trampfn{ssh@value{postfixhop}user@@host|sudo,,/path/to/file}}. @xref{Ad-hoc multi-hops}. @@ -882,6 +888,16 @@ This method is used on OpenBSD like the @command{sudo} command. Like the @option{sudo} method, a @option{doas} connection is disabled after a predefined timeout. +@item @option{run0} +@cindex method @option{run0} +@cindex @option{run0} method + +This method is used on @code{systemd}-based hosts. Internally, it +uses the @code{systemd-run} command. A @option{run0} connection is +disabled after a predefined timeout as well. + +This is an optional method, @ref{Optional methods}. + @item @option{sg} @cindex method @option{sg} @cindex @option{sg} method @@ -2104,8 +2120,9 @@ machine melancholia#4711 port davs login daniel%BIZARRE password geheim For the methods @option{doas}, @option{sudo} and @option{sudoedit} the password of the user requesting the connection is needed, and not the -password of the target user. If these connections happen on the local -host, an entry with the local user and local host is used: +password of the target user@footnote{On the local host, @code{run0} +uses a graphical password agent.}. If these connections happen on the +local host, an entry with the local user and local host is used: @example machine @var{host} port sudo login @var{user} password secret @@ -2278,8 +2295,8 @@ All @file{tramp-sh.el} based methods accept the property @t{"session-timeout"}. This is the time (in seconds) after a connection is disabled for security reasons, and must be reestablished. A value of @code{nil} disables this feature. Most of -the methods do not set this property except the @option{sudo} and -@option{doas} methods, which use predefined values. +the methods do not set this property except the @option{sudo}, +@option{doas} and @option{run0} methods, which use predefined values. @item @t{"~"}@* @t{"~user"} @@ -3815,7 +3832,7 @@ The buffer must either visit a file, or a directory @defopt tramp-file-name-with-method The method @code{tramp-revert-buffer-with-sudo} shows an alternate buffer. It defaults to @code{sudo}, other valid methods are -@code{su}, @code{doas}, and @code{ksu}. +@code{su}, @code{doas}, @code{run0}, and @code{ksu}. @lisp (customize-set-variable 'tramp-file-name-with-method "doas") @@ -4056,7 +4073,9 @@ here will not work as expected. @vindex ForwardX11Trusted@r{, ssh option} An alternate approach is specify @option{ForwardX11 yes} or @option{ForwardX11Trusted yes} in @file{~/.ssh/config} on the local -host. +host. Furthermore, set @code{tramp-use-connection-share} to +@code{nil} (@pxref{Using ssh connection sharing}), in order to avoid +unwanted side effects. @subsection Running @code{shell} on a remote host diff --git a/etc/NEWS b/etc/NEWS index bd68cd6d751..846bf759995 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1069,6 +1069,11 @@ This provides access to system files with elevated privileges granted by the idiosyncratic 'su' implementations and system utilities customary on Android. ++++ +*** New optional connection method "run0". +This connection method is similar to "sudo", but it uses the +'systemd-run' program internally. + +++ *** New connection methods "dockercp" and "podmancp". These are the external methods counterparts of "docker" and "podman". diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index f381c2e9ff0..6cd856c10e5 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -70,12 +70,10 @@ SYNTAX can be one of the symbols `default' (default), ;;;###tramp-autoload (defun tramp-list-remote-buffers () "Return a list of all buffers with remote `default-directory'." - (delq - nil - (mapcar - (lambda (x) - (when (tramp-tramp-file-p (tramp-get-default-directory x)) x)) - (buffer-list)))) + (tramp-compat-seq-keep + (lambda (x) + (when (tramp-tramp-file-p (tramp-get-default-directory x)) x)) + (buffer-list))) ;;; Cleanup @@ -567,6 +565,7 @@ For details, see `tramp-rename-files'." :type '(choice (const "su") (const "sudo") (const "doas") + (const "run0") (const "ksu"))) (defun tramp-file-name-with-sudo (filename) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 408e1611632..b79b55ee2cc 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -501,6 +501,24 @@ The string is used in `tramp-methods'.") (tramp-set-completion-function "nc" tramp-completion-function-alist-telnet)) +;;;###tramp-autoload +(defun tramp-enable-run0-method () + "Enable \"run0\" method." + (add-to-list 'tramp-methods + `("run0" + (tramp-login-program "systemd-run") + (tramp-login-args (("--uid" "%u") ("-t") ("%l"))) + (tramp-remote-shell ,tramp-default-remote-shell) + (tramp-remote-shell-args ("-c")) + (tramp-connection-timeout 10) + (tramp-session-timeout 300) + (tramp-password-previous-hop t))) + + (add-to-list 'tramp-default-user-alist + `(,(rx bos "run0" eos) nil ,tramp-root-id-string)) + + (tramp-set-completion-function "run0" tramp-completion-function-alist-su)) + ;;;###tramp-autoload (defun tramp-enable-ksu-method () "Enable \"ksu\" method." @@ -2902,7 +2920,7 @@ the result will be a local, non-Tramp, file name." ;; use a user name from the config file. (when (and (tramp-string-empty-or-nil-p uname) (string-match-p - (rx bos (| "su" "sudo" "doas" "ksu") eos) method)) + (rx bos (| "su" "sudo" "doas" "run0" "ksu") eos) method)) (setq uname user)) (when (setq hname (tramp-get-home-directory v uname)) (setq localname (concat hname fname))))) @@ -5377,12 +5395,11 @@ connection if a previous connection has died for some reason." :host l-host :port l-port))) ;; Set session timeout. - (when (tramp-get-method-parameter - hop 'tramp-session-timeout) + (when-let ((timeout + (tramp-get-method-parameter + hop 'tramp-session-timeout))) (tramp-set-connection-property - p "session-timeout" - (tramp-get-method-parameter - hop 'tramp-session-timeout))) + p "session-timeout" timeout)) ;; Replace `login-args' place holders. (setq diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 3616cad2fb3..a51b2b904ec 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1068,17 +1068,15 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; Filter entries. (setq entries - (delq - nil (if (or wildcard (string-empty-p base)) ;; Check for matching entries. - (mapcar + (tramp-compat-seq-keep (lambda (x) (when (string-match-p (rx bol (literal base)) (nth 0 x)) x)) entries) ;; We just need the only and only entry FILENAME. - (list (assoc base entries))))) + (list (assoc base entries)))) ;; Sort entries. (setq entries diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index f92a7ff14d4..02a493f0a78 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2978,17 +2978,15 @@ They are collected by `tramp-completion-dissect-file-name1'." (regexp tramp-prefix-ipv6-regexp) (group (? (regexp tramp-ipv6-regexp))) eol) 1 2 3 nil))) - (delq - nil - (mapcar - (lambda (structure) (tramp-completion-dissect-file-name1 structure name)) - (list - tramp-completion-file-name-structure1 - tramp-completion-file-name-structure2 - tramp-completion-file-name-structure3 - tramp-completion-file-name-structure4 - tramp-completion-file-name-structure5 - tramp-completion-file-name-structure6))))) + (tramp-compat-seq-keep + (lambda (structure) (tramp-completion-dissect-file-name1 structure name)) + (list + tramp-completion-file-name-structure1 + tramp-completion-file-name-structure2 + tramp-completion-file-name-structure3 + tramp-completion-file-name-structure4 + tramp-completion-file-name-structure5 + tramp-completion-file-name-structure6)))) (defun tramp-completion-dissect-file-name1 (structure name) "Return a `tramp-file-name' structure for NAME matching STRUCTURE. @@ -4777,10 +4775,10 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.") vec "Method `%s' is not supported for multi-hops" (tramp-file-name-method item))))) - ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the - ;; host name in their command template. In this case, the remote - ;; file name must use either a local host name (first hop), or a - ;; host name matching the previous hop. + ;; Some methods ("su", "sg", "sudo", "doas", "run0", "ksu") do not + ;; use the host name in their command template. In this case, the + ;; remote file name must use either a local host name (first hop), + ;; or a host name matching the previous hop. (let ((previous-host (or tramp-local-host-regexp ""))) (setq choices target-alist) (while (setq item (pop choices)) commit 0ec9a02a0d5da108ccefe32dd37b066bae357334 (refs/remotes/origin/emacs-29) Author: Eli Zaretskii Date: Sat May 11 08:29:22 2024 +0300 ; Fix doc strings of two scroll-bar functions. * lisp/scroll-bar.el (toggle-horizontal-scroll-bar): Fix typo and wording. (Bug#70864). (toggle-scroll-bar): Fix wording. diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 1358bff6da8..01e47ccebbe 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -172,7 +172,7 @@ created in the future." (defun toggle-scroll-bar (arg) "Toggle whether or not the selected frame has vertical scroll bars. -With ARG, turn vertical scroll bars on if and only if ARG is positive. +With ARG, turn on vertical scroll bars if and only if ARG is positive. The variable `scroll-bar-mode' controls which side the scroll bars are on when they are turned on; if it is nil, they go on the left." (interactive "P") @@ -188,7 +188,7 @@ when they are turned on; if it is nil, they go on the left." (defun toggle-horizontal-scroll-bar (arg) "Toggle whether or not the selected frame has horizontal scroll bars. -With ARG, turn vertical scroll bars on if and only if ARG is positive." +With ARG, turn on horizontal scroll bars if and only if ARG is positive." (interactive "P") (if (null arg) (setq arg commit 2f8bccf9d8c39c08b1a9c85db93d2af8eda988b8 Author: Eli Zaretskii Date: Fri May 10 08:52:33 2024 +0300 ; * doc/emacs/frames.texi (Scroll Bars): Improve formatting. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 9471e99c8e5..bced5e89b78 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1146,11 +1146,11 @@ text or moving point with a keyboard command will usually bring it back into view. @findex horizontal-scroll-bar-mode - To toggle the use of horizontal scroll bars, type @kbd{M-x -horizontal-scroll-bar-mode}. This command applies to all frames, + To toggle the use of horizontal scroll bars, type @w{@kbd{M-x +horizontal-scroll-bar-mode}}. This command applies to all frames, including frames yet to be created. To toggle horizontal scroll bars -for just the selected frame, use the command @kbd{M-x -toggle-horizontal-scroll-bar}. +for just the selected frame, use the command @w{@kbd{M-x +toggle-horizontal-scroll-bar}}. @vindex horizontal-scroll-bar-mode To control the use of horizontal scroll bars at startup, customize the commit f9832e80b89d45c283c80e89471a8687df145821 Author: Eli Zaretskii Date: Thu May 9 20:44:52 2024 +0300 ; * lisp/textmodes/ispell.el (ispell-message): Add commentary. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 08a7b816de3..d66c13625bd 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -4038,6 +4038,10 @@ You can bind this to the key C-c i in GNUS or mail by adding to (if (re-search-forward "^Subject: *" end-of-headers t) (progn (goto-char (match-end 0)) + ;; Don't spell-check Subject if it comes from a + ;; received message: "Re:" indicates this is a reply + ;; to someone else's message, "[...]" indicates this + ;; is a subject of a forwarded message. (if (and (not (looking-at ".*\\")) (not (looking-at "\\["))) (progn commit a7d247be90c6030a0ffebc2d8280206128b0e87c Author: Eli Zaretskii Date: Thu May 9 09:05:22 2024 +0300 ; * etc/PROBLEMS: Document macOS problems with Emacs.clr (bug#70836). diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 2b3b7ba96f6..90d416714e5 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3382,7 +3382,7 @@ for further discussion. * Runtime problems specific to macOS -** Error message when opening Emacs on macOS +** Error message about malicious software when opening Emacs on macOS When opening Emacs, you may see an error message saying something like this: @@ -3399,6 +3399,22 @@ the Emacs app icon, and then choose Open. This adds a security exception for Emacs and from now on you should be able to open it by double-clicking on its icon, like any other app. +** Error message about color list unarchiver when starting Emacs on macOS + +The error message looks like this: + + Failed to initialize color list unarchiver: + Error Domain=NSCocoaErrorDomain Code=4864 "*** -[NSKeyedUnarchiver + _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver" + UserInfo={NSDebugDescription=*** -[NSKeyedUnarchiver + _initForReadingFromData:error:throwLegacyExceptions:]: non-keyed archive cannot be decoded by NSKeyedUnarchiver} + +After showing this message, Emacs usually works normally. + +The usual reason for this is that the color file, +~/Library/Colors/Emacs.clr, is stale or corrupted. The solution is to +delete that file and restart Emacs. + ** macOS doesn't come with libxpm, so only XPM3 is supported. Libxpm is available for macOS as part of the XQuartz project. commit 8560ee7b5ca94ff35868adbf4f435f1bcf358566 Author: Illia Ostapyshyn Date: Fri May 3 19:27:15 2024 +0200 ; * doc/misc/auth.texi (The Unix password store): Fix variable name. (Bug#70767) Copyright-paperwork-exempt: yes diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index f51a1446170..8d802be535c 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -527,7 +527,7 @@ while searching for an entry matching the @code{rms} user on host @code{gnu.org} and port @code{22}, then the entry @file{gnu.org:22/rms.gpg} is preferred over @file{gnu.org.gpg}. However, such processing is not applied when the option -@code{auth-source-pass-extra-parameters} is set to @code{t}. +@code{auth-source-pass-extra-query-keywords} is set to @code{t}. Users of @code{pass} may also be interested in functionality provided by other Emacs packages: commit 74c6b59af15d7e7f7456eff3620619a1b2e82c51 Author: Eli Zaretskii Date: Wed May 8 16:44:05 2024 +0300 ; Advertise scroll bars some more * doc/emacs/display.texi (Scrolling, Horizontal Scrolling): Mention the scroll bars as alternative means of scrolling. diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 6db9e8344c6..9ca5888bd5d 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -175,6 +175,9 @@ scroll the current window by one line at a time. If you intend to use any of these commands, you might want to give them key bindings (@pxref{Init Rebinding}). + On graphical displays, you can also scroll a window using the scroll +bar; @pxref{Scroll Bars}. + @node Recentering @section Recentering @@ -405,6 +408,10 @@ than the amount you previously set by @code{scroll-left}. When other than the one showing the cursor will be scrolled by that minimal amount. + On graphical displays, you can scroll a window horizontally using +the horizontal scroll bar, if you turn on the optional +@code{horizontal-scroll-bar-mode}; @pxref{Scroll Bars}. + @node Narrowing @section Narrowing @cindex widening commit 3d65d4306b98efba59ffabe86d8c99e6f37cd8d2 Author: Eli Zaretskii Date: Wed May 8 16:13:27 2024 +0300 Avoid errors in 'image-dired-tag-thumbnail' * lisp/image/image-dired.el (image-dired-tag-thumbnail) (image-dired-tag-thumbnail-remove): Move here from image-dired-tags.el. (Bug#70821) diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.el index 2b5248cb14b..54595adc147 100644 --- a/lisp/image/image-dired-tags.el +++ b/lisp/image/image-dired-tags.el @@ -32,8 +32,6 @@ (require 'image-dired-util) -(declare-function image-dired--with-marked "image-dired") - (defvar image-dired-dir) (defvar image-dired-thumbnail-storage) (defvar image-dired-tags-db-file) @@ -156,18 +154,6 @@ With prefix ARG, tag the file at point." (cons x tag)) files)))) -(defun image-dired-tag-thumbnail () - "Tag current or marked thumbnails." - (interactive nil image-dired-thumbnail-mode) - (let ((tag (completing-read - "Tags to add (separate tags with a semicolon): " - image-dired-tag-history nil nil nil 'image-dired-tag-history))) - (image-dired--with-marked - (image-dired-write-tags - (list (cons (image-dired-original-file-name) tag))) - (image-dired-update-property - 'tags (image-dired-list-tags (image-dired-original-file-name)))))) - ;;;###autoload (defun image-dired-delete-tag (arg) "Remove tag for selected file(s). @@ -181,16 +167,6 @@ With prefix argument ARG, remove tag from file at point." (setq files (dired-get-marked-files))) (image-dired-remove-tag files tag))) -(defun image-dired-tag-thumbnail-remove () - "Remove tag from current or marked thumbnails." - (interactive nil image-dired-thumbnail-mode) - (let ((tag (completing-read "Tag to remove: " image-dired-tag-history - nil nil nil 'image-dired-tag-history))) - (image-dired--with-marked - (image-dired-remove-tag (image-dired-original-file-name) tag) - (image-dired-update-property - 'tags (image-dired-list-tags (image-dired-original-file-name)))))) - (defun image-dired-write-comments (file-comments) "Write file comments specified by FILE-COMMENTS comments to database. FILE-COMMENTS is an alist on the following form: diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 26d5811f159..00dc8e31d29 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -1714,6 +1714,28 @@ Dired." (cons (list tag file) (cdr image-dired-tag-file-list)))) (setq image-dired-tag-file-list (list (list tag file)))))) +(defun image-dired-tag-thumbnail-remove () + "Remove tag from current or marked thumbnails." + (interactive nil image-dired-thumbnail-mode) + (let ((tag (completing-read "Tag to remove: " image-dired-tag-history + nil nil nil 'image-dired-tag-history))) + (image-dired--with-marked + (image-dired-remove-tag (image-dired-original-file-name) tag) + (image-dired-update-property + 'tags (image-dired-list-tags (image-dired-original-file-name)))))) + +(defun image-dired-tag-thumbnail () + "Tag current or marked thumbnails." + (interactive nil image-dired-thumbnail-mode) + (let ((tag (completing-read + "Tags to add (separate tags with a semicolon): " + image-dired-tag-history nil nil nil 'image-dired-tag-history))) + (image-dired--with-marked + (image-dired-write-tags + (list (cons (image-dired-original-file-name) tag))) + (image-dired-update-property + 'tags (image-dired-list-tags (image-dired-original-file-name)))))) + (defvar image-dired-slideshow-count 0 "Keeping track on number of images in slideshow.") (make-obsolete-variable 'image-dired-slideshow-count "no longer used." "29.1")