diff options
| author | Paul Eggert | 2013-09-19 14:40:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-09-19 14:40:08 -0700 |
| commit | 230fe2a5a10f2bc128f354e3fb1b48536b1f143b (patch) | |
| tree | b282d5f242b8ada877d188d03d43da78b175d67a | |
| parent | c39cc7d149d28060c40bc206eb8a63f7a0636301 (diff) | |
| download | emacs-230fe2a5a10f2bc128f354e3fb1b48536b1f143b.tar.gz emacs-230fe2a5a10f2bc128f354e3fb1b48536b1f143b.zip | |
Merge from gnulib.
This incorporates the following changes:
2013-09-19 stdio: OS X port of putc_unlocked + extern inline
2013-09-19 signal: OS X port of sigaddset etc. + extern inline
2013-09-19 extern-inline: do not always suppress extern inline on OS X
2013-09-17 getgroups: statement without effect
2013-08-28 headers: check that _GL_INLINE_HEADER_BEGIN is defined
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | doc/misc/texinfo.tex | 82 | ||||
| -rw-r--r-- | lib/acl-internal.h | 3 | ||||
| -rw-r--r-- | lib/binary-io.h | 3 | ||||
| -rw-r--r-- | lib/dtotimespec.c | 30 | ||||
| -rw-r--r-- | lib/execinfo.in.h | 3 | ||||
| -rw-r--r-- | lib/getgroups.c | 2 | ||||
| -rw-r--r-- | lib/openat.h | 3 | ||||
| -rw-r--r-- | lib/signal.in.h | 14 | ||||
| -rw-r--r-- | lib/stat-time.h | 3 | ||||
| -rw-r--r-- | lib/stdio.in.h | 9 | ||||
| -rw-r--r-- | lib/timespec-add.c | 7 | ||||
| -rw-r--r-- | lib/timespec-sub.c | 7 | ||||
| -rw-r--r-- | lib/timespec.h | 3 | ||||
| -rw-r--r-- | lib/u64.h | 3 | ||||
| -rw-r--r-- | lib/unistd.in.h | 3 | ||||
| -rw-r--r-- | lib/utimens.c | 6 | ||||
| -rw-r--r-- | lib/utimens.h | 3 | ||||
| -rw-r--r-- | m4/extern-inline.m4 | 17 |
19 files changed, 153 insertions, 57 deletions
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-09-19 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Merge from gnulib, incorporating: | ||
| 4 | 2013-09-19 stdio: OS X port of putc_unlocked + extern inline | ||
| 5 | 2013-09-19 signal: OS X port of sigaddset etc. + extern inline | ||
| 6 | 2013-09-19 extern-inline: do not always suppress extern inline on OS X | ||
| 7 | 2013-09-17 getgroups: statement without effect | ||
| 8 | 2013-08-28 headers: check that _GL_INLINE_HEADER_BEGIN is defined | ||
| 9 | |||
| 1 | 2013-09-19 Eli Zaretskii <eliz@gnu.org> | 10 | 2013-09-19 Eli Zaretskii <eliz@gnu.org> |
| 2 | 11 | ||
| 3 | * configure.ac <srcdir> [MINGW32]: Make sure the value of 'srcdir' | 12 | * configure.ac <srcdir> [MINGW32]: Make sure the value of 'srcdir' |
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 9ba8c949fd1..bfd765dd211 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | % Load plain if necessary, i.e., if running under initex. | 3 | % Load plain if necessary, i.e., if running under initex. |
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
| 5 | % | 5 | % |
| 6 | \def\texinfoversion{2013-08-20.10} | 6 | \def\texinfoversion{2013-09-11.11} |
| 7 | % | 7 | % |
| 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
| 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
| @@ -322,10 +322,13 @@ | |||
| 322 | % | 322 | % |
| 323 | % Do this outside of the \shipout so @code etc. will be expanded in | 323 | % Do this outside of the \shipout so @code etc. will be expanded in |
| 324 | % the headline as they should be, not taken literally (outputting ''code). | 324 | % the headline as they should be, not taken literally (outputting ''code). |
| 325 | \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars} | ||
| 326 | % | ||
| 325 | \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi | 327 | \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi |
| 326 | \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% | 328 | \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% |
| 329 | % | ||
| 327 | \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi | 330 | \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi |
| 328 | \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% | 331 | \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% |
| 329 | % | 332 | % |
| 330 | {% | 333 | {% |
| 331 | % Have to do this stuff outside the \shipout because we want it to | 334 | % Have to do this stuff outside the \shipout because we want it to |
| @@ -2891,6 +2894,15 @@ end | |||
| 2891 | \def\inlinefmtname{#1}% | 2894 | \def\inlinefmtname{#1}% |
| 2892 | \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi | 2895 | \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi |
| 2893 | } | 2896 | } |
| 2897 | % | ||
| 2898 | % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if | ||
| 2899 | % FMTNAME is tex, else ELSE-TEXT. | ||
| 2900 | \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} | ||
| 2901 | \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{% | ||
| 2902 | \def\inlinefmtname{#1}% | ||
| 2903 | \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi | ||
| 2904 | } | ||
| 2905 | % | ||
| 2894 | % For raw, must switch into @tex before parsing the argument, to avoid | 2906 | % For raw, must switch into @tex before parsing the argument, to avoid |
| 2895 | % setting catcodes prematurely. Doing it this way means that, for | 2907 | % setting catcodes prematurely. Doing it this way means that, for |
| 2896 | % example, @inlineraw{html, foo{bar} gets a parse error instead of being | 2908 | % example, @inlineraw{html, foo{bar} gets a parse error instead of being |
| @@ -2907,6 +2919,23 @@ end | |||
| 2907 | \endgroup % close group opened by \tex. | 2919 | \endgroup % close group opened by \tex. |
| 2908 | } | 2920 | } |
| 2909 | 2921 | ||
| 2922 | % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set. | ||
| 2923 | % | ||
| 2924 | \long\def\inlineifset#1{\doinlineifset #1,\finish} | ||
| 2925 | \long\def\doinlineifset#1,#2,\finish{% | ||
| 2926 | \def\inlinevarname{#1}% | ||
| 2927 | \expandafter\ifx\csname SET\inlinevarname\endcsname\relax | ||
| 2928 | \else\ignorespaces#2\fi | ||
| 2929 | } | ||
| 2930 | |||
| 2931 | % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set. | ||
| 2932 | % | ||
| 2933 | \long\def\inlineifclear#1{\doinlineifclear #1,\finish} | ||
| 2934 | \long\def\doinlineifclear#1,#2,\finish{% | ||
| 2935 | \def\inlinevarname{#1}% | ||
| 2936 | \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi | ||
| 2937 | } | ||
| 2938 | |||
| 2910 | 2939 | ||
| 2911 | \message{glyphs,} | 2940 | \message{glyphs,} |
| 2912 | % and logos. | 2941 | % and logos. |
| @@ -4202,7 +4231,7 @@ end | |||
| 4202 | \def\value{\begingroup\makevalueexpandable\valuexxx} | 4231 | \def\value{\begingroup\makevalueexpandable\valuexxx} |
| 4203 | \def\valuexxx#1{\expandablevalue{#1}\endgroup} | 4232 | \def\valuexxx#1{\expandablevalue{#1}\endgroup} |
| 4204 | { | 4233 | { |
| 4205 | \catcode`\- = \active \catcode`\_ = \active | 4234 | \catcode`\-=\active \catcode`\_=\active |
| 4206 | % | 4235 | % |
| 4207 | \gdef\makevalueexpandable{% | 4236 | \gdef\makevalueexpandable{% |
| 4208 | \let\value = \expandablevalue | 4237 | \let\value = \expandablevalue |
| @@ -4222,7 +4251,12 @@ end | |||
| 4222 | % variable's value contains other Texinfo commands, it's almost certain | 4251 | % variable's value contains other Texinfo commands, it's almost certain |
| 4223 | % it will fail (although perhaps we could fix that with sufficient work | 4252 | % it will fail (although perhaps we could fix that with sufficient work |
| 4224 | % to do a one-level expansion on the result, instead of complete). | 4253 | % to do a one-level expansion on the result, instead of complete). |
| 4225 | % | 4254 | % |
| 4255 | % Unfortunately, this has the consequence that when _ is in the *value* | ||
| 4256 | % of an @set, it does not print properly in the roman fonts (get the cmr | ||
| 4257 | % dot accent at position 126 instead). No fix comes to mind, and it's | ||
| 4258 | % been this way since 2003 or earlier, so just ignore it. | ||
| 4259 | % | ||
| 4226 | \def\expandablevalue#1{% | 4260 | \def\expandablevalue#1{% |
| 4227 | \expandafter\ifx\csname SET#1\endcsname\relax | 4261 | \expandafter\ifx\csname SET#1\endcsname\relax |
| 4228 | {[No value for ``#1'']}% | 4262 | {[No value for ``#1'']}% |
| @@ -6276,8 +6310,8 @@ end | |||
| 6276 | \catcode `\|=\other | 6310 | \catcode `\|=\other |
| 6277 | \catcode `\<=\other | 6311 | \catcode `\<=\other |
| 6278 | \catcode `\>=\other | 6312 | \catcode `\>=\other |
| 6279 | \catcode`\`=\other | 6313 | \catcode `\`=\other |
| 6280 | \catcode`\'=\other | 6314 | \catcode `\'=\other |
| 6281 | \escapechar=`\\ | 6315 | \escapechar=`\\ |
| 6282 | % | 6316 | % |
| 6283 | % ' is active in math mode (mathcode"8000). So reset it, and all our | 6317 | % ' is active in math mode (mathcode"8000). So reset it, and all our |
| @@ -6301,7 +6335,7 @@ end | |||
| 6301 | \let\/=\ptexslash | 6335 | \let\/=\ptexslash |
| 6302 | \let\*=\ptexstar | 6336 | \let\*=\ptexstar |
| 6303 | \let\t=\ptext | 6337 | \let\t=\ptext |
| 6304 | \expandafter \let\csname top\endcsname=\ptextop % outer | 6338 | \expandafter \let\csname top\endcsname=\ptextop % we've made it outer |
| 6305 | \let\frenchspacing=\plainfrenchspacing | 6339 | \let\frenchspacing=\plainfrenchspacing |
| 6306 | % | 6340 | % |
| 6307 | \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% | 6341 | \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% |
| @@ -9944,11 +9978,9 @@ directory should work if nowhere else does.} | |||
| 9944 | \catcode`\"=\active | 9978 | \catcode`\"=\active |
| 9945 | \def\activedoublequote{{\tt\char34}} | 9979 | \def\activedoublequote{{\tt\char34}} |
| 9946 | \let"=\activedoublequote | 9980 | \let"=\activedoublequote |
| 9947 | \catcode`\~=\active | 9981 | \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde |
| 9948 | \def~{{\tt\char126}} | ||
| 9949 | \chardef\hat=`\^ | 9982 | \chardef\hat=`\^ |
| 9950 | \catcode`\^=\active | 9983 | \catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat |
| 9951 | \def^{{\tt \hat}} | ||
| 9952 | 9984 | ||
| 9953 | \catcode`\_=\active | 9985 | \catcode`\_=\active |
| 9954 | \def_{\ifusingtt\normalunderscore\_} | 9986 | \def_{\ifusingtt\normalunderscore\_} |
| @@ -9958,16 +9990,26 @@ directory should work if nowhere else does.} | |||
| 9958 | 9990 | ||
| 9959 | \catcode`\|=\active | 9991 | \catcode`\|=\active |
| 9960 | \def|{{\tt\char124}} | 9992 | \def|{{\tt\char124}} |
| 9993 | |||
| 9961 | \chardef \less=`\< | 9994 | \chardef \less=`\< |
| 9962 | \catcode`\<=\active | 9995 | \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless |
| 9963 | \def<{{\tt \less}} | ||
| 9964 | \chardef \gtr=`\> | 9996 | \chardef \gtr=`\> |
| 9965 | \catcode`\>=\active | 9997 | \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr |
| 9966 | \def>{{\tt \gtr}} | 9998 | \catcode`\+=\active \def+{{\tt \char 43}} |
| 9967 | \catcode`\+=\active | 9999 | \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix |
| 9968 | \def+{{\tt \char 43}} | 10000 | |
| 9969 | \catcode`\$=\active | 10001 | % used for headline/footline in the output routine, in case the page |
| 9970 | \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix | 10002 | % breaks in the middle of an @tex block. |
| 10003 | \def\texinfochars{% | ||
| 10004 | \let< = \activeless | ||
| 10005 | \let> = \activegtr | ||
| 10006 | \let~ = \activetilde | ||
| 10007 | \let^ = \activehat | ||
| 10008 | \markupsetuplqdefault \markupsetuprqdefault | ||
| 10009 | \let\b = \strong | ||
| 10010 | \let\i = \smartitalic | ||
| 10011 | % in principle, all other definitions in \tex have to be undone too. | ||
| 10012 | } | ||
| 9971 | 10013 | ||
| 9972 | % If a .fmt file is being used, characters that might appear in a file | 10014 | % If a .fmt file is being used, characters that might appear in a file |
| 9973 | % name cannot be active until we have parsed the command line. | 10015 | % name cannot be active until we have parsed the command line. |
diff --git a/lib/acl-internal.h b/lib/acl-internal.h index 7e6d77a5fd4..55c224ca883 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h | |||
| @@ -60,6 +60,9 @@ extern int aclsort (int, int, struct acl *); | |||
| 60 | # define fchmod(fd, mode) (-1) | 60 | # define fchmod(fd, mode) (-1) |
| 61 | #endif | 61 | #endif |
| 62 | 62 | ||
| 63 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 64 | #error "Please include config.h first." | ||
| 65 | #endif | ||
| 63 | _GL_INLINE_HEADER_BEGIN | 66 | _GL_INLINE_HEADER_BEGIN |
| 64 | #ifndef ACL_INTERNAL_INLINE | 67 | #ifndef ACL_INTERNAL_INLINE |
| 65 | # define ACL_INTERNAL_INLINE _GL_INLINE | 68 | # define ACL_INTERNAL_INLINE _GL_INLINE |
diff --git a/lib/binary-io.h b/lib/binary-io.h index 317fe3d3c20..423c2ae3fff 100644 --- a/lib/binary-io.h +++ b/lib/binary-io.h | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | so we include it here first. */ | 25 | so we include it here first. */ |
| 26 | #include <stdio.h> | 26 | #include <stdio.h> |
| 27 | 27 | ||
| 28 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 29 | #error "Please include config.h first." | ||
| 30 | #endif | ||
| 28 | _GL_INLINE_HEADER_BEGIN | 31 | _GL_INLINE_HEADER_BEGIN |
| 29 | #ifndef BINARY_IO_INLINE | 32 | #ifndef BINARY_IO_INLINE |
| 30 | # define BINARY_IO_INLINE _GL_INLINE | 33 | # define BINARY_IO_INLINE _GL_INLINE |
diff --git a/lib/dtotimespec.c b/lib/dtotimespec.c index ecce2e5bcc5..064f7d3a0a9 100644 --- a/lib/dtotimespec.c +++ b/lib/dtotimespec.c | |||
| @@ -29,41 +29,31 @@ | |||
| 29 | struct timespec | 29 | struct timespec |
| 30 | dtotimespec (double sec) | 30 | dtotimespec (double sec) |
| 31 | { | 31 | { |
| 32 | enum { BILLION = 1000 * 1000 * 1000 }; | ||
| 33 | double min_representable = TYPE_MINIMUM (time_t); | 32 | double min_representable = TYPE_MINIMUM (time_t); |
| 34 | double max_representable = | 33 | double max_representable = |
| 35 | ((TYPE_MAXIMUM (time_t) * (double) BILLION + (BILLION - 1)) | 34 | ((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION |
| 36 | / BILLION); | 35 | + (TIMESPEC_RESOLUTION - 1)) |
| 37 | struct timespec r; | 36 | / TIMESPEC_RESOLUTION); |
| 38 | 37 | ||
| 39 | if (! (min_representable < sec)) | 38 | if (! (min_representable < sec)) |
| 40 | { | 39 | return make_timespec (TYPE_MINIMUM (time_t), 0); |
| 41 | r.tv_sec = TYPE_MINIMUM (time_t); | ||
| 42 | r.tv_nsec = 0; | ||
| 43 | } | ||
| 44 | else if (! (sec < max_representable)) | 40 | else if (! (sec < max_representable)) |
| 45 | { | 41 | return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1); |
| 46 | r.tv_sec = TYPE_MAXIMUM (time_t); | ||
| 47 | r.tv_nsec = BILLION - 1; | ||
| 48 | } | ||
| 49 | else | 42 | else |
| 50 | { | 43 | { |
| 51 | time_t s = sec; | 44 | time_t s = sec; |
| 52 | double frac = BILLION * (sec - s); | 45 | double frac = TIMESPEC_RESOLUTION * (sec - s); |
| 53 | long ns = frac; | 46 | long ns = frac; |
| 54 | ns += ns < frac; | 47 | ns += ns < frac; |
| 55 | s += ns / BILLION; | 48 | s += ns / TIMESPEC_RESOLUTION; |
| 56 | ns %= BILLION; | 49 | ns %= TIMESPEC_RESOLUTION; |
| 57 | 50 | ||
| 58 | if (ns < 0) | 51 | if (ns < 0) |
| 59 | { | 52 | { |
| 60 | s--; | 53 | s--; |
| 61 | ns += BILLION; | 54 | ns += TIMESPEC_RESOLUTION; |
| 62 | } | 55 | } |
| 63 | 56 | ||
| 64 | r.tv_sec = s; | 57 | return make_timespec (s, ns); |
| 65 | r.tv_nsec = ns; | ||
| 66 | } | 58 | } |
| 67 | |||
| 68 | return r; | ||
| 69 | } | 59 | } |
diff --git a/lib/execinfo.in.h b/lib/execinfo.in.h index 6cfc8d56d2d..344f26add2b 100644 --- a/lib/execinfo.in.h +++ b/lib/execinfo.in.h | |||
| @@ -20,6 +20,9 @@ | |||
| 20 | #ifndef _GL_EXECINFO_H | 20 | #ifndef _GL_EXECINFO_H |
| 21 | #define _GL_EXECINFO_H | 21 | #define _GL_EXECINFO_H |
| 22 | 22 | ||
| 23 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 24 | #error "Please include config.h first." | ||
| 25 | #endif | ||
| 23 | _GL_INLINE_HEADER_BEGIN | 26 | _GL_INLINE_HEADER_BEGIN |
| 24 | #ifndef _GL_EXECINFO_INLINE | 27 | #ifndef _GL_EXECINFO_INLINE |
| 25 | # define _GL_EXECINFO_INLINE _GL_INLINE | 28 | # define _GL_EXECINFO_INLINE _GL_INLINE |
diff --git a/lib/getgroups.c b/lib/getgroups.c index 9856adc1a4d..e71b5439c7e 100644 --- a/lib/getgroups.c +++ b/lib/getgroups.c | |||
| @@ -86,7 +86,7 @@ rpl_getgroups (int n, gid_t *group) | |||
| 86 | } | 86 | } |
| 87 | saved_errno = errno; | 87 | saved_errno = errno; |
| 88 | free (gbuf); | 88 | free (gbuf); |
| 89 | errno == saved_errno; | 89 | errno = saved_errno; |
| 90 | return result; | 90 | return result; |
| 91 | } | 91 | } |
| 92 | 92 | ||
diff --git a/lib/openat.h b/lib/openat.h index eb90990da1d..7208f4459fe 100644 --- a/lib/openat.h +++ b/lib/openat.h | |||
| @@ -26,6 +26,9 @@ | |||
| 26 | #include <unistd.h> | 26 | #include <unistd.h> |
| 27 | #include <stdbool.h> | 27 | #include <stdbool.h> |
| 28 | 28 | ||
| 29 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 30 | #error "Please include config.h first." | ||
| 31 | #endif | ||
| 29 | _GL_INLINE_HEADER_BEGIN | 32 | _GL_INLINE_HEADER_BEGIN |
| 30 | 33 | ||
| 31 | #if !HAVE_OPENAT | 34 | #if !HAVE_OPENAT |
diff --git a/lib/signal.in.h b/lib/signal.in.h index 54849504d77..a531487e355 100644 --- a/lib/signal.in.h +++ b/lib/signal.in.h | |||
| @@ -195,6 +195,20 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1]; | |||
| 195 | 195 | ||
| 196 | # endif | 196 | # endif |
| 197 | 197 | ||
| 198 | /* When also using extern inline, suppress the use of static inline in | ||
| 199 | standard headers of problematic Apple configurations, as Libc at | ||
| 200 | least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., | ||
| 201 | <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. | ||
| 202 | Perhaps Apple will fix this some day. */ | ||
| 203 | #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ | ||
| 204 | && (defined __i386__ || defined __x86_64__)) | ||
| 205 | # undef sigaddset | ||
| 206 | # undef sigdelset | ||
| 207 | # undef sigemptyset | ||
| 208 | # undef sigfillset | ||
| 209 | # undef sigismember | ||
| 210 | #endif | ||
| 211 | |||
| 198 | /* Test whether a given signal is contained in a signal set. */ | 212 | /* Test whether a given signal is contained in a signal set. */ |
| 199 | # if @HAVE_POSIX_SIGNALBLOCKING@ | 213 | # if @HAVE_POSIX_SIGNALBLOCKING@ |
| 200 | /* This function is defined as a macro on Mac OS X. */ | 214 | /* This function is defined as a macro on Mac OS X. */ |
diff --git a/lib/stat-time.h b/lib/stat-time.h index 2d3b5cd6514..d58eddde334 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h | |||
| @@ -23,6 +23,9 @@ | |||
| 23 | #include <sys/stat.h> | 23 | #include <sys/stat.h> |
| 24 | #include <time.h> | 24 | #include <time.h> |
| 25 | 25 | ||
| 26 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 27 | #error "Please include config.h first." | ||
| 28 | #endif | ||
| 26 | _GL_INLINE_HEADER_BEGIN | 29 | _GL_INLINE_HEADER_BEGIN |
| 27 | #ifndef _GL_STAT_TIME_INLINE | 30 | #ifndef _GL_STAT_TIME_INLINE |
| 28 | # define _GL_STAT_TIME_INLINE _GL_INLINE | 31 | # define _GL_STAT_TIME_INLINE _GL_INLINE |
diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 06cbad00d3d..76e62fba6ba 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h | |||
| @@ -124,6 +124,15 @@ | |||
| 124 | #define _GL_STDIO_STRINGIZE(token) #token | 124 | #define _GL_STDIO_STRINGIZE(token) #token |
| 125 | #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token) | 125 | #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token) |
| 126 | 126 | ||
| 127 | /* When also using extern inline, suppress the use of static inline in | ||
| 128 | standard headers of problematic Apple configurations, as Libc at | ||
| 129 | least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., | ||
| 130 | <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. | ||
| 131 | Perhaps Apple will fix this some day. */ | ||
| 132 | #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ | ||
| 133 | && defined __GNUC__ && defined __STDC__) | ||
| 134 | # undef putc_unlocked | ||
| 135 | #endif | ||
| 127 | 136 | ||
| 128 | #if @GNULIB_DPRINTF@ | 137 | #if @GNULIB_DPRINTF@ |
| 129 | # if @REPLACE_DPRINTF@ | 138 | # if @REPLACE_DPRINTF@ |
diff --git a/lib/timespec-add.c b/lib/timespec-add.c index 6ce2c73064f..51323a63207 100644 --- a/lib/timespec-add.c +++ b/lib/timespec-add.c | |||
| @@ -28,11 +28,10 @@ | |||
| 28 | struct timespec | 28 | struct timespec |
| 29 | timespec_add (struct timespec a, struct timespec b) | 29 | timespec_add (struct timespec a, struct timespec b) |
| 30 | { | 30 | { |
| 31 | struct timespec r; | ||
| 32 | time_t rs = a.tv_sec; | 31 | time_t rs = a.tv_sec; |
| 33 | time_t bs = b.tv_sec; | 32 | time_t bs = b.tv_sec; |
| 34 | int ns = a.tv_nsec + b.tv_nsec; | 33 | int ns = a.tv_nsec + b.tv_nsec; |
| 35 | int nsd = ns - 1000000000; | 34 | int nsd = ns - TIMESPEC_RESOLUTION; |
| 36 | int rns = ns; | 35 | int rns = ns; |
| 37 | 36 | ||
| 38 | if (0 <= nsd) | 37 | if (0 <= nsd) |
| @@ -65,7 +64,5 @@ timespec_add (struct timespec a, struct timespec b) | |||
| 65 | else | 64 | else |
| 66 | rs += bs; | 65 | rs += bs; |
| 67 | 66 | ||
| 68 | r.tv_sec = rs; | 67 | return make_timespec (rs, rns); |
| 69 | r.tv_nsec = rns; | ||
| 70 | return r; | ||
| 71 | } | 68 | } |
diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c index 97c9f9de88c..b164a8380d0 100644 --- a/lib/timespec-sub.c +++ b/lib/timespec-sub.c | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | struct timespec | 29 | struct timespec |
| 30 | timespec_sub (struct timespec a, struct timespec b) | 30 | timespec_sub (struct timespec a, struct timespec b) |
| 31 | { | 31 | { |
| 32 | struct timespec r; | ||
| 33 | time_t rs = a.tv_sec; | 32 | time_t rs = a.tv_sec; |
| 34 | time_t bs = b.tv_sec; | 33 | time_t bs = b.tv_sec; |
| 35 | int ns = a.tv_nsec - b.tv_nsec; | 34 | int ns = a.tv_nsec - b.tv_nsec; |
| @@ -37,7 +36,7 @@ timespec_sub (struct timespec a, struct timespec b) | |||
| 37 | 36 | ||
| 38 | if (ns < 0) | 37 | if (ns < 0) |
| 39 | { | 38 | { |
| 40 | rns = ns + 1000000000; | 39 | rns = ns + TIMESPEC_RESOLUTION; |
| 41 | if (rs == TYPE_MINIMUM (time_t)) | 40 | if (rs == TYPE_MINIMUM (time_t)) |
| 42 | { | 41 | { |
| 43 | if (bs <= 0) | 42 | if (bs <= 0) |
| @@ -65,7 +64,5 @@ timespec_sub (struct timespec a, struct timespec b) | |||
| 65 | else | 64 | else |
| 66 | rs -= bs; | 65 | rs -= bs; |
| 67 | 66 | ||
| 68 | r.tv_sec = rs; | 67 | return make_timespec (rs, rns); |
| 69 | r.tv_nsec = rns; | ||
| 70 | return r; | ||
| 71 | } | 68 | } |
diff --git a/lib/timespec.h b/lib/timespec.h index c7450ad8de0..d0c029b5704 100644 --- a/lib/timespec.h +++ b/lib/timespec.h | |||
| @@ -21,6 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | # include <time.h> | 22 | # include <time.h> |
| 23 | 23 | ||
| 24 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 25 | #error "Please include config.h first." | ||
| 26 | #endif | ||
| 24 | _GL_INLINE_HEADER_BEGIN | 27 | _GL_INLINE_HEADER_BEGIN |
| 25 | #ifndef _GL_TIMESPEC_INLINE | 28 | #ifndef _GL_TIMESPEC_INLINE |
| 26 | # define _GL_TIMESPEC_INLINE _GL_INLINE | 29 | # define _GL_TIMESPEC_INLINE _GL_INLINE |
| @@ -19,6 +19,9 @@ | |||
| 19 | 19 | ||
| 20 | #include <stdint.h> | 20 | #include <stdint.h> |
| 21 | 21 | ||
| 22 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 23 | #error "Please include config.h first." | ||
| 24 | #endif | ||
| 22 | _GL_INLINE_HEADER_BEGIN | 25 | _GL_INLINE_HEADER_BEGIN |
| 23 | #ifndef _GL_U64_INLINE | 26 | #ifndef _GL_U64_INLINE |
| 24 | # define _GL_U64_INLINE _GL_INLINE | 27 | # define _GL_U64_INLINE _GL_INLINE |
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 2ea9af43652..874c628a63b 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h | |||
| @@ -116,6 +116,9 @@ | |||
| 116 | # include <getopt.h> | 116 | # include <getopt.h> |
| 117 | #endif | 117 | #endif |
| 118 | 118 | ||
| 119 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 120 | #error "Please include config.h first." | ||
| 121 | #endif | ||
| 119 | _GL_INLINE_HEADER_BEGIN | 122 | _GL_INLINE_HEADER_BEGIN |
| 120 | #ifndef _GL_UNISTD_INLINE | 123 | #ifndef _GL_UNISTD_INLINE |
| 121 | # define _GL_UNISTD_INLINE _GL_INLINE | 124 | # define _GL_UNISTD_INLINE _GL_INLINE |
diff --git a/lib/utimens.c b/lib/utimens.c index 013843d6da4..44a33c1d791 100644 --- a/lib/utimens.c +++ b/lib/utimens.c | |||
| @@ -90,10 +90,12 @@ validate_timespec (struct timespec timespec[2]) | |||
| 90 | assert (timespec); | 90 | assert (timespec); |
| 91 | if ((timespec[0].tv_nsec != UTIME_NOW | 91 | if ((timespec[0].tv_nsec != UTIME_NOW |
| 92 | && timespec[0].tv_nsec != UTIME_OMIT | 92 | && timespec[0].tv_nsec != UTIME_OMIT |
| 93 | && (timespec[0].tv_nsec < 0 || 1000000000 <= timespec[0].tv_nsec)) | 93 | && ! (0 <= timespec[0].tv_nsec |
| 94 | && timespec[0].tv_nsec < TIMESPEC_RESOLUTION)) | ||
| 94 | || (timespec[1].tv_nsec != UTIME_NOW | 95 | || (timespec[1].tv_nsec != UTIME_NOW |
| 95 | && timespec[1].tv_nsec != UTIME_OMIT | 96 | && timespec[1].tv_nsec != UTIME_OMIT |
| 96 | && (timespec[1].tv_nsec < 0 || 1000000000 <= timespec[1].tv_nsec))) | 97 | && ! (0 <= timespec[1].tv_nsec |
| 98 | && timespec[1].tv_nsec < TIMESPEC_RESOLUTION))) | ||
| 97 | { | 99 | { |
| 98 | errno = EINVAL; | 100 | errno = EINVAL; |
| 99 | return -1; | 101 | return -1; |
diff --git a/lib/utimens.h b/lib/utimens.h index 82a72a7a451..f1633c966aa 100644 --- a/lib/utimens.h +++ b/lib/utimens.h | |||
| @@ -26,6 +26,9 @@ int lutimens (char const *, struct timespec const [2]); | |||
| 26 | # include <fcntl.h> | 26 | # include <fcntl.h> |
| 27 | # include <sys/stat.h> | 27 | # include <sys/stat.h> |
| 28 | 28 | ||
| 29 | #ifndef _GL_INLINE_HEADER_BEGIN | ||
| 30 | #error "Please include config.h first." | ||
| 31 | #endif | ||
| 29 | _GL_INLINE_HEADER_BEGIN | 32 | _GL_INLINE_HEADER_BEGIN |
| 30 | #ifndef _GL_UTIMENS_INLINE | 33 | #ifndef _GL_UTIMENS_INLINE |
| 31 | # define _GL_UTIMENS_INLINE _GL_INLINE | 34 | # define _GL_UTIMENS_INLINE _GL_INLINE |
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index c4c5e7f221b..4862d60d8e7 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 | |||
| @@ -19,20 +19,28 @@ AC_DEFUN([gl_EXTERN_INLINE], | |||
| 19 | 'reference to static identifier "f" in extern inline function'. | 19 | 'reference to static identifier "f" in extern inline function'. |
| 20 | This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. | 20 | This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. |
| 21 | 21 | ||
| 22 | Suppress the use of extern inline on Apple's platforms, as Libc at least | 22 | Suppress the use of extern inline on problematic Apple configurations, as |
| 23 | through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g., | 23 | Libc at least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., |
| 24 | <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. | 24 | <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. |
| 25 | Perhaps Apple will fix this some day. */ | 25 | Perhaps Apple will fix this some day. */ |
| 26 | #if (defined __APPLE__ \ | ||
| 27 | && ((! defined _DONT_USE_CTYPE_INLINE_ \ | ||
| 28 | && (defined __GNUC__ || defined __cplusplus)) \ | ||
| 29 | || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \ | ||
| 30 | && defined __GNUC__ && ! defined __cplusplus))) | ||
| 31 | # define _GL_EXTERN_INLINE_APPLE_BUG | ||
| 32 | #endif | ||
| 26 | #if ((__GNUC__ \ | 33 | #if ((__GNUC__ \ |
| 27 | ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ | 34 | ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ |
| 28 | : (199901L <= __STDC_VERSION__ \ | 35 | : (199901L <= __STDC_VERSION__ \ |
| 29 | && !defined __HP_cc \ | 36 | && !defined __HP_cc \ |
| 30 | && !(defined __SUNPRO_C && __STDC__))) \ | 37 | && !(defined __SUNPRO_C && __STDC__))) \ |
| 31 | && !defined __APPLE__) | 38 | && !defined _GL_EXTERN_INLINE_APPLE_BUG) |
| 32 | # define _GL_INLINE inline | 39 | # define _GL_INLINE inline |
| 33 | # define _GL_EXTERN_INLINE extern inline | 40 | # define _GL_EXTERN_INLINE extern inline |
| 41 | # define _GL_EXTERN_INLINE_IN_USE | ||
| 34 | #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ | 42 | #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ |
| 35 | && !defined __APPLE__) | 43 | && !defined _GL_EXTERN_INLINE_APPLE_BUG) |
| 36 | # if __GNUC_GNU_INLINE__ | 44 | # if __GNUC_GNU_INLINE__ |
| 37 | /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ | 45 | /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ |
| 38 | # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) | 46 | # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) |
| @@ -40,6 +48,7 @@ AC_DEFUN([gl_EXTERN_INLINE], | |||
| 40 | # define _GL_INLINE extern inline | 48 | # define _GL_INLINE extern inline |
| 41 | # endif | 49 | # endif |
| 42 | # define _GL_EXTERN_INLINE extern | 50 | # define _GL_EXTERN_INLINE extern |
| 51 | # define _GL_EXTERN_INLINE_IN_USE | ||
| 43 | #else | 52 | #else |
| 44 | # define _GL_INLINE static _GL_UNUSED | 53 | # define _GL_INLINE static _GL_UNUSED |
| 45 | # define _GL_EXTERN_INLINE static _GL_UNUSED | 54 | # define _GL_EXTERN_INLINE static _GL_UNUSED |