diff options
| author | Paul Eggert | 2017-11-02 13:18:16 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-11-02 13:21:33 -0700 |
| commit | 04bc1410c26884bfed9fd7ba7376491023df03fc (patch) | |
| tree | b3db4ad7a884f5796c0bd0e147bd46aee8577a1f | |
| parent | 6b08ad5263bc063c79666ffe2bd5ed9ab77a00a0 (diff) | |
| download | emacs-04bc1410c26884bfed9fd7ba7376491023df03fc.tar.gz emacs-04bc1410c26884bfed9fd7ba7376491023df03fc.zip | |
Merge from Gnulib
This incorporates:
2017-10-29 timespec: prefer ‘assume’ to ‘assure’
2017-10-27 timespec.h: use "assure" to avoid a spurious warning
2017-10-09 getopt-posix: Fix build failure if ac_cv_header_getopt_h=no
* build-aux/config.guess, build-aux/config.sub:
* lib/timespec.h, lib/unistd.in.h:
Copy from Gnulib.
| -rwxr-xr-x | build-aux/config.guess | 20 | ||||
| -rwxr-xr-x | build-aux/config.sub | 10 | ||||
| -rw-r--r-- | lib/timespec.h | 22 | ||||
| -rw-r--r-- | lib/unistd.in.h | 5 |
4 files changed, 32 insertions, 25 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess index ba1c1439a9f..2773ac4f5ed 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Attempt to guess a canonical system name. | 2 | # Attempt to guess a canonical system name. |
| 3 | # Copyright 1992-2017 Free Software Foundation, Inc. | 3 | # Copyright 1992-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | timestamp='2017-09-26' | 5 | timestamp='2017-11-01' |
| 6 | 6 | ||
| 7 | # This file is free software; you can redistribute it and/or modify it | 7 | # This file is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by | 8 | # under the terms of the GNU General Public License as published by |
| @@ -479,13 +479,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | |||
| 479 | #endif | 479 | #endif |
| 480 | #if defined (host_mips) && defined (MIPSEB) | 480 | #if defined (host_mips) && defined (MIPSEB) |
| 481 | #if defined (SYSTYPE_SYSV) | 481 | #if defined (SYSTYPE_SYSV) |
| 482 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); | 482 | printf ("mips-mips-risco0s%ssysv\\n", argv[1]); exit (0); |
| 483 | #endif | 483 | #endif |
| 484 | #if defined (SYSTYPE_SVR4) | 484 | #if defined (SYSTYPE_SVR4) |
| 485 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); | 485 | printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); |
| 486 | #endif | 486 | #endif |
| 487 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) | 487 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) |
| 488 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); | 488 | printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); |
| 489 | #endif | 489 | #endif |
| 490 | #endif | 490 | #endif |
| 491 | exit (-1); | 491 | exit (-1); |
| @@ -608,7 +608,7 @@ EOF | |||
| 608 | *:AIX:*:*) | 608 | *:AIX:*:*) |
| 609 | echo rs6000-ibm-aix | 609 | echo rs6000-ibm-aix |
| 610 | exit ;; | 610 | exit ;; |
| 611 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) | 611 | ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) |
| 612 | echo romp-ibm-bsd4.4 | 612 | echo romp-ibm-bsd4.4 |
| 613 | exit ;; | 613 | exit ;; |
| 614 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and | 614 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and |
| @@ -629,8 +629,8 @@ EOF | |||
| 629 | 9000/[34678]??:HP-UX:*:*) | 629 | 9000/[34678]??:HP-UX:*:*) |
| 630 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | 630 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` |
| 631 | case "${UNAME_MACHINE}" in | 631 | case "${UNAME_MACHINE}" in |
| 632 | 9000/31? ) HP_ARCH=m68000 ;; | 632 | 9000/31?) HP_ARCH=m68000 ;; |
| 633 | 9000/[34]?? ) HP_ARCH=m68k ;; | 633 | 9000/[34]??) HP_ARCH=m68k ;; |
| 634 | 9000/[678][0-9][0-9]) | 634 | 9000/[678][0-9][0-9]) |
| 635 | if [ -x /usr/bin/getconf ]; then | 635 | if [ -x /usr/bin/getconf ]; then |
| 636 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` | 636 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` |
| @@ -743,7 +743,7 @@ EOF | |||
| 743 | { echo "$SYSTEM_NAME"; exit; } | 743 | { echo "$SYSTEM_NAME"; exit; } |
| 744 | echo unknown-hitachi-hiuxwe2 | 744 | echo unknown-hitachi-hiuxwe2 |
| 745 | exit ;; | 745 | exit ;; |
| 746 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) | 746 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) |
| 747 | echo hppa1.1-hp-bsd | 747 | echo hppa1.1-hp-bsd |
| 748 | exit ;; | 748 | exit ;; |
| 749 | 9000/8??:4.3bsd:*:*) | 749 | 9000/8??:4.3bsd:*:*) |
| @@ -752,7 +752,7 @@ EOF | |||
| 752 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) | 752 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) |
| 753 | echo hppa1.0-hp-mpeix | 753 | echo hppa1.0-hp-mpeix |
| 754 | exit ;; | 754 | exit ;; |
| 755 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) | 755 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) |
| 756 | echo hppa1.1-hp-osf | 756 | echo hppa1.1-hp-osf |
| 757 | exit ;; | 757 | exit ;; |
| 758 | hp8??:OSF1:*:*) | 758 | hp8??:OSF1:*:*) |
| @@ -1072,7 +1072,7 @@ EOF | |||
| 1072 | i*86:*DOS:*:*) | 1072 | i*86:*DOS:*:*) |
| 1073 | echo ${UNAME_MACHINE}-pc-msdosdjgpp | 1073 | echo ${UNAME_MACHINE}-pc-msdosdjgpp |
| 1074 | exit ;; | 1074 | exit ;; |
| 1075 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) | 1075 | i*86:*:4.*:*) |
| 1076 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` | 1076 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` |
| 1077 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then | 1077 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then |
| 1078 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} | 1078 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} |
diff --git a/build-aux/config.sub b/build-aux/config.sub index c6950fd68ab..bbad4c45e5d 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Configuration validation subroutine script. | 2 | # Configuration validation subroutine script. |
| 3 | # Copyright 1992-2017 Free Software Foundation, Inc. | 3 | # Copyright 1992-2017 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | timestamp='2017-09-26' | 5 | timestamp='2017-11-01' |
| 6 | 6 | ||
| 7 | # This file is free software; you can redistribute it and/or modify it | 7 | # This file is free software; you can redistribute it and/or modify it |
| 8 | # under the terms of the GNU General Public License as published by | 8 | # under the terms of the GNU General Public License as published by |
| @@ -640,7 +640,7 @@ case $basic_machine in | |||
| 640 | basic_machine=rs6000-bull | 640 | basic_machine=rs6000-bull |
| 641 | os=-bosx | 641 | os=-bosx |
| 642 | ;; | 642 | ;; |
| 643 | dpx2* | dpx2*-bull) | 643 | dpx2*) |
| 644 | basic_machine=m68k-bull | 644 | basic_machine=m68k-bull |
| 645 | os=-sysv3 | 645 | os=-sysv3 |
| 646 | ;; | 646 | ;; |
| @@ -902,7 +902,7 @@ case $basic_machine in | |||
| 902 | basic_machine=v70-nec | 902 | basic_machine=v70-nec |
| 903 | os=-sysv | 903 | os=-sysv |
| 904 | ;; | 904 | ;; |
| 905 | next | m*-next ) | 905 | next | m*-next) |
| 906 | basic_machine=m68k-next | 906 | basic_machine=m68k-next |
| 907 | case $os in | 907 | case $os in |
| 908 | -nextstep* ) | 908 | -nextstep* ) |
| @@ -1492,7 +1492,7 @@ case $os in | |||
| 1492 | -nova*) | 1492 | -nova*) |
| 1493 | os=-rtmk-nova | 1493 | os=-rtmk-nova |
| 1494 | ;; | 1494 | ;; |
| 1495 | -ns2 ) | 1495 | -ns2) |
| 1496 | os=-nextstep2 | 1496 | os=-nextstep2 |
| 1497 | ;; | 1497 | ;; |
| 1498 | -nsk*) | 1498 | -nsk*) |
| @@ -1694,7 +1694,7 @@ case $basic_machine in | |||
| 1694 | m88k-omron*) | 1694 | m88k-omron*) |
| 1695 | os=-luna | 1695 | os=-luna |
| 1696 | ;; | 1696 | ;; |
| 1697 | *-next ) | 1697 | *-next) |
| 1698 | os=-nextstep | 1698 | os=-nextstep |
| 1699 | ;; | 1699 | ;; |
| 1700 | *-sequent) | 1700 | *-sequent) |
diff --git a/lib/timespec.h b/lib/timespec.h index 3831301578e..cc34067374f 100644 --- a/lib/timespec.h +++ b/lib/timespec.h | |||
| @@ -33,6 +33,8 @@ _GL_INLINE_HEADER_BEGIN | |||
| 33 | extern "C" { | 33 | extern "C" { |
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | #include "verify.h" | ||
| 37 | |||
| 36 | /* Resolution of timespec timestamps (in units per second), and log | 38 | /* Resolution of timespec timestamps (in units per second), and log |
| 37 | base 10 of the resolution. */ | 39 | base 10 of the resolution. */ |
| 38 | 40 | ||
| @@ -67,23 +69,29 @@ make_timespec (time_t s, long int ns) | |||
| 67 | any platform of interest to the GNU project, since all such | 69 | any platform of interest to the GNU project, since all such |
| 68 | platforms have 32-bit int or wider. | 70 | platforms have 32-bit int or wider. |
| 69 | 71 | ||
| 70 | Replacing "(int) (a.tv_nsec - b.tv_nsec)" with something like | 72 | Replacing "a.tv_nsec - b.tv_nsec" with something like |
| 71 | "a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause | 73 | "a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause |
| 72 | this function to work in some cases where the above assumption is | 74 | this function to work in some cases where the above assumption is |
| 73 | violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2, | 75 | violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2, |
| 74 | b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the | 76 | b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the |
| 75 | extra instructions. Using a subtraction has the advantage of | 77 | extra instructions. Using a subtraction has the advantage of |
| 76 | detecting some invalid cases on platforms that detect integer | 78 | detecting some invalid cases on platforms that detect integer |
| 77 | overflow. | 79 | overflow. */ |
| 78 | |||
| 79 | The (int) cast avoids a gcc -Wconversion warning. */ | ||
| 80 | 80 | ||
| 81 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE | 81 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE |
| 82 | timespec_cmp (struct timespec a, struct timespec b) | 82 | timespec_cmp (struct timespec a, struct timespec b) |
| 83 | { | 83 | { |
| 84 | return (a.tv_sec < b.tv_sec ? -1 | 84 | if (a.tv_sec < b.tv_sec) |
| 85 | : a.tv_sec > b.tv_sec ? 1 | 85 | return -1; |
| 86 | : (int) (a.tv_nsec - b.tv_nsec)); | 86 | if (a.tv_sec > b.tv_sec) |
| 87 | return 1; | ||
| 88 | |||
| 89 | /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02). See: | ||
| 90 | http://lists.gnu.org/archive/html/bug-gnulib/2017-10/msg00006.html */ | ||
| 91 | assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION); | ||
| 92 | assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION); | ||
| 93 | |||
| 94 | return a.tv_nsec - b.tv_nsec; | ||
| 87 | } | 95 | } |
| 88 | 96 | ||
| 89 | /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be | 97 | /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be |
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index c1dd07ff8cd..ca8090a3526 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h | |||
| @@ -134,9 +134,8 @@ | |||
| 134 | /* The definition of _GL_WARN_ON_USE is copied here. */ | 134 | /* The definition of _GL_WARN_ON_USE is copied here. */ |
| 135 | 135 | ||
| 136 | 136 | ||
| 137 | /* Get getopt(), optarg, optind, opterr, optopt. | 137 | /* Get getopt(), optarg, optind, opterr, optopt. */ |
| 138 | But avoid namespace pollution on glibc systems. */ | 138 | #if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT |
| 139 | #if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT | ||
| 140 | # include <getopt-cdefs.h> | 139 | # include <getopt-cdefs.h> |
| 141 | # include <getopt-pfx-core.h> | 140 | # include <getopt-pfx-core.h> |
| 142 | #endif | 141 | #endif |