mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 03:13:24 +00:00
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
This commit is contained in:
parent
c39cc7d149
commit
230fe2a5a1
19 changed files with 153 additions and 57 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2013-09-19 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
Merge from gnulib, incorporating:
|
||||||
|
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
|
||||||
|
|
||||||
2013-09-19 Eli Zaretskii <eliz@gnu.org>
|
2013-09-19 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
* configure.ac <srcdir> [MINGW32]: Make sure the value of 'srcdir'
|
* configure.ac <srcdir> [MINGW32]: Make sure the value of 'srcdir'
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
% Load plain if necessary, i.e., if running under initex.
|
% Load plain if necessary, i.e., if running under initex.
|
||||||
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
||||||
%
|
%
|
||||||
\def\texinfoversion{2013-08-20.10}
|
\def\texinfoversion{2013-09-11.11}
|
||||||
%
|
%
|
||||||
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
|
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||||
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||||
|
@ -322,10 +322,13 @@
|
||||||
%
|
%
|
||||||
% Do this outside of the \shipout so @code etc. will be expanded in
|
% Do this outside of the \shipout so @code etc. will be expanded in
|
||||||
% the headline as they should be, not taken literally (outputting ''code).
|
% the headline as they should be, not taken literally (outputting ''code).
|
||||||
|
\def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
|
||||||
|
%
|
||||||
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
|
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
|
||||||
\setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
|
\global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
|
||||||
|
%
|
||||||
\ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
|
\ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
|
||||||
\setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
|
\global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
|
||||||
%
|
%
|
||||||
{%
|
{%
|
||||||
% Have to do this stuff outside the \shipout because we want it to
|
% Have to do this stuff outside the \shipout because we want it to
|
||||||
|
@ -2891,6 +2894,15 @@
|
||||||
\def\inlinefmtname{#1}%
|
\def\inlinefmtname{#1}%
|
||||||
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
|
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
|
||||||
}
|
}
|
||||||
|
%
|
||||||
|
% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
|
||||||
|
% FMTNAME is tex, else ELSE-TEXT.
|
||||||
|
\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
|
||||||
|
\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
|
||||||
|
\def\inlinefmtname{#1}%
|
||||||
|
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
|
||||||
|
}
|
||||||
|
%
|
||||||
% For raw, must switch into @tex before parsing the argument, to avoid
|
% For raw, must switch into @tex before parsing the argument, to avoid
|
||||||
% setting catcodes prematurely. Doing it this way means that, for
|
% setting catcodes prematurely. Doing it this way means that, for
|
||||||
% example, @inlineraw{html, foo{bar} gets a parse error instead of being
|
% example, @inlineraw{html, foo{bar} gets a parse error instead of being
|
||||||
|
@ -2907,6 +2919,23 @@
|
||||||
\endgroup % close group opened by \tex.
|
\endgroup % close group opened by \tex.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
|
||||||
|
%
|
||||||
|
\long\def\inlineifset#1{\doinlineifset #1,\finish}
|
||||||
|
\long\def\doinlineifset#1,#2,\finish{%
|
||||||
|
\def\inlinevarname{#1}%
|
||||||
|
\expandafter\ifx\csname SET\inlinevarname\endcsname\relax
|
||||||
|
\else\ignorespaces#2\fi
|
||||||
|
}
|
||||||
|
|
||||||
|
% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
|
||||||
|
%
|
||||||
|
\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
|
||||||
|
\long\def\doinlineifclear#1,#2,\finish{%
|
||||||
|
\def\inlinevarname{#1}%
|
||||||
|
\expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
\message{glyphs,}
|
\message{glyphs,}
|
||||||
% and logos.
|
% and logos.
|
||||||
|
@ -4202,7 +4231,7 @@
|
||||||
\def\value{\begingroup\makevalueexpandable\valuexxx}
|
\def\value{\begingroup\makevalueexpandable\valuexxx}
|
||||||
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
|
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
|
||||||
{
|
{
|
||||||
\catcode`\- = \active \catcode`\_ = \active
|
\catcode`\-=\active \catcode`\_=\active
|
||||||
%
|
%
|
||||||
\gdef\makevalueexpandable{%
|
\gdef\makevalueexpandable{%
|
||||||
\let\value = \expandablevalue
|
\let\value = \expandablevalue
|
||||||
|
@ -4222,7 +4251,12 @@
|
||||||
% variable's value contains other Texinfo commands, it's almost certain
|
% variable's value contains other Texinfo commands, it's almost certain
|
||||||
% it will fail (although perhaps we could fix that with sufficient work
|
% it will fail (although perhaps we could fix that with sufficient work
|
||||||
% to do a one-level expansion on the result, instead of complete).
|
% to do a one-level expansion on the result, instead of complete).
|
||||||
%
|
%
|
||||||
|
% Unfortunately, this has the consequence that when _ is in the *value*
|
||||||
|
% of an @set, it does not print properly in the roman fonts (get the cmr
|
||||||
|
% dot accent at position 126 instead). No fix comes to mind, and it's
|
||||||
|
% been this way since 2003 or earlier, so just ignore it.
|
||||||
|
%
|
||||||
\def\expandablevalue#1{%
|
\def\expandablevalue#1{%
|
||||||
\expandafter\ifx\csname SET#1\endcsname\relax
|
\expandafter\ifx\csname SET#1\endcsname\relax
|
||||||
{[No value for ``#1'']}%
|
{[No value for ``#1'']}%
|
||||||
|
@ -6276,8 +6310,8 @@
|
||||||
\catcode `\|=\other
|
\catcode `\|=\other
|
||||||
\catcode `\<=\other
|
\catcode `\<=\other
|
||||||
\catcode `\>=\other
|
\catcode `\>=\other
|
||||||
\catcode`\`=\other
|
\catcode `\`=\other
|
||||||
\catcode`\'=\other
|
\catcode `\'=\other
|
||||||
\escapechar=`\\
|
\escapechar=`\\
|
||||||
%
|
%
|
||||||
% ' is active in math mode (mathcode"8000). So reset it, and all our
|
% ' is active in math mode (mathcode"8000). So reset it, and all our
|
||||||
|
@ -6301,7 +6335,7 @@
|
||||||
\let\/=\ptexslash
|
\let\/=\ptexslash
|
||||||
\let\*=\ptexstar
|
\let\*=\ptexstar
|
||||||
\let\t=\ptext
|
\let\t=\ptext
|
||||||
\expandafter \let\csname top\endcsname=\ptextop % outer
|
\expandafter \let\csname top\endcsname=\ptextop % we've made it outer
|
||||||
\let\frenchspacing=\plainfrenchspacing
|
\let\frenchspacing=\plainfrenchspacing
|
||||||
%
|
%
|
||||||
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
|
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
|
||||||
|
@ -9944,11 +9978,9 @@
|
||||||
\catcode`\"=\active
|
\catcode`\"=\active
|
||||||
\def\activedoublequote{{\tt\char34}}
|
\def\activedoublequote{{\tt\char34}}
|
||||||
\let"=\activedoublequote
|
\let"=\activedoublequote
|
||||||
\catcode`\~=\active
|
\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
|
||||||
\def~{{\tt\char126}}
|
|
||||||
\chardef\hat=`\^
|
\chardef\hat=`\^
|
||||||
\catcode`\^=\active
|
\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat
|
||||||
\def^{{\tt \hat}}
|
|
||||||
|
|
||||||
\catcode`\_=\active
|
\catcode`\_=\active
|
||||||
\def_{\ifusingtt\normalunderscore\_}
|
\def_{\ifusingtt\normalunderscore\_}
|
||||||
|
@ -9958,16 +9990,26 @@
|
||||||
|
|
||||||
\catcode`\|=\active
|
\catcode`\|=\active
|
||||||
\def|{{\tt\char124}}
|
\def|{{\tt\char124}}
|
||||||
|
|
||||||
\chardef \less=`\<
|
\chardef \less=`\<
|
||||||
\catcode`\<=\active
|
\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
|
||||||
\def<{{\tt \less}}
|
|
||||||
\chardef \gtr=`\>
|
\chardef \gtr=`\>
|
||||||
\catcode`\>=\active
|
\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
|
||||||
\def>{{\tt \gtr}}
|
\catcode`\+=\active \def+{{\tt \char 43}}
|
||||||
\catcode`\+=\active
|
\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
|
||||||
\def+{{\tt \char 43}}
|
|
||||||
\catcode`\$=\active
|
% used for headline/footline in the output routine, in case the page
|
||||||
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
|
% breaks in the middle of an @tex block.
|
||||||
|
\def\texinfochars{%
|
||||||
|
\let< = \activeless
|
||||||
|
\let> = \activegtr
|
||||||
|
\let~ = \activetilde
|
||||||
|
\let^ = \activehat
|
||||||
|
\markupsetuplqdefault \markupsetuprqdefault
|
||||||
|
\let\b = \strong
|
||||||
|
\let\i = \smartitalic
|
||||||
|
% in principle, all other definitions in \tex have to be undone too.
|
||||||
|
}
|
||||||
|
|
||||||
% If a .fmt file is being used, characters that might appear in a file
|
% If a .fmt file is being used, characters that might appear in a file
|
||||||
% name cannot be active until we have parsed the command line.
|
% name cannot be active until we have parsed the command line.
|
||||||
|
|
|
@ -60,6 +60,9 @@ extern int aclsort (int, int, struct acl *);
|
||||||
# define fchmod(fd, mode) (-1)
|
# define fchmod(fd, mode) (-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef ACL_INTERNAL_INLINE
|
#ifndef ACL_INTERNAL_INLINE
|
||||||
# define ACL_INTERNAL_INLINE _GL_INLINE
|
# define ACL_INTERNAL_INLINE _GL_INLINE
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
so we include it here first. */
|
so we include it here first. */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef BINARY_IO_INLINE
|
#ifndef BINARY_IO_INLINE
|
||||||
# define BINARY_IO_INLINE _GL_INLINE
|
# define BINARY_IO_INLINE _GL_INLINE
|
||||||
|
|
|
@ -29,41 +29,31 @@
|
||||||
struct timespec
|
struct timespec
|
||||||
dtotimespec (double sec)
|
dtotimespec (double sec)
|
||||||
{
|
{
|
||||||
enum { BILLION = 1000 * 1000 * 1000 };
|
|
||||||
double min_representable = TYPE_MINIMUM (time_t);
|
double min_representable = TYPE_MINIMUM (time_t);
|
||||||
double max_representable =
|
double max_representable =
|
||||||
((TYPE_MAXIMUM (time_t) * (double) BILLION + (BILLION - 1))
|
((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION
|
||||||
/ BILLION);
|
+ (TIMESPEC_RESOLUTION - 1))
|
||||||
struct timespec r;
|
/ TIMESPEC_RESOLUTION);
|
||||||
|
|
||||||
if (! (min_representable < sec))
|
if (! (min_representable < sec))
|
||||||
{
|
return make_timespec (TYPE_MINIMUM (time_t), 0);
|
||||||
r.tv_sec = TYPE_MINIMUM (time_t);
|
|
||||||
r.tv_nsec = 0;
|
|
||||||
}
|
|
||||||
else if (! (sec < max_representable))
|
else if (! (sec < max_representable))
|
||||||
{
|
return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1);
|
||||||
r.tv_sec = TYPE_MAXIMUM (time_t);
|
|
||||||
r.tv_nsec = BILLION - 1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
time_t s = sec;
|
time_t s = sec;
|
||||||
double frac = BILLION * (sec - s);
|
double frac = TIMESPEC_RESOLUTION * (sec - s);
|
||||||
long ns = frac;
|
long ns = frac;
|
||||||
ns += ns < frac;
|
ns += ns < frac;
|
||||||
s += ns / BILLION;
|
s += ns / TIMESPEC_RESOLUTION;
|
||||||
ns %= BILLION;
|
ns %= TIMESPEC_RESOLUTION;
|
||||||
|
|
||||||
if (ns < 0)
|
if (ns < 0)
|
||||||
{
|
{
|
||||||
s--;
|
s--;
|
||||||
ns += BILLION;
|
ns += TIMESPEC_RESOLUTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
r.tv_sec = s;
|
return make_timespec (s, ns);
|
||||||
r.tv_nsec = ns;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
#ifndef _GL_EXECINFO_H
|
#ifndef _GL_EXECINFO_H
|
||||||
#define _GL_EXECINFO_H
|
#define _GL_EXECINFO_H
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef _GL_EXECINFO_INLINE
|
#ifndef _GL_EXECINFO_INLINE
|
||||||
# define _GL_EXECINFO_INLINE _GL_INLINE
|
# define _GL_EXECINFO_INLINE _GL_INLINE
|
||||||
|
|
|
@ -86,7 +86,7 @@ rpl_getgroups (int n, gid_t *group)
|
||||||
}
|
}
|
||||||
saved_errno = errno;
|
saved_errno = errno;
|
||||||
free (gbuf);
|
free (gbuf);
|
||||||
errno == saved_errno;
|
errno = saved_errno;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
|
|
||||||
#if !HAVE_OPENAT
|
#if !HAVE_OPENAT
|
||||||
|
|
|
@ -195,6 +195,20 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/* When also using extern inline, suppress the use of static inline in
|
||||||
|
standard headers of problematic Apple configurations, as Libc at
|
||||||
|
least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
|
||||||
|
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
|
||||||
|
Perhaps Apple will fix this some day. */
|
||||||
|
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
|
||||||
|
&& (defined __i386__ || defined __x86_64__))
|
||||||
|
# undef sigaddset
|
||||||
|
# undef sigdelset
|
||||||
|
# undef sigemptyset
|
||||||
|
# undef sigfillset
|
||||||
|
# undef sigismember
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Test whether a given signal is contained in a signal set. */
|
/* Test whether a given signal is contained in a signal set. */
|
||||||
# if @HAVE_POSIX_SIGNALBLOCKING@
|
# if @HAVE_POSIX_SIGNALBLOCKING@
|
||||||
/* This function is defined as a macro on Mac OS X. */
|
/* This function is defined as a macro on Mac OS X. */
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef _GL_STAT_TIME_INLINE
|
#ifndef _GL_STAT_TIME_INLINE
|
||||||
# define _GL_STAT_TIME_INLINE _GL_INLINE
|
# define _GL_STAT_TIME_INLINE _GL_INLINE
|
||||||
|
|
|
@ -124,6 +124,15 @@
|
||||||
#define _GL_STDIO_STRINGIZE(token) #token
|
#define _GL_STDIO_STRINGIZE(token) #token
|
||||||
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
|
#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
|
||||||
|
|
||||||
|
/* When also using extern inline, suppress the use of static inline in
|
||||||
|
standard headers of problematic Apple configurations, as Libc at
|
||||||
|
least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
|
||||||
|
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
|
||||||
|
Perhaps Apple will fix this some day. */
|
||||||
|
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
|
||||||
|
&& defined __GNUC__ && defined __STDC__)
|
||||||
|
# undef putc_unlocked
|
||||||
|
#endif
|
||||||
|
|
||||||
#if @GNULIB_DPRINTF@
|
#if @GNULIB_DPRINTF@
|
||||||
# if @REPLACE_DPRINTF@
|
# if @REPLACE_DPRINTF@
|
||||||
|
|
|
@ -28,11 +28,10 @@
|
||||||
struct timespec
|
struct timespec
|
||||||
timespec_add (struct timespec a, struct timespec b)
|
timespec_add (struct timespec a, struct timespec b)
|
||||||
{
|
{
|
||||||
struct timespec r;
|
|
||||||
time_t rs = a.tv_sec;
|
time_t rs = a.tv_sec;
|
||||||
time_t bs = b.tv_sec;
|
time_t bs = b.tv_sec;
|
||||||
int ns = a.tv_nsec + b.tv_nsec;
|
int ns = a.tv_nsec + b.tv_nsec;
|
||||||
int nsd = ns - 1000000000;
|
int nsd = ns - TIMESPEC_RESOLUTION;
|
||||||
int rns = ns;
|
int rns = ns;
|
||||||
|
|
||||||
if (0 <= nsd)
|
if (0 <= nsd)
|
||||||
|
@ -65,7 +64,5 @@ timespec_add (struct timespec a, struct timespec b)
|
||||||
else
|
else
|
||||||
rs += bs;
|
rs += bs;
|
||||||
|
|
||||||
r.tv_sec = rs;
|
return make_timespec (rs, rns);
|
||||||
r.tv_nsec = rns;
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
struct timespec
|
struct timespec
|
||||||
timespec_sub (struct timespec a, struct timespec b)
|
timespec_sub (struct timespec a, struct timespec b)
|
||||||
{
|
{
|
||||||
struct timespec r;
|
|
||||||
time_t rs = a.tv_sec;
|
time_t rs = a.tv_sec;
|
||||||
time_t bs = b.tv_sec;
|
time_t bs = b.tv_sec;
|
||||||
int ns = a.tv_nsec - b.tv_nsec;
|
int ns = a.tv_nsec - b.tv_nsec;
|
||||||
|
@ -37,7 +36,7 @@ timespec_sub (struct timespec a, struct timespec b)
|
||||||
|
|
||||||
if (ns < 0)
|
if (ns < 0)
|
||||||
{
|
{
|
||||||
rns = ns + 1000000000;
|
rns = ns + TIMESPEC_RESOLUTION;
|
||||||
if (rs == TYPE_MINIMUM (time_t))
|
if (rs == TYPE_MINIMUM (time_t))
|
||||||
{
|
{
|
||||||
if (bs <= 0)
|
if (bs <= 0)
|
||||||
|
@ -65,7 +64,5 @@ timespec_sub (struct timespec a, struct timespec b)
|
||||||
else
|
else
|
||||||
rs -= bs;
|
rs -= bs;
|
||||||
|
|
||||||
r.tv_sec = rs;
|
return make_timespec (rs, rns);
|
||||||
r.tv_nsec = rns;
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
|
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef _GL_TIMESPEC_INLINE
|
#ifndef _GL_TIMESPEC_INLINE
|
||||||
# define _GL_TIMESPEC_INLINE _GL_INLINE
|
# define _GL_TIMESPEC_INLINE _GL_INLINE
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef _GL_U64_INLINE
|
#ifndef _GL_U64_INLINE
|
||||||
# define _GL_U64_INLINE _GL_INLINE
|
# define _GL_U64_INLINE _GL_INLINE
|
||||||
|
|
|
@ -116,6 +116,9 @@
|
||||||
# include <getopt.h>
|
# include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef _GL_UNISTD_INLINE
|
#ifndef _GL_UNISTD_INLINE
|
||||||
# define _GL_UNISTD_INLINE _GL_INLINE
|
# define _GL_UNISTD_INLINE _GL_INLINE
|
||||||
|
|
|
@ -90,10 +90,12 @@ validate_timespec (struct timespec timespec[2])
|
||||||
assert (timespec);
|
assert (timespec);
|
||||||
if ((timespec[0].tv_nsec != UTIME_NOW
|
if ((timespec[0].tv_nsec != UTIME_NOW
|
||||||
&& timespec[0].tv_nsec != UTIME_OMIT
|
&& timespec[0].tv_nsec != UTIME_OMIT
|
||||||
&& (timespec[0].tv_nsec < 0 || 1000000000 <= timespec[0].tv_nsec))
|
&& ! (0 <= timespec[0].tv_nsec
|
||||||
|
&& timespec[0].tv_nsec < TIMESPEC_RESOLUTION))
|
||||||
|| (timespec[1].tv_nsec != UTIME_NOW
|
|| (timespec[1].tv_nsec != UTIME_NOW
|
||||||
&& timespec[1].tv_nsec != UTIME_OMIT
|
&& timespec[1].tv_nsec != UTIME_OMIT
|
||||||
&& (timespec[1].tv_nsec < 0 || 1000000000 <= timespec[1].tv_nsec)))
|
&& ! (0 <= timespec[1].tv_nsec
|
||||||
|
&& timespec[1].tv_nsec < TIMESPEC_RESOLUTION)))
|
||||||
{
|
{
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -26,6 +26,9 @@ int lutimens (char const *, struct timespec const [2]);
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
_GL_INLINE_HEADER_BEGIN
|
_GL_INLINE_HEADER_BEGIN
|
||||||
#ifndef _GL_UTIMENS_INLINE
|
#ifndef _GL_UTIMENS_INLINE
|
||||||
# define _GL_UTIMENS_INLINE _GL_INLINE
|
# define _GL_UTIMENS_INLINE _GL_INLINE
|
||||||
|
|
|
@ -19,20 +19,28 @@ AC_DEFUN([gl_EXTERN_INLINE],
|
||||||
'reference to static identifier "f" in extern inline function'.
|
'reference to static identifier "f" in extern inline function'.
|
||||||
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
|
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
|
||||||
|
|
||||||
Suppress the use of extern inline on Apple's platforms, as Libc at least
|
Suppress the use of extern inline on problematic Apple configurations, as
|
||||||
through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
|
Libc at least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
|
||||||
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
|
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
|
||||||
Perhaps Apple will fix this some day. */
|
Perhaps Apple will fix this some day. */
|
||||||
|
#if (defined __APPLE__ \
|
||||||
|
&& ((! defined _DONT_USE_CTYPE_INLINE_ \
|
||||||
|
&& (defined __GNUC__ || defined __cplusplus)) \
|
||||||
|
|| (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
|
||||||
|
&& defined __GNUC__ && ! defined __cplusplus)))
|
||||||
|
# define _GL_EXTERN_INLINE_APPLE_BUG
|
||||||
|
#endif
|
||||||
#if ((__GNUC__ \
|
#if ((__GNUC__ \
|
||||||
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
|
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
|
||||||
: (199901L <= __STDC_VERSION__ \
|
: (199901L <= __STDC_VERSION__ \
|
||||||
&& !defined __HP_cc \
|
&& !defined __HP_cc \
|
||||||
&& !(defined __SUNPRO_C && __STDC__))) \
|
&& !(defined __SUNPRO_C && __STDC__))) \
|
||||||
&& !defined __APPLE__)
|
&& !defined _GL_EXTERN_INLINE_APPLE_BUG)
|
||||||
# define _GL_INLINE inline
|
# define _GL_INLINE inline
|
||||||
# define _GL_EXTERN_INLINE extern inline
|
# define _GL_EXTERN_INLINE extern inline
|
||||||
|
# define _GL_EXTERN_INLINE_IN_USE
|
||||||
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
|
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
|
||||||
&& !defined __APPLE__)
|
&& !defined _GL_EXTERN_INLINE_APPLE_BUG)
|
||||||
# if __GNUC_GNU_INLINE__
|
# if __GNUC_GNU_INLINE__
|
||||||
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
|
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
|
||||||
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
|
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
|
||||||
|
@ -40,6 +48,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
|
||||||
# define _GL_INLINE extern inline
|
# define _GL_INLINE extern inline
|
||||||
# endif
|
# endif
|
||||||
# define _GL_EXTERN_INLINE extern
|
# define _GL_EXTERN_INLINE extern
|
||||||
|
# define _GL_EXTERN_INLINE_IN_USE
|
||||||
#else
|
#else
|
||||||
# define _GL_INLINE static _GL_UNUSED
|
# define _GL_INLINE static _GL_UNUSED
|
||||||
# define _GL_EXTERN_INLINE static _GL_UNUSED
|
# define _GL_EXTERN_INLINE static _GL_UNUSED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue