commit eace68a325b96d12188ea8d673f30bad1354b916 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Wed Sep 18 10:08:26 2024 +0800 Fix layout of preferences activity on Android 35 * java/org/gnu/emacs/EmacsPreferencesActivity.java (onCreate): Align list view to system windows. diff --git a/java/org/gnu/emacs/EmacsPreferencesActivity.java b/java/org/gnu/emacs/EmacsPreferencesActivity.java index a3edd6388b4..128d0b22658 100644 --- a/java/org/gnu/emacs/EmacsPreferencesActivity.java +++ b/java/org/gnu/emacs/EmacsPreferencesActivity.java @@ -28,6 +28,8 @@ import android.os.Bundle; import android.os.Build; +import android.view.View; + import android.widget.Toast; import android.preference.*; @@ -115,6 +117,7 @@ public class EmacsPreferencesActivity extends PreferenceActivity { Preference tem; Preference.OnPreferenceClickListener listener; + View view; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) setTheme (android.R.style.Theme_DeviceDefault_Settings); @@ -167,5 +170,13 @@ else if (Build.VERSION.SDK_INT }; tem.setOnPreferenceClickListener (listener); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) + { + /* Align the list view to system windows, or they will be + obstructed by the title bar. */ + view = this.getListView (); + view.setFitsSystemWindows (true); + } } }; commit 50deb59aaee2a8d773e95a53c91da7bdb2c5cabd Author: F. Jason Park Date: Mon Feb 14 02:36:57 2022 -0800 Only conditionally resolve hosts in nsm-should-check Libraries like `socks' need to run `nsm-verify-connection' without performing DNS lookups. This change allows them to achieve this by binding `nsm-trust-local-network' to nil around calls to that function. * lisp/net/nsm.el (nsm-should-check): Rework in a functionally equivalent way, except forgo calling both `network-lookup-address-info' and `network-interface-list' unless the various conditions regarding `nsm-trust-local-network' are first satisfied. Replace `mapc' with `dolist' to align with modern sensibilities. (Bug#53941) diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index e8fdb9b183b..1ce2ff33ae6 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -226,27 +226,18 @@ If `nsm-trust-local-network' is or returns non-nil, and if the host address is a localhost address, or in the same subnet as one of the local interfaces, this function returns nil. Non-nil otherwise." - (let ((addresses (network-lookup-address-info host)) - (network-interface-list (network-interface-list t)) - (off-net t)) - (when - (or (and (functionp nsm-trust-local-network) - (funcall nsm-trust-local-network)) - nsm-trust-local-network) - (mapc - (lambda (ip) - (mapc - (lambda (info) - (let ((local-ip (nth 1 info)) - (mask (nth 3 info))) - (when - (nsm-network-same-subnet (substring local-ip 0 -1) - (substring mask 0 -1) - (substring ip 0 -1)) - (setq off-net nil)))) - network-interface-list)) - addresses)) - off-net)) + (not (and-let* (((or (and (functionp nsm-trust-local-network) + (funcall nsm-trust-local-network)) + nsm-trust-local-network)) + (addresses (network-lookup-address-info host)) + (network-interface-list (network-interface-list t))) + (catch 'nsm-should-check + (dolist (ip addresses) + (dolist (info network-interface-list) + (when (nsm-network-same-subnet (substring (nth 1 info) 0 -1) + (substring (nth 3 info) 0 -1) + (substring ip 0 -1)) + (throw 'nsm-should-check t)))))))) (defun nsm-check-tls-connection (process host port status settings) "Check TLS connection against potential security problems. commit 865b54e2acea4fdaa3f302ed225f50281b371d6e Author: Paul Eggert Date: Tue Sep 17 16:54:17 2024 -0700 Use c-ctype.h in lib-src This fixes some unlikely bugs and removes the temptation of using ctype.h. Although some uses were correct, many weren't. * lib-src/ebrowse.c: Include c-ctype.h, not ctype.h. * lib-src/emacsclient.c: Include c-ctype.h, not ctype.h. * lib-src/update-game-score.c: Include c-ctype.h, not ctype.h. All uses changed. diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 821c29272a4..13c1befdc3e 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -22,11 +22,11 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include #include +#include #include #include #include @@ -1875,7 +1875,7 @@ yylex (void) int_suffixes: /* Integer suffixes. */ - while (isalpha (c)) + while (c_isalpha (c)) GET (c); UNGET (); return CINT; @@ -1907,7 +1907,7 @@ yylex (void) } /* Optional type suffixes. */ - while (isalpha (c)) + while (c_isalpha (c)) GET (c); UNGET (); return CFLOAT; @@ -2158,7 +2158,7 @@ init_scanner (void) /* Set up character class vectors. */ for (i = 0; i < sizeof is_ident; ++i) { - if (i == '_' || isalnum (i)) + if (i == '_' || c_isalnum (i)) is_ident[i] = 1; if (i >= '0' && i <= '9') @@ -2946,7 +2946,7 @@ operator_name (int *sc) MATCH (); /* If this is a simple operator like `+', stop now. */ - if (!isalpha ((unsigned char) *s) && *s != '(' && *s != '[') + if (!c_isalpha (*s) && *s != '(' && *s != '[') break; ++tokens_matched; diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 8e64f1e92d3..c1ffa1480ec 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -68,7 +68,6 @@ char *w32_getenv (const char *); #define DEFAULT_TIMEOUT (30) -#include #include #include #include @@ -83,6 +82,7 @@ char *w32_getenv (const char *); #include #include +#include #include #include #include @@ -2124,7 +2124,7 @@ main (int argc, char **argv) unsigned char c; do c = *++p; - while (isdigit (c) || c == ':'); + while (c_isdigit (c) || c == ':'); if (c == 0) { @@ -2136,7 +2136,7 @@ main (int argc, char **argv) } #ifdef WINDOWSNT else if (! IS_ABSOLUTE_FILE_NAME (argv[i]) - && (isalpha (argv[i][0]) && argv[i][1] == ':')) + && (c_isalpha (argv[i][0]) && argv[i][1] == ':')) /* Windows can have a different default directory for each drive, so the cwd passed via "-dir" is not sufficient to account for that. diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index e3b24ad7717..7545d0390c1 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -41,11 +41,11 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include #include +#include #include #ifdef WINDOWSNT @@ -143,7 +143,7 @@ normalize_integer (char *num) { bool neg; char *p; - while (*num != '\n' && isspace (*num)) + while (*num != '\n' && c_isspace (*num)) num++; neg = *num == '-'; num += neg || *num == '-'; commit e0b027d1215ed32fe0f3d0956d2d7a81552274f2 Author: Paul Eggert Date: Tue Sep 17 16:38:53 2024 -0700 Fix some #! misparsing in check_interpreter * exec/exec.c: Do not include ctype.h, as the kernel does not care about the locale. (check_interpreter): Treat only spaces and tabs as white space. Do not inspect more bytes than were read. Although the resulting code does not exactly match what the Android kernel does, it’s closer than what it was before. diff --git a/exec/exec.c b/exec/exec.c index 775a8b06b96..f31c9a89744 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -24,7 +24,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include @@ -116,11 +115,11 @@ check_interpreter (const char *name, int fd, const char **extra) /* Strip leading whitespace. */ start = buffer; - while (*start && ((unsigned char) *start) < 128 && isspace (*start)) + while (start < buffer + rc && (*start == ' ' || *start == '\t')) ++start; /* Look for a newline character. */ - end = memchr (start, '\n', rc); + end = memchr (start, '\n', buffer + rc - start); if (!end) goto fail; @@ -130,11 +129,12 @@ check_interpreter (const char *name, int fd, const char **extra) *end = '\0'; /* Now look for any whitespace characters. */ - ws = strchr (start, ' '); + for (ws = start; *ws && *ws != ' ' && *ws != '\t'; ws++) + continue; /* If there's no whitespace, return the entire start. */ - if (!ws) + if (!*ws) { if (lseek (fd, 0, SEEK_SET)) goto fail; commit 58a44b6ac317c9a17bcdd208e4ec33ff9772429e Author: Paul Eggert Date: Tue Sep 17 15:23:47 2024 -0700 Fix misuse of toupper in sfnt_parse_style * src/sfntfont.c: Include c-ctype.h, not ctype.h. (sfnt_parse_style): Upcase just initial ASCII letters; that’s good enough here. diff --git a/src/sfntfont.c b/src/sfntfont.c index 8c02c05e7a6..f21b6c0782f 100644 --- a/src/sfntfont.c +++ b/src/sfntfont.c @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include +#include #include "lisp.h" @@ -534,12 +534,12 @@ sfnt_parse_style (Lisp_Object style_name, struct sfnt_font_desc *desc) } /* This token is extraneous or was not recognized. Capitalize - the first letter and set it as the adstyle. */ + the first letter if it's ASCII lowercase, then set the token as + the adstyle. */ if (strlen (single)) { - if (islower (single[0])) - single[0] = toupper (single[0]); + single[0] = c_toupper (single[0]); if (NILP (desc->adstyle)) desc->adstyle = build_string (single); commit 43cde03fa5a663a1509a762077c11eb57a60cee8 Author: Paul Eggert Date: Tue Sep 17 15:22:02 2024 -0700 Fix yes-or-no-p with multibyte spaces Problem reported by Thomas Klausner (Bug#73307). Emacs shouldn’t use ctype.h, as it doesn’t work for multibyte chars and it doesn’t work with Emacs’s locale model anyway. * src/fns.c: Include syntax.h, not ctype.h. (Fyes_or_no_p): Check the character category with SYNTAX, not with isspace, which assumes the current locale and works only with single-byte characters. diff --git a/src/fns.c b/src/fns.c index 57113a8c5ed..370f7711b90 100644 --- a/src/fns.c +++ b/src/fns.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include "lisp.h" @@ -36,6 +35,7 @@ along with GNU Emacs. If not, see . */ #include "composite.h" #include "buffer.h" #include "intervals.h" +#include "syntax.h" #include "window.h" #include "puresize.h" #include "gnutls.h" @@ -3576,13 +3576,15 @@ by a mouse, or by some window-system gesture, or via a menu. */) if (use_short_answers) return call1 (Qy_or_n_p, prompt); - { - char *s = SSDATA (prompt); - ptrdiff_t len = strlen (s); - if ((len > 0) && !isspace (s[len - 1])) - prompt = CALLN (Fconcat, prompt, build_string (" ")); - } - prompt = CALLN (Fconcat, prompt, Vyes_or_no_prompt); + ptrdiff_t promptlen = SCHARS (prompt); + bool prompt_ends_in_nonspace + = (0 < promptlen + && (SYNTAX (XFIXNAT (Faref (prompt, make_fixnum (promptlen - 1)))) + != Swhitespace)); + AUTO_STRING (space_string, " "); + prompt = CALLN (Fconcat, prompt, + prompt_ends_in_nonspace ? space_string : empty_unibyte_string, + Vyes_or_no_prompt); specpdl_ref count = SPECPDL_INDEX (); specbind (Qenable_recursive_minibuffers, Qt); commit f1794a17b629f8ad2a85dbf9877e17dcdd9b9ee7 Author: Eshel Yaron Date: Tue Sep 17 20:26:23 2024 +0200 New user option 'completion-preview-ignore-case' Completion Preview mode implicitly assumed that 'completion-ignore-case' is nil, and while it can also work with 'completion-ignore-case' non-nil, the results are a bit different than what you get with 'completion-at-point'. Add an option that controls case sensitivity explicitly and specifically for Completion Preview mode, and clarify the behavior when case differences are ignored. (Bug#73234) * lisp/completion-preview.el (completion-preview-ignore-case): New user option. diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index fd55a1009f6..d379b3a1fa6 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -173,6 +173,24 @@ If this is nil, display the completion preview without delay." (const :tag "No delay" nil)) :version "30.1") +(defcustom completion-preview-ignore-case nil + "Whether Completion Preview mode ignores case differences. + +By default this option is nil, which says that case is significant, so a +completion candidate \"FooBar\" matches prefix \"Foo\", but not \"foo\". +If you set it to non-nil, then Completion Preview mode also suggests +completions that differ in case from the prefix that you type; for +example, it may suggest completing \"foo\" with the suffix \"Bar\" when +there's an available completion candidate \"FooBar\". Note that in this +case, when you insert the completion (with `completion-preview-insert'), +Completion Preview mode does not update the completed prefix according +to the capitalization of the completion candidate, instead it simply +ignores such case differences, so the resulting string is \"fooBar\". + +See also `completion-ignore-case'." + :type 'boolean + :version "31.1") + (defvar completion-preview-sort-function #'minibuffer--sort-by-length-alpha "Sort function to use for choosing a completion candidate to preview.") @@ -345,6 +363,7 @@ candidates or if there are multiple matching completions and ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (let* ((pred (plist-get props :predicate)) (string (buffer-substring beg end)) + (completion-ignore-case completion-preview-ignore-case) (md (completion-metadata string table pred)) (sort-fn (or (completion-metadata-get md 'cycle-sort-function) (completion-metadata-get md 'display-sort-function) commit 7d365a2d72d8e656262205827cc5fdf423c3a41f Author: Robert Pluim Date: Tue Sep 17 15:19:01 2024 +0200 Fix idna-mapping-table following Unicode 16 changes The latest version of UTS #46 in Unicode 16 has changed the way it indicates which codepoints are invalid in domain names, causing 'idna-mapping-table' to contain incorrect information, which then breaks 'textsec-domain-suspicious-p' and our test suite. (Bug#73312) * admin/unidata/unidata-gen.el (unidata-gen-idna-mapping): Check the IDNA validity field in "IdnaMappingTable.txt" in addition to checking the status field, as the latter can now be 'valid' for disallowed codepoints. diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index 7be03fe63af..71ea7bddb84 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el @@ -1598,15 +1598,21 @@ same directory.")) (let ((map (make-char-table nil))) (with-temp-buffer (unidata-gen--insert-file "IdnaMappingTable.txt") - (while (re-search-forward "^\\([0-9A-F]+\\)\\(?:\\.\\.\\([0-9A-F]+\\)\\)? +; +\\([^ ]+\\) +\\(?:; +\\([ 0-9A-F]+\\)\\)?" + (while (re-search-forward "^\\([0-9A-F]+\\)\\(?:\\.\\.\\([0-9A-F]+\\)\\)? +; +\\([^ ]+\\) +\\(?:; +\\([ 0-9A-F]+\\)\\)?\\(?:; \\(NV8\\|XV8\\)\\)?" nil t) (let ((start (match-string 1)) (end (match-string 2)) (status (match-string 3)) - (mapped (match-string 4))) + (mapped (match-string 4)) + (idna-status (match-string 5))) ;; Make reading the file slightly faster by using `t' ;; instead of `disallowed' all over the place. - (when (string-match-p "\\`disallowed" status) + (when (or (string-match-p "\\`disallowed" status) + ;; UTS #46 messed us about with "status = valid" for + ;; invalid characters, so we need to check for "NV8" or + ;; "XV8". + (string= idna-status "NV8") + (string= idna-status "XV8")) (setq status "t")) (unless (or (equal status "valid") (equal status "deviation")) commit 8eb66cca78dca27d58a8881b587b3340043a74f7 Author: Dmitry Gutov Date: Tue Sep 17 02:11:52 2024 +0300 Rename project-{find-file-in-root,root-find-file} * lisp/progmodes/project.el (project-root-find-file): Rename from 'project-find-file-in-root' (bug#73044). diff --git a/etc/NEWS b/etc/NEWS index 492159439fc..8bd5c7c9515 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -111,7 +111,7 @@ This hook allows you to control which tab-bar tabs are auto-resized. ** Project --- -*** New command 'project-find-file-in-root'. +*** New command 'project-root-find-file'. It is equivalent to running ‘project-any-command’ with ‘find-file’. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 220d4dfe853..b29d5ed5404 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1073,7 +1073,7 @@ using a command like `project-find-file'." filename)) ;;;###autoload -(defun project-find-file-in-root (filename) +(defun project-root-find-file (filename) "Edit file FILENAME. Interactively, prompt for FILENAME, defaulting to the root directory of commit 73427887d63c086fb88449dce79bf2f8e58183fa Author: Paul Eggert Date: Tue Sep 17 00:32:39 2024 -0700 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/c++defs.h b/lib/c++defs.h index 7082af3fc28..7843359caa8 100644 --- a/lib/c++defs.h +++ b/lib/c++defs.h @@ -104,10 +104,15 @@ # define _GL_EXTERN_C_FUNC #endif -/* _GL_FUNCDECL_RPL (func, rettype, parameters[, attributes]); +/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]); declares a replacement function, named rpl_func, with the given prototype, consisting of return type, parameters, and attributes. - Example: + Although attributes are optional, the comma before them is required + for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, + if needed, must be placed after the _GL_FUNCDECL_RPL invocation, + at the end of the declaration. + Examples: + _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW; _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...), _GL_ARG_NONNULL ((1))); @@ -116,24 +121,22 @@ because [[...]] extern "C" ; is invalid syntax in C++.) - - Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside - of the _GL_FUNCDECL_RPL invocation, at the end of the declaration. */ #define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__) #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters -/* _GL_FUNCDECL_SYS (func, rettype, parameters[, attributes]); +/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]); declares the system function, named func, with the given prototype, consisting of return type, parameters, and attributes. - Example: - _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...), - _GL_ARG_NONNULL ((1))); - - Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside - of the _GL_FUNCDECL_SYS invocation, at the end of the declaration. + Although attributes are optional, the comma before them is required + for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW, + if needed, must be placed after the _GL_FUNCDECL_RPL invocation, + at the end of the declaration. + Examples: + _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW; + _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); */ #define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters diff --git a/lib/faccessat.c b/lib/faccessat.c index 8178ca8632e..6eed1b642a6 100644 --- a/lib/faccessat.c +++ b/lib/faccessat.c @@ -63,15 +63,17 @@ rpl_faccessat (int fd, char const *file, int mode, int flag) { int result = orig_faccessat (fd, file, mode, flag); - if (result == 0 && file[strlen (file) - 1] == '/') + if (file[strlen (file) - 1] == '/') { struct stat st; - result = fstatat (fd, file, &st, 0); - if (result == 0 && !S_ISDIR (st.st_mode)) + int ret = fstatat (fd, file, &st, 0); + if (ret == 0 && !S_ISDIR (st.st_mode)) { errno = ENOTDIR; return -1; } + if (result == 0) + result = ret; } return result; diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 8b8274295a5..fc65d40bc06 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -141,14 +141,14 @@ _GL_CXXALIASWARN (creat); # undef fcntl # define fcntl rpl_fcntl # endif -_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...)); +_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...), ); _GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...)); # if !GNULIB_defined_rpl_fcntl # define GNULIB_defined_rpl_fcntl 1 # endif # else # if !@HAVE_FCNTL@ -_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...)); +_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...), ); # if !GNULIB_defined_fcntl # define GNULIB_defined_fcntl 1 # endif diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index e9c80f3dca5..747f1bb787c 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -913,11 +913,11 @@ extern "C" { # undef imaxabs # define imaxabs rpl_imaxabs # endif -_GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x)); +_GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x), ); _GL_CXXALIAS_RPL (imaxabs, intmax_t, (intmax_t x)); # else # if !@HAVE_DECL_IMAXABS@ -_GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x)); +_GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x), ); # endif _GL_CXXALIAS_SYS (imaxabs, intmax_t, (intmax_t x)); # endif @@ -944,11 +944,11 @@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; # undef imaxdiv # define imaxdiv rpl_imaxdiv # endif -_GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); +_GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom), ); _GL_CXXALIAS_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); # else # if !@HAVE_DECL_IMAXDIV@ -_GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); +_GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom), ); # endif _GL_CXXALIAS_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); # endif diff --git a/lib/signal.in.h b/lib/signal.in.h index a0effa21ba1..6239b90adf3 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h @@ -149,7 +149,7 @@ typedef void (*sighandler_t) (int); #if @GNULIB_SIG2STR@ # if !@HAVE_SIG2STR@ -_GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str)); +_GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str), ); # endif _GL_CXXALIAS_SYS (sig2str, int, (int signo, char *str)); # if __GLIBC__ >= 2 @@ -165,7 +165,7 @@ _GL_WARN_ON_USE (sig2str, "sig2str is not portable - " #if @GNULIB_SIG2STR@ # if !@HAVE_STR2SIG@ -_GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p)); +_GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p), ); # endif _GL_CXXALIAS_SYS (str2sig, int, (char const *str, int *signo_p)); # if __GLIBC__ >= 2 @@ -189,7 +189,7 @@ _GL_WARN_ON_USE (str2sig, "str2sig is not portable - " _GL_FUNCDECL_RPL (pthread_sigmask, int, (int how, const sigset_t *restrict new_mask, - sigset_t *restrict old_mask)); + sigset_t *restrict old_mask), ); _GL_CXXALIAS_RPL (pthread_sigmask, int, (int how, const sigset_t *restrict new_mask, @@ -199,7 +199,7 @@ _GL_CXXALIAS_RPL (pthread_sigmask, int, _GL_FUNCDECL_SYS (pthread_sigmask, int, (int how, const sigset_t *restrict new_mask, - sigset_t *restrict old_mask)); + sigset_t *restrict old_mask), ); # endif _GL_CXXALIAS_SYS (pthread_sigmask, int, (int how, @@ -224,11 +224,11 @@ _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - " # undef raise # define raise rpl_raise # endif -_GL_FUNCDECL_RPL (raise, int, (int sig)); +_GL_FUNCDECL_RPL (raise, int, (int sig), ); _GL_CXXALIAS_RPL (raise, int, (int sig)); # else # if !@HAVE_RAISE@ -_GL_FUNCDECL_SYS (raise, int, (int sig)); +_GL_FUNCDECL_SYS (raise, int, (int sig), ); # endif _GL_CXXALIAS_SYS (raise, int, (int sig)); # endif @@ -359,7 +359,7 @@ _GL_CXXALIASWARN (sigpending); _GL_FUNCDECL_SYS (sigprocmask, int, (int operation, const sigset_t *restrict set, - sigset_t *restrict old_set)); + sigset_t *restrict old_set), ); # endif _GL_CXXALIAS_SYS (sigprocmask, int, (int operation, @@ -384,7 +384,7 @@ typedef void (*_gl_function_taking_int_returning_void_t) (int); # define signal rpl_signal # endif _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t, - (int sig, _gl_function_taking_int_returning_void_t func)); + (int sig, _gl_function_taking_int_returning_void_t func), ); _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, (int sig, _gl_function_taking_int_returning_void_t func)); # else @@ -392,7 +392,7 @@ _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, because it occurs in , not directly. */ # if defined __OpenBSD__ _GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t, - (int sig, _gl_function_taking_int_returning_void_t func)); + (int sig, _gl_function_taking_int_returning_void_t func), ); # endif _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, (int sig, _gl_function_taking_int_returning_void_t func)); @@ -510,7 +510,7 @@ struct sigaction # endif _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict, - struct sigaction *restrict)); + struct sigaction *restrict), ); # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ diff --git a/lib/stdbit.in.h b/lib/stdbit.in.h index 9f9e60a5d38..20b9f4f4662 100644 --- a/lib/stdbit.in.h +++ b/lib/stdbit.in.h @@ -308,7 +308,7 @@ __gl_stdbit_popcount_wide (unsigned long long int n) x333333 = max / (1 << 2 | 1), /* 0x333333... */ x0f0f0f = max / (1 << 4 | 1), /* 0x0f0f0f... */ x010101 = max / ((1 << 8) - 1), /* 0x010101... */ - x000_7f = max / 0xffffffffffffffff * 0x7f; /* 0x000000000000007f... */ + x000_7f = max / 0xffffffffffffffffLL * 0x7f; /* 0x000000000000007f... */ n -= (n >> 1) & x555555; n = (n & x333333) + ((n >> 2) & x333333); n = (n + (n >> 4)) & x0f0f0f; diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 36fd6a72ceb..e77798d9b25 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -461,7 +461,7 @@ _GL_CXXALIASWARN (fdopen); # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define fflush rpl_fflush # endif -_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream)); +_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream), ); _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream)); # else _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream)); @@ -994,7 +994,7 @@ _GL_CXXALIASWARN (getc); # undef getchar # define getchar rpl_getchar # endif -_GL_FUNCDECL_RPL (getchar, int, (void)); +_GL_FUNCDECL_RPL (getchar, int, (void), ); _GL_CXXALIAS_RPL (getchar, int, (void)); # else _GL_CXXALIAS_SYS (getchar, int, (void)); @@ -1112,7 +1112,7 @@ _GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream)); # if @HAVE_DECL_GETW@ # if defined __APPLE__ && defined __MACH__ /* The presence of the declaration depends on _POSIX_C_SOURCE. */ -_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream)); +_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream), ); # endif _GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream)); # endif @@ -1221,7 +1221,7 @@ _GL_WARN_ON_USE (pclose, "pclose is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define perror rpl_perror # endif -_GL_FUNCDECL_RPL (perror, void, (const char *string)); +_GL_FUNCDECL_RPL (perror, void, (const char *string), ); _GL_CXXALIAS_RPL (perror, void, (const char *string)); # else _GL_CXXALIAS_SYS (perror, void, (const char *string)); @@ -1366,7 +1366,7 @@ _GL_CXXALIASWARN (putc); # undef putchar # define putchar rpl_putchar # endif -_GL_FUNCDECL_RPL (putchar, int, (int c)); +_GL_FUNCDECL_RPL (putchar, int, (int c), ); _GL_CXXALIAS_RPL (putchar, int, (int c)); # else _GL_CXXALIAS_SYS (putchar, int, (int c)); @@ -1406,7 +1406,7 @@ _GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream)); # if @HAVE_DECL_PUTW@ # if defined __APPLE__ && defined __MACH__ /* The presence of the declaration depends on _POSIX_C_SOURCE. */ -_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream)); +_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream), ); # endif _GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream)); # endif diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 1ec96c8b249..6667f426ad9 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -20,7 +20,9 @@ #endif @PRAGMA_COLUMNS@ -#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined __need_malloc_and_calloc +#if ((defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) \ + || defined __need_malloc_and_calloc) \ + && !defined __SUNPRO_CC /* Special invocation conventions inside some gnulib header files, and inside some glibc header files, respectively. Do not recognize this special invocation convention when GCC's @@ -220,11 +222,11 @@ struct random_data # undef _Exit # define _Exit rpl__Exit # endif -_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status)); +_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status), ); _GL_CXXALIAS_RPL (_Exit, void, (int status)); # else # if !@HAVE__EXIT@ -_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); +_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status), ); # endif _GL_CXXALIAS_SYS (_Exit, void, (int status)); # endif @@ -249,7 +251,7 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " # undef abort # define abort rpl_abort # endif -_GL_FUNCDECL_RPL (abort, _Noreturn void, (void)); +_GL_FUNCDECL_RPL (abort, _Noreturn void, (void), ); _GL_CXXALIAS_RPL (abort, void, (void)); # else _GL_CXXALIAS_SYS (abort, void, (void)); @@ -267,9 +269,9 @@ _GL_CXXALIASWARN (abort); # define free rpl_free # endif # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) -_GL_FUNCDECL_RPL (free, void, (void *ptr)) _GL_ATTRIBUTE_NOTHROW; +_GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW; # else -_GL_FUNCDECL_RPL (free, void, (void *ptr)); +_GL_FUNCDECL_RPL (free, void, (void *ptr), ); # endif _GL_CXXALIAS_RPL (free, void, (void *ptr)); # else @@ -592,7 +594,7 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - " # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ _GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE); # else -_GL_FUNCDECL_RPL (getprogname, const char *, (void)); +_GL_FUNCDECL_RPL (getprogname, const char *, (void), ); # endif _GL_CXXALIAS_RPL (getprogname, const char *, (void)); # else @@ -600,7 +602,7 @@ _GL_CXXALIAS_RPL (getprogname, const char *, (void)); # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ _GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE); # else -_GL_FUNCDECL_SYS (getprogname, const char *, (void)); +_GL_FUNCDECL_SYS (getprogname, const char *, (void), ); # endif # endif _GL_CXXALIAS_SYS (getprogname, const char *, (void)); @@ -662,7 +664,7 @@ _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - " /* Change the ownership and access permission of the slave side of the pseudo-terminal whose master side is specified by FD. */ # if !@HAVE_GRANTPT@ -_GL_FUNCDECL_SYS (grantpt, int, (int fd)); +_GL_FUNCDECL_SYS (grantpt, int, (int fd), ); # endif _GL_CXXALIAS_SYS (grantpt, int, (int fd)); _GL_CXXALIASWARN (grantpt); @@ -788,13 +790,13 @@ _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - " # define mbtowc rpl_mbtowc # endif _GL_FUNCDECL_RPL (mbtowc, int, - (wchar_t *restrict pwc, const char *restrict s, size_t n)); + (wchar_t *restrict pwc, const char *restrict s, size_t n), ); _GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *restrict pwc, const char *restrict s, size_t n)); # else # if !@HAVE_MBTOWC@ _GL_FUNCDECL_SYS (mbtowc, int, - (wchar_t *restrict pwc, const char *restrict s, size_t n)); + (wchar_t *restrict pwc, const char *restrict s, size_t n), ); # endif _GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *restrict pwc, const char *restrict s, size_t n)); @@ -1078,11 +1080,11 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - " # undef ptsname_r # define ptsname_r rpl_ptsname_r # endif -_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); +_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len), ); _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); # else # if !@HAVE_PTSNAME_R@ -_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); +_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len), ); # endif _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); # endif @@ -1204,7 +1206,7 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " # undef rand # define rand rpl_rand # endif -_GL_FUNCDECL_RPL (rand, int, (void)); +_GL_FUNCDECL_RPL (rand, int, (void), ); _GL_CXXALIAS_RPL (rand, int, (void)); # else _GL_CXXALIAS_SYS (rand, int, (void)); @@ -1221,11 +1223,11 @@ _GL_CXXALIASWARN (rand); # undef random # define random rpl_random # endif -_GL_FUNCDECL_RPL (random, long, (void)); +_GL_FUNCDECL_RPL (random, long, (void), ); _GL_CXXALIAS_RPL (random, long, (void)); # else # if !@HAVE_RANDOM@ -_GL_FUNCDECL_SYS (random, long, (void)); +_GL_FUNCDECL_SYS (random, long, (void), ); # endif /* Need to cast, because on Haiku, the return type is int. */ @@ -1248,11 +1250,11 @@ _GL_WARN_ON_USE (random, "random is unportable - " # undef srandom # define srandom rpl_srandom # endif -_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); +_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed), ); _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); # else # if !@HAVE_RANDOM@ -_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); +_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed), ); # endif /* Need to cast, because on FreeBSD, the first parameter is unsigned long seed. */ @@ -1910,7 +1912,7 @@ _GL_WARN_ON_USE (strtoull, "strtoull is unportable - " /* Unlock the slave side of the pseudo-terminal whose master side is specified by FD, so that it can be opened. */ # if !@HAVE_UNLOCKPT@ -_GL_FUNCDECL_SYS (unlockpt, int, (int fd)); +_GL_FUNCDECL_SYS (unlockpt, int, (int fd), ); # endif _GL_CXXALIAS_SYS (unlockpt, int, (int fd)); _GL_CXXALIASWARN (unlockpt); @@ -1955,7 +1957,7 @@ _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - " # undef wctomb # define wctomb rpl_wctomb # endif -_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); +_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc), ); _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); # else _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); diff --git a/lib/string.in.h b/lib/string.in.h index a588e7e2c26..f5a6d8b3267 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -213,7 +213,7 @@ _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - " /* Find the index of the least-significant set bit. */ #if @GNULIB_FFSL@ # if !@HAVE_FFSL@ -_GL_FUNCDECL_SYS (ffsl, int, (long int i)); +_GL_FUNCDECL_SYS (ffsl, int, (long int i), ); # endif _GL_CXXALIAS_SYS (ffsl, int, (long int i)); _GL_CXXALIASWARN (ffsl); @@ -231,11 +231,11 @@ _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module"); # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define ffsll rpl_ffsll # endif -_GL_FUNCDECL_RPL (ffsll, int, (long long int i)); +_GL_FUNCDECL_RPL (ffsll, int, (long long int i), ); _GL_CXXALIAS_RPL (ffsll, int, (long long int i)); # else # if !@HAVE_FFSLL@ -_GL_FUNCDECL_SYS (ffsll, int, (long long int i)); +_GL_FUNCDECL_SYS (ffsll, int, (long long int i), ); # endif _GL_CXXALIAS_SYS (ffsll, int, (long long int i)); # endif @@ -1308,7 +1308,7 @@ _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim, # undef strerror # define strerror rpl_strerror # endif -_GL_FUNCDECL_RPL (strerror, char *, (int)); +_GL_FUNCDECL_RPL (strerror, char *, (int), ); _GL_CXXALIAS_RPL (strerror, char *, (int)); # else _GL_CXXALIAS_SYS (strerror, char *, (int)); @@ -1359,11 +1359,11 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - " # undef strerrorname_np # define strerrorname_np rpl_strerrorname_np # endif -_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); +_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum), ); _GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); # else # if !@HAVE_STRERRORNAME_NP@ -_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); +_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum), ); # endif _GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); # endif @@ -1379,7 +1379,7 @@ _GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " /* Return an abbreviation string for the signal number SIG. */ #if @GNULIB_SIGABBREV_NP@ # if ! @HAVE_SIGABBREV_NP@ -_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig)); +_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig), ); # endif _GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig)); _GL_CXXALIASWARN (sigabbrev_np); @@ -1394,7 +1394,7 @@ _GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - " /* Return an English description string for the signal number SIG. */ #if @GNULIB_SIGDESCR_NP@ # if ! @HAVE_SIGDESCR_NP@ -_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig)); +_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig), ); # endif _GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig)); _GL_CXXALIASWARN (sigdescr_np); @@ -1411,11 +1411,11 @@ _GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define strsignal rpl_strsignal # endif -_GL_FUNCDECL_RPL (strsignal, char *, (int __sig)); +_GL_FUNCDECL_RPL (strsignal, char *, (int __sig), ); _GL_CXXALIAS_RPL (strsignal, char *, (int __sig)); # else # if ! @HAVE_DECL_STRSIGNAL@ -_GL_FUNCDECL_SYS (strsignal, char *, (int __sig)); +_GL_FUNCDECL_SYS (strsignal, char *, (int __sig), ); # endif /* Need to cast, because on Cygwin 1.5.x systems, the return type is 'const char *'. */ diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 0d5ddd16783..9bfb2283857 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -282,7 +282,7 @@ rpl_fd_isset (SOCKET fd, fd_set * set) # endif _GL_FUNCDECL_RPL (pselect, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timespec const *restrict, const sigset_t *restrict)); + struct timespec const *restrict, const sigset_t *restrict), ); _GL_CXXALIAS_RPL (pselect, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, struct timespec const *restrict, const sigset_t *restrict)); @@ -290,7 +290,7 @@ _GL_CXXALIAS_RPL (pselect, int, # if !@HAVE_PSELECT@ _GL_FUNCDECL_SYS (pselect, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timespec const *restrict, const sigset_t *restrict)); + struct timespec const *restrict, const sigset_t *restrict), ); # endif /* Need to cast, because on AIX 7, the second, third, fourth argument may be void *restrict, void *restrict, void *restrict. */ @@ -319,7 +319,7 @@ _GL_WARN_ON_USE (pselect, "pselect is not portable - " # endif _GL_FUNCDECL_RPL (select, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timeval *restrict)); + struct timeval *restrict), ); _GL_CXXALIAS_RPL (select, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, timeval *restrict)); diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index d2ecdb9da96..81138bce251 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -585,11 +585,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - " # undef futimens # define futimens rpl_futimens # endif -_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2])); +_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]), ); _GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2])); # else # if !@HAVE_FUTIMENS@ -_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); +_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]), ); # endif _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); # endif @@ -608,9 +608,9 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - " #if @GNULIB_GETUMASK@ # if !@HAVE_GETUMASK@ # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 -_GL_FUNCDECL_SYS (getumask, mode_t, (void)) _GL_ATTRIBUTE_NOTHROW; +_GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW; # else -_GL_FUNCDECL_SYS (getumask, mode_t, (void)); +_GL_FUNCDECL_SYS (getumask, mode_t, (void), ); # endif # endif _GL_CXXALIAS_SYS (getumask, mode_t, (void)); diff --git a/lib/time.in.h b/lib/time.in.h index 097c509d3cc..5dc03c892a4 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -201,7 +201,7 @@ _GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define time rpl_time # endif -_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp)); +_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp), ); _GL_CXXALIAS_RPL (time, time_t, (time_t *__tp)); # else _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp)); @@ -255,7 +255,7 @@ _GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - " # undef tzset # define tzset rpl_tzset # endif -_GL_FUNCDECL_RPL (tzset, void, (void)); +_GL_FUNCDECL_RPL (tzset, void, (void), ); _GL_CXXALIAS_RPL (tzset, void, (void)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -516,7 +516,7 @@ typedef struct tm_zone *rpl_timezone_t; May return NULL if NAME is invalid (this is platform dependent) or upon memory allocation failure. */ # if !@HAVE_TZALLOC@ -_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); +_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name), ); _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); # endif @@ -524,7 +524,7 @@ _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); Frees a time zone object. The argument must have been returned by tzalloc(). */ # if !@HAVE_TZALLOC@ -_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); +_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz), ); _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); # endif diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 3222f5a568f..20b1356fd38 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -399,7 +399,7 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " # undef close # define close rpl_close # endif -_GL_FUNCDECL_RPL (close, int, (int fd)); +_GL_FUNCDECL_RPL (close, int, (int fd), ); _GL_CXXALIAS_RPL (close, int, (int fd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -446,7 +446,7 @@ _GL_CXXALIASWARN (close); # endif _GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, - size_t len, unsigned flags)); + size_t len, unsigned flags), ); _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, size_t len, unsigned flags)); @@ -454,7 +454,7 @@ _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, # if !@HAVE_COPY_FILE_RANGE@ _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, - size_t len, unsigned flags)); + size_t len, unsigned flags), ); # endif _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, @@ -521,7 +521,7 @@ _GL_CXXALIASWARN (dup); # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define dup2 rpl_dup2 # endif -_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); +_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd), ); _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -570,11 +570,11 @@ _GL_CXXALIASWARN (dup2); # undef dup3 # define dup3 rpl_dup3 # endif -_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); +_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags), ); _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); # else # if !@HAVE_DUP3@ -_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); +_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags), ); # endif _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); # endif @@ -1045,11 +1045,11 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " # undef fdatasync # define fdatasync rpl_fdatasync # endif -_GL_FUNCDECL_RPL (fdatasync, int, (int fd)); +_GL_FUNCDECL_RPL (fdatasync, int, (int fd), ); _GL_CXXALIAS_RPL (fdatasync, int, (int fd)); # else # if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@ -_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); +_GL_FUNCDECL_SYS (fdatasync, int, (int fd), ); # endif _GL_CXXALIAS_SYS (fdatasync, int, (int fd)); # endif @@ -1071,7 +1071,7 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - " See POSIX:2008 specification . */ # if !@HAVE_FSYNC@ -_GL_FUNCDECL_SYS (fsync, int, (int fd)); +_GL_FUNCDECL_SYS (fsync, int, (int fd), ); # endif _GL_CXXALIAS_SYS (fsync, int, (int fd)); _GL_CXXALIASWARN (fsync); @@ -1223,11 +1223,11 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - " # undef getdtablesize # define getdtablesize rpl_getdtablesize # endif -_GL_FUNCDECL_RPL (getdtablesize, int, (void)); +_GL_FUNCDECL_RPL (getdtablesize, int, (void), ); _GL_CXXALIAS_RPL (getdtablesize, int, (void)); # else # if !@HAVE_GETDTABLESIZE@ -_GL_FUNCDECL_SYS (getdtablesize, int, (void)); +_GL_FUNCDECL_SYS (getdtablesize, int, (void), ); # endif /* Need to cast, because on AIX, the parameter list is (...). */ @@ -1360,7 +1360,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - " $USERNAME on native Windows platforms. */ # if !@HAVE_DECL_GETLOGIN@ -_GL_FUNCDECL_SYS (getlogin, char *, (void)); +_GL_FUNCDECL_SYS (getlogin, char *, (void), ); # endif _GL_CXXALIAS_SYS (getlogin, char *, (void)); _GL_CXXALIASWARN (getlogin); @@ -1421,13 +1421,13 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define getpagesize rpl_getpagesize # endif -_GL_FUNCDECL_RPL (getpagesize, int, (void)); +_GL_FUNCDECL_RPL (getpagesize, int, (void), ); _GL_CXXALIAS_RPL (getpagesize, int, (void)); # else /* On HP-UX, getpagesize exists, but it is not declared in even if the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ # if defined __hpux -_GL_FUNCDECL_SYS (getpagesize, int, (void)); +_GL_FUNCDECL_SYS (getpagesize, int, (void), ); # endif # if !@HAVE_GETPAGESIZE@ # if !defined getpagesize @@ -1559,11 +1559,11 @@ _GL_CXXALIASWARN (getpid); # undef getusershell # define getusershell rpl_getusershell # endif -_GL_FUNCDECL_RPL (getusershell, char *, (void)); +_GL_FUNCDECL_RPL (getusershell, char *, (void), ); _GL_CXXALIAS_RPL (getusershell, char *, (void)); # else # if !@HAVE_DECL_GETUSERSHELL@ -_GL_FUNCDECL_SYS (getusershell, char *, (void)); +_GL_FUNCDECL_SYS (getusershell, char *, (void), ); # endif _GL_CXXALIAS_SYS (getusershell, char *, (void)); # endif @@ -1583,11 +1583,11 @@ _GL_WARN_ON_USE (getusershell, "getusershell is unportable - " # undef setusershell # define setusershell rpl_setusershell # endif -_GL_FUNCDECL_RPL (setusershell, void, (void)); +_GL_FUNCDECL_RPL (setusershell, void, (void), ); _GL_CXXALIAS_RPL (setusershell, void, (void)); # else # if !@HAVE_DECL_GETUSERSHELL@ -_GL_FUNCDECL_SYS (setusershell, void, (void)); +_GL_FUNCDECL_SYS (setusershell, void, (void), ); # endif _GL_CXXALIAS_SYS (setusershell, void, (void)); # endif @@ -1608,11 +1608,11 @@ _GL_WARN_ON_USE (setusershell, "setusershell is unportable - " # undef endusershell # define endusershell rpl_endusershell # endif -_GL_FUNCDECL_RPL (endusershell, void, (void)); +_GL_FUNCDECL_RPL (endusershell, void, (void), ); _GL_CXXALIAS_RPL (endusershell, void, (void)); # else # if !@HAVE_DECL_GETUSERSHELL@ -_GL_FUNCDECL_SYS (endusershell, void, (void)); +_GL_FUNCDECL_SYS (endusershell, void, (void), ); # endif _GL_CXXALIAS_SYS (endusershell, void, (void)); # endif @@ -1629,7 +1629,7 @@ _GL_WARN_ON_USE (endusershell, "endusershell is unportable - " #if @GNULIB_GROUP_MEMBER@ /* Determine whether group id is in calling user's group list. */ # if !@HAVE_GROUP_MEMBER@ -_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); +_GL_FUNCDECL_SYS (group_member, int, (gid_t gid), ); # endif _GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); _GL_CXXALIASWARN (group_member); @@ -1649,7 +1649,7 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - " # define isatty rpl_isatty # endif # define GNULIB_defined_isatty 1 -_GL_FUNCDECL_RPL (isatty, int, (int fd)); +_GL_FUNCDECL_RPL (isatty, int, (int fd), ); _GL_CXXALIAS_RPL (isatty, int, (int fd)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1792,7 +1792,7 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - " # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define lseek rpl_lseek # endif -_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence), ); _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); # elif defined _WIN32 && !defined __CYGWIN__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -2161,11 +2161,11 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - " # undef sleep # define sleep rpl_sleep # endif -_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n)); +_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n), ); _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n)); # else # if !@HAVE_SLEEP@ -_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n)); +_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n), ); # endif _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); # endif @@ -2409,11 +2409,11 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " # undef usleep # define usleep rpl_usleep # endif -_GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); +_GL_FUNCDECL_RPL (usleep, int, (useconds_t n), ); _GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); # else # if !@HAVE_USLEEP@ -_GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); +_GL_FUNCDECL_SYS (usleep, int, (useconds_t n), ); # endif /* Need to cast, because on Haiku, the first parameter is unsigned int n. */ diff --git a/lib/utimens.c b/lib/utimens.c index 6b9f62a53c1..cd86a44ea76 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -516,6 +516,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2]) } } +#if !HAVE_UTIMENS /* Set the access and modification timestamps of FILE to be TIMESPEC[0] and TIMESPEC[1], respectively. */ int @@ -523,7 +524,9 @@ utimens (char const *file, struct timespec const timespec[2]) { return fdutimens (-1, file, timespec); } +#endif +#if !HAVE_LUTIMENS /* Set the access and modification timestamps of FILE to be TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing symlinks. Fail with ENOSYS if the platform does not support @@ -646,3 +649,4 @@ lutimens (char const *file, struct timespec const timespec[2]) errno = ENOSYS; return -1; } +#endif diff --git a/lib/utimens.h b/lib/utimens.h index b20d4f4f7ee..e85477b8493 100644 --- a/lib/utimens.h +++ b/lib/utimens.h @@ -24,13 +24,21 @@ #include +#if HAVE_UTIMENS || HAVE_LUTIMENS +# include +#endif + #ifdef __cplusplus extern "C" { #endif int fdutimens (int, char const *, struct timespec const [2]); +#if !HAVE_UTIMENS int utimens (char const *, struct timespec const [2]); +#endif +#if !HAVE_LUTIMENS int lutimens (char const *, struct timespec const [2]); +#endif #ifdef __cplusplus } diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4 index e8d5de7a1e1..d61d694297d 100644 --- a/m4/std-gnu11.m4 +++ b/m4/std-gnu11.m4 @@ -1,5 +1,5 @@ # std-gnu11.m4 -# serial 2 +# serial 3 # Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- @@ -9,6 +9,7 @@ m4_ifndef([_AC_C_C23_OPTIONS], [ # This implementation is taken from GNU Autoconf lib/autoconf/c.m4 # commit 017d5ddd82854911f0119691d91ea8a1438824d6 # dated Sun Apr 3 13:57:17 2016 -0700 +# with minor changes to commentary. # This implementation will be obsolete once we can assume Autoconf 2.70 # or later is installed everywhere a Gnulib program might be developed. @@ -17,9 +18,10 @@ m4_version_prereq([2.70], [], [ # Copyright (C) 2001-2024 Free Software Foundation, Inc. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or +# This file is part of Autoconf. This program is free +# software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -27,8 +29,15 @@ m4_version_prereq([2.70], [], [ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # +# Under Section 7 of GPL version 3, you are granted additional +# permissions described in the Autoconf Configure Script Exception, +# version 3.0, as published by the Free Software Foundation. +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# and a copy of the Autoconf Configure Script Exception along with +# this program; see the files COPYINGv3 and COPYING.EXCEPTION +# respectively. If not, see and +# . # Written by David MacKenzie, with help from # Akim Demaille, Paul Eggert, diff --git a/m4/utimens.m4 b/m4/utimens.m4 index 9996e3ef336..b8200deaa25 100644 --- a/m4/utimens.m4 +++ b/m4/utimens.m4 @@ -1,5 +1,5 @@ # utimens.m4 -# serial 16 +# serial 17 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, @@ -16,6 +16,7 @@ AC_DEFUN([gl_UTIMENS], gl_CHECK_FUNCS_ANDROID([lutimes], [[#include ]]) gl_CHECK_FUNCS_ANDROID([futimens], [[#include ]]) gl_CHECK_FUNCS_ANDROID([utimensat], [[#include ]]) + AC_CHECK_FUNCS_ONCE([utimens lutimens]) if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not