Merge from gnulib.
Fixes: debbugs:11527
This commit is contained in:
parent
fe453991ea
commit
caf8a9b2b3
119 changed files with 2836 additions and 1799 deletions
74
ChangeLog
74
ChangeLog
|
@ -1,3 +1,77 @@
|
|||
2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Merge from gnulib. (Bug#11527)
|
||||
|
||||
The build procedure now creates <stdalign.h> and <sys/types.h> for
|
||||
older hosts that lack a working <stdalign.h> or whose
|
||||
<sys/types.h> does not define pid_t, size_t, ssize_t, mode_t. New
|
||||
symbols such as WINDOWS_64_BIT_OFF_T may require attention in the
|
||||
msdos and nt builds.
|
||||
|
||||
Here is a precis of gnulib changes that seem relevant; please see
|
||||
the gnulib ChangeLog for details.
|
||||
|
||||
2012-05-18 crypto: fix bug in large buffer handling
|
||||
2012-05-14 ignore-value.h: remove unused _GL_ATTRIBUTE_DEPRECATED
|
||||
2012-05-10 _Noreturn: port config.h to gcc -Wundef
|
||||
2012-05-08 warnings.m4: give a means to specify the program to compile
|
||||
2012-05-07 stdint: be more consistent with glibc, SunOS libc
|
||||
2012-04-21 Large File Support for native Windows platforms.
|
||||
2012-04-14 stat: Bypass buggy override in mingw64.
|
||||
2012-03-29 stdio: don't assume gets any more
|
||||
2012-03-24 Enable common subexpression optimization in GCC.
|
||||
2012-02-09 maint: replace FSF snail-mail addresses with URLs
|
||||
2012-01-30 sys_stat: Fix support for mingw64 and MSVC.
|
||||
2012-01-28 strtoimax: eliminate need for stdint.h, inttypes.h checks
|
||||
2012-01-21 stdint: Add support for Android.
|
||||
2012-01-15 Improve support for MSVC 9.
|
||||
2012-01-08 mktime: Avoid compilation error on Solaris 11.
|
||||
2012-01-05 Use ', not `, for quoting output.
|
||||
2012-01-05 strtoimax: Don't replace systems where intmax_t is int.
|
||||
2012-01-05 strtoimax: Work around AIX 5.1 bug.
|
||||
2012-01-05 inttypes: Modernize.
|
||||
2011-12-13 inttypes, stdint: add C++11 support
|
||||
2011-11-26 Fix conflict between two instantiations of module 'unistd'.
|
||||
2011-11-21 _Noreturn: Check that _MSC_VER is defined
|
||||
2011-11-10 ptsname_r: Avoid compilation error on OSF/1 5.1.
|
||||
2011-11-09 raise: fix mingw handling of SIGPIPE
|
||||
2011-10-27 Add stdalign module and use it in other modules.
|
||||
|
||||
* lib/stdalign.in.h, lib/sys_types.in.h, m4/off_t.m4, m4/stdalign.m4:
|
||||
* m4/sys_types_h.m4:
|
||||
New files.
|
||||
* build-aux/move-if-change, build-aux/snippet/_Noreturn.h:
|
||||
* build-aux/snippet/arg-nonnull.h, build-aux/snippet/c++defs.h:
|
||||
* build-aux/snippet/warn-on-use.h, doc/misc/texinfo.tex:
|
||||
* lib/alloca.in.h, lib/allocator.h, lib/careadlinkat.c:
|
||||
* lib/careadlinkat.h, lib/dosname.h, lib/dup2.c, lib/filemode.c:
|
||||
* lib/filemode.h, lib/ftoastr.c, lib/ftoastr.h, lib/getloadavg.c:
|
||||
* lib/getopt.c, lib/getopt.in.h, lib/getopt1.c, lib/getopt_int.h:
|
||||
* lib/gettext.h, lib/gnulib.mk, lib/ignore-value.h, lib/intprops.h:
|
||||
* lib/inttypes.in.h, lib/lstat.c, lib/md5.c, lib/md5.h, lib/mktime.c:
|
||||
* lib/pathmax.h, lib/pthread_sigmask.c, lib/readlink.c, lib/sha1.c:
|
||||
* lib/sha1.h, lib/sha256.c, lib/sha256.h, lib/sha512.c, lib/sha512.h:
|
||||
* lib/signal.in.h, lib/sigprocmask.c, lib/stat.c, lib/stdarg.in.h:
|
||||
* lib/stdbool.in.h, lib/stddef.in.h, lib/stdint.in.h, lib/stdio.in.h:
|
||||
* lib/stdlib.in.h, lib/strftime.c, lib/strftime.h, lib/strtoimax.c:
|
||||
* lib/strtol.c, lib/strtoll.c, lib/strtoul.c, lib/strtoull.c:
|
||||
* lib/symlink.c, lib/sys_stat.in.h, lib/time.in.h, lib/time_r.c:
|
||||
* lib/u64.h, lib/unistd.in.h, lib/verify.h, m4/00gnulib.m4:
|
||||
* m4/alloca.m4, m4/c-strtod.m4, m4/dup2.m4, m4/extensions.m4:
|
||||
* m4/filemode.m4, m4/getloadavg.m4, m4/getopt.m4, m4/gl-comp.m4:
|
||||
* m4/gnulib-common.m4, m4/gnulib-tool.m4, m4/include_next.m4:
|
||||
* m4/inttypes.m4, m4/largefile.m4, m4/longlong.m4, m4/lstat.m4:
|
||||
* m4/md5.m4, m4/mktime.m4, m4/multiarch.m4, m4/nocrash.m4:
|
||||
* m4/pathmax.m4, m4/pthread_sigmask.m4, m4/readlink.m4, m4/sha1.m4:
|
||||
* m4/sha256.m4, m4/sha512.m4, m4/signal_h.m4, m4/signalblocking.m4:
|
||||
* m4/socklen.m4, m4/ssize_t.m4, m4/st_dm_mode.m4, m4/stat.m4:
|
||||
* m4/stdarg.m4, m4/stdbool.m4, m4/stddef_h.m4, m4/stdint.m4:
|
||||
* m4/stdio_h.m4, m4/stdlib_h.m4, m4/strftime.m4, m4/strtoimax.m4:
|
||||
* m4/strtoll.m4, m4/strtoull.m4, m4/strtoumax.m4, m4/symlink.m4:
|
||||
* m4/sys_stat_h.m4, m4/time_h.m4, m4/time_r.m4, m4/tm_gmtoff.m4:
|
||||
* m4/unistd_h.m4, m4/warnings.m4, m4/wchar_t.m4:
|
||||
Update from gnulib.
|
||||
|
||||
2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Remove src/m/*.
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
# Like mv $1 $2, but if the files are the same, just delete $1.
|
||||
# Status is zero if successful, nonzero otherwise.
|
||||
|
||||
VERSION='2011-01-28 20:09'; # UTC
|
||||
VERSION='2012-01-06 07:23'; # UTC
|
||||
# The definition above must lie within the first 8 lines in order
|
||||
# for the Emacs time-stamp write hook (at end) to update it.
|
||||
# If you change this file with Emacs, please let the write hook
|
||||
# do its job. Otherwise, update this string manually.
|
||||
|
||||
# Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2012 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
|
||||
|
@ -32,7 +32,7 @@ If SOURCE is different than DEST, then move it to DEST; else remove SOURCE.
|
|||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
The variable CMPPROG can be used to specify an alternative to \`cmp'.
|
||||
The variable CMPPROG can be used to specify an alternative to 'cmp'.
|
||||
|
||||
Report bugs to <bug-gnulib@gnu.org>."
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef _Noreturn
|
||||
#if !defined _Noreturn && __STDC_VERSION__ < 201112
|
||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||
|| 0x5110 <= __SUNPRO_C)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* A C macro for declaring that specific arguments must not be NULL.
|
||||
Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2012 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* C++ compatible function declaration macros.
|
||||
Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* A C macro for emitting warnings if a function is used.
|
||||
Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 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
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
% Load plain if necessary, i.e., if running under initex.
|
||||
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
||||
%
|
||||
\def\texinfoversion{2011-09-23.09}
|
||||
\def\texinfoversion{2012-05-16.16}
|
||||
%
|
||||
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
% 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
%
|
||||
% This texinfo.tex file is free software: you can redistribute it and/or
|
||||
% modify it under the terms of the GNU General Public License as
|
||||
|
@ -28,9 +28,9 @@
|
|||
%
|
||||
% Please try the latest version of texinfo.tex before submitting bug
|
||||
% reports; you can get the latest version from:
|
||||
% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
|
||||
% ftp://tug.org/tex/texinfo.tex
|
||||
% (and all CTAN mirrors, see http://www.ctan.org).
|
||||
% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
|
||||
% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
|
||||
% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
|
||||
% The texinfo.tex in any given distribution could well be out
|
||||
% of date, so if that's what you're using, please check.
|
||||
%
|
||||
|
@ -116,6 +116,7 @@
|
|||
% Set up fixed words for English if not already set.
|
||||
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
|
||||
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
|
||||
\ifx\putworderror\undefined \gdef\putworderror{error}\fi
|
||||
\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
|
||||
\ifx\putwordin\undefined \gdef\putwordin{in}\fi
|
||||
\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
|
||||
|
@ -229,6 +230,13 @@
|
|||
\errorcontextlines16
|
||||
}%
|
||||
|
||||
% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
|
||||
% aren't perfect, it's not the end of the world, being an error message,
|
||||
% after all.
|
||||
%
|
||||
\def\errormsg{\begingroup \indexnofonts \doerrormsg}
|
||||
\def\doerrormsg#1{\errmessage{#1}}
|
||||
|
||||
% add check for \lastpenalty to plain's definitions. If the last thing
|
||||
% we did was a \nobreak, we don't want to insert more space.
|
||||
%
|
||||
|
@ -879,7 +887,7 @@
|
|||
\def\popthisfilestack{\errthisfilestackempty}
|
||||
\def\errthisfilestackempty{\errmessage{Internal error:
|
||||
the stack of filenames is empty.}}
|
||||
|
||||
%
|
||||
\def\thisfile{}
|
||||
|
||||
% @center line
|
||||
|
@ -887,36 +895,46 @@
|
|||
%
|
||||
\parseargdef\center{%
|
||||
\ifhmode
|
||||
\let\next\centerH
|
||||
\let\centersub\centerH
|
||||
\else
|
||||
\let\next\centerV
|
||||
\let\centersub\centerV
|
||||
\fi
|
||||
\next{\hfil \ignorespaces#1\unskip \hfil}%
|
||||
\centersub{\hfil \ignorespaces#1\unskip \hfil}%
|
||||
\let\centersub\relax % don't let the definition persist, just in case
|
||||
}
|
||||
\def\centerH#1{%
|
||||
{%
|
||||
\hfil\break
|
||||
\advance\hsize by -\leftskip
|
||||
\advance\hsize by -\rightskip
|
||||
\line{#1}%
|
||||
\break
|
||||
}%
|
||||
\def\centerH#1{{%
|
||||
\hfil\break
|
||||
\advance\hsize by -\leftskip
|
||||
\advance\hsize by -\rightskip
|
||||
\line{#1}%
|
||||
\break
|
||||
}}
|
||||
%
|
||||
\newcount\centerpenalty
|
||||
\def\centerV#1{%
|
||||
% The idea here is the same as in \startdefun, \cartouche, etc.: if
|
||||
% @center is the first thing after a section heading, we need to wipe
|
||||
% out the negative parskip inserted by \sectionheading, but still
|
||||
% prevent a page break here.
|
||||
\centerpenalty = \lastpenalty
|
||||
\ifnum\centerpenalty>10000 \vskip\parskip \fi
|
||||
\ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
|
||||
\line{\kern\leftskip #1\kern\rightskip}%
|
||||
}
|
||||
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
|
||||
|
||||
% @sp n outputs n lines of vertical space
|
||||
|
||||
%
|
||||
\parseargdef\sp{\vskip #1\baselineskip}
|
||||
|
||||
% @comment ...line which is ignored...
|
||||
% @c is the same as @comment
|
||||
% @ignore ... @end ignore is another way to write a comment
|
||||
|
||||
%
|
||||
\def\comment{\begingroup \catcode`\^^M=\other%
|
||||
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
|
||||
\commentxxx}
|
||||
{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
|
||||
|
||||
%
|
||||
\let\c=\comment
|
||||
|
||||
% @paragraphindent NCHARS
|
||||
|
@ -1089,50 +1107,24 @@
|
|||
% for display in the outlines, and in other places. Thus, we have to
|
||||
% double any backslashes. Otherwise, a name like "\node" will be
|
||||
% interpreted as a newline (\n), followed by o, d, e. Not good.
|
||||
% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
|
||||
% (and related messages, the final outcome is that it is up to the TeX
|
||||
% user to double the backslashes and otherwise make the string valid, so
|
||||
% that's what we do).
|
||||
%
|
||||
% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
|
||||
% related messages. The final outcome is that it is up to the TeX user
|
||||
% to double the backslashes and otherwise make the string valid, so
|
||||
% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
|
||||
% do this reliably, so we use it.
|
||||
|
||||
% double active backslashes.
|
||||
%
|
||||
{\catcode`\@=0 \catcode`\\=\active
|
||||
@gdef@activebackslashdouble{%
|
||||
@catcode`@\=@active
|
||||
@let\=@doublebackslash}
|
||||
}
|
||||
|
||||
% To handle parens, we must adopt a different approach, since parens are
|
||||
% not active characters. hyperref.dtx (which has the same problem as
|
||||
% us) handles it with this amazing macro to replace tokens, with minor
|
||||
% changes for Texinfo. It is included here under the GPL by permission
|
||||
% from the author, Heiko Oberdiek.
|
||||
%
|
||||
% #1 is the tokens to replace.
|
||||
% #2 is the replacement.
|
||||
% #3 is the control sequence with the string.
|
||||
%
|
||||
\def\HyPsdSubst#1#2#3{%
|
||||
\def\HyPsdReplace##1#1##2\END{%
|
||||
##1%
|
||||
\ifx\\##2\\%
|
||||
\else
|
||||
#2%
|
||||
\HyReturnAfterFi{%
|
||||
\HyPsdReplace##2\END
|
||||
}%
|
||||
\fi
|
||||
}%
|
||||
\xdef#3{\expandafter\HyPsdReplace#3#1\END}%
|
||||
}
|
||||
\long\def\HyReturnAfterFi#1\fi{\fi#1}
|
||||
|
||||
% #1 is a control sequence in which to do the replacements.
|
||||
\def\backslashparens#1{%
|
||||
\xdef#1{#1}% redefine it as its expansion; the definition is simply
|
||||
% \lastnode when called from \setref -> \pdfmkdest.
|
||||
\HyPsdSubst{(}{\realbackslash(}{#1}%
|
||||
\HyPsdSubst{)}{\realbackslash)}{#1}%
|
||||
% #1 is a control sequence in which to do the replacements,
|
||||
% which we \xdef.
|
||||
\def\txiescapepdf#1{%
|
||||
\ifx\pdfescapestring\relax
|
||||
% No primitive available; should we give a warning or log?
|
||||
% Many times it won't matter.
|
||||
\else
|
||||
% The expandable \pdfescapestring primitive escapes parentheses,
|
||||
% backslashes, and other special chars.
|
||||
\xdef#1{\pdfescapestring{#1}}%
|
||||
\fi
|
||||
}
|
||||
|
||||
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
|
||||
|
@ -1191,32 +1183,34 @@
|
|||
%
|
||||
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
|
||||
\def\dopdfimage#1#2#3{%
|
||||
\def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
|
||||
\def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
|
||||
\def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
|
||||
\def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
|
||||
%
|
||||
% pdftex (and the PDF format) support .png, .jpg, .pdf (among
|
||||
% others). Let's try in that order.
|
||||
% pdftex (and the PDF format) support .pdf, .png, .jpg (among
|
||||
% others). Let's try in that order, PDF first since if
|
||||
% someone has a scalable image, presumably better to use that than a
|
||||
% bitmap.
|
||||
\let\pdfimgext=\empty
|
||||
\begingroup
|
||||
\openin 1 #1.png \ifeof 1
|
||||
\openin 1 #1.jpg \ifeof 1
|
||||
\openin 1 #1.jpeg \ifeof 1
|
||||
\openin 1 #1.JPG \ifeof 1
|
||||
\openin 1 #1.pdf \ifeof 1
|
||||
\openin 1 #1.PDF \ifeof 1
|
||||
\openin 1 #1.pdf \ifeof 1
|
||||
\openin 1 #1.PDF \ifeof 1
|
||||
\openin 1 #1.png \ifeof 1
|
||||
\openin 1 #1.jpg \ifeof 1
|
||||
\openin 1 #1.jpeg \ifeof 1
|
||||
\openin 1 #1.JPG \ifeof 1
|
||||
\errhelp = \nopdfimagehelp
|
||||
\errmessage{Could not find image file #1 for pdf}%
|
||||
\else \gdef\pdfimgext{PDF}%
|
||||
\else \gdef\pdfimgext{JPG}%
|
||||
\fi
|
||||
\else \gdef\pdfimgext{pdf}%
|
||||
\else \gdef\pdfimgext{jpeg}%
|
||||
\fi
|
||||
\else \gdef\pdfimgext{JPG}%
|
||||
\else \gdef\pdfimgext{jpg}%
|
||||
\fi
|
||||
\else \gdef\pdfimgext{jpeg}%
|
||||
\else \gdef\pdfimgext{png}%
|
||||
\fi
|
||||
\else \gdef\pdfimgext{jpg}%
|
||||
\else \gdef\pdfimgext{PDF}%
|
||||
\fi
|
||||
\else \gdef\pdfimgext{png}%
|
||||
\else \gdef\pdfimgext{pdf}%
|
||||
\fi
|
||||
\closein 1
|
||||
\endgroup
|
||||
|
@ -1228,8 +1222,8 @@
|
|||
\else
|
||||
\immediate\pdfximage
|
||||
\fi
|
||||
\ifdim \wd0 >0pt width \imagewidth \fi
|
||||
\ifdim \wd2 >0pt height \imageheight \fi
|
||||
\ifdim \wd0 >0pt width \pdfimagewidth \fi
|
||||
\ifdim \wd2 >0pt height \pdfimageheight \fi
|
||||
\ifnum\pdftexversion<13
|
||||
#1.\pdfimgext
|
||||
\else
|
||||
|
@ -1244,10 +1238,9 @@
|
|||
% such as \, aren't expanded when present in a section title.
|
||||
\indexnofonts
|
||||
\turnoffactive
|
||||
\activebackslashdouble
|
||||
\makevalueexpandable
|
||||
\def\pdfdestname{#1}%
|
||||
\backslashparens\pdfdestname
|
||||
\txiescapepdf\pdfdestname
|
||||
\safewhatsit{\pdfdest name{\pdfdestname} xyz}%
|
||||
}}
|
||||
%
|
||||
|
@ -1279,28 +1272,22 @@
|
|||
% page number. We could generate a destination for the section
|
||||
% text in the case where a section has no node, but it doesn't
|
||||
% seem worth the trouble, since most documents are normally structured.
|
||||
\def\pdfoutlinedest{#3}%
|
||||
\edef\pdfoutlinedest{#3}%
|
||||
\ifx\pdfoutlinedest\empty
|
||||
\def\pdfoutlinedest{#4}%
|
||||
\else
|
||||
% Doubled backslashes in the name.
|
||||
{\activebackslashdouble \xdef\pdfoutlinedest{#3}%
|
||||
\backslashparens\pdfoutlinedest}%
|
||||
\txiescapepdf\pdfoutlinedest
|
||||
\fi
|
||||
%
|
||||
% Also double the backslashes in the display string.
|
||||
{\activebackslashdouble \xdef\pdfoutlinetext{#1}%
|
||||
\backslashparens\pdfoutlinetext}%
|
||||
% Also escape PDF chars in the display string.
|
||||
\edef\pdfoutlinetext{#1}%
|
||||
\txiescapepdf\pdfoutlinetext
|
||||
%
|
||||
\pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
|
||||
}
|
||||
%
|
||||
\def\pdfmakeoutlines{%
|
||||
\begingroup
|
||||
% Thanh's hack / proper braces in bookmarks
|
||||
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
|
||||
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
|
||||
%
|
||||
% Read toc silently, to get counts of subentries for \pdfoutline.
|
||||
\def\partentry##1##2##3##4{}% ignore parts in the outlines
|
||||
\def\numchapentry##1##2##3##4{%
|
||||
|
@ -1356,25 +1343,41 @@
|
|||
% Latin 2 (0xea) gets translated to a | character. Info from
|
||||
% Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
|
||||
%
|
||||
% xx to do this right, we have to translate 8-bit characters to
|
||||
% their "best" equivalent, based on the @documentencoding. Right
|
||||
% now, I guess we'll just let the pdf reader have its way.
|
||||
% TODO this right, we have to translate 8-bit characters to
|
||||
% their "best" equivalent, based on the @documentencoding. Too
|
||||
% much work for too little return. Just use the ASCII equivalents
|
||||
% we use for the index sort strings.
|
||||
%
|
||||
\indexnofonts
|
||||
\setupdatafile
|
||||
% We can have normal brace characters in the PDF outlines, unlike
|
||||
% Texinfo index files. So set that up.
|
||||
\def\{{\lbracecharliteral}%
|
||||
\def\}{\rbracecharliteral}%
|
||||
\catcode`\\=\active \otherbackslash
|
||||
\input \tocreadfilename
|
||||
\endgroup
|
||||
}
|
||||
{\catcode`[=1 \catcode`]=2
|
||||
\catcode`{=\other \catcode`}=\other
|
||||
\gdef\lbracecharliteral[{]%
|
||||
\gdef\rbracecharliteral[}]%
|
||||
]
|
||||
%
|
||||
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
|
||||
\ifx\PP\D\let\nextsp\relax
|
||||
\else\let\nextsp\skipspaces
|
||||
\ifx\p\space\else\addtokens{\filename}{\PP}%
|
||||
\advance\filenamelength by 1
|
||||
\fi
|
||||
\addtokens{\filename}{\PP}%
|
||||
\advance\filenamelength by 1
|
||||
\fi
|
||||
\nextsp}
|
||||
\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
|
||||
\def\getfilename#1{%
|
||||
\filenamelength=0
|
||||
% If we don't expand the argument now, \skipspaces will get
|
||||
% snagged on things like "@value{foo}".
|
||||
\edef\temp{#1}%
|
||||
\expandafter\skipspaces\temp|\relax
|
||||
}
|
||||
\ifnum\pdftexversion < 14
|
||||
\let \startlink \pdfannotlink
|
||||
\else
|
||||
|
@ -1471,9 +1474,6 @@
|
|||
\def\ttsl{\setfontstyle{ttsl}}
|
||||
|
||||
|
||||
% Default leading.
|
||||
\newdimen\textleading \textleading = 13.2pt
|
||||
|
||||
% Set the baselineskip to #1, and the lineskip and strut size
|
||||
% correspondingly. There is no deep meaning behind these magic numbers
|
||||
% used as factors; they just match (closely enough) what Knuth defined.
|
||||
|
@ -1485,6 +1485,7 @@
|
|||
% can get a sort of poor man's double spacing by redefining this.
|
||||
\def\baselinefactor{1}
|
||||
%
|
||||
\newdimen\textleading
|
||||
\def\setleading#1{%
|
||||
\dimen0 = #1\relax
|
||||
\normalbaselineskip = \baselinefactor\dimen0
|
||||
|
@ -1757,18 +1758,24 @@
|
|||
\fi\fi
|
||||
|
||||
|
||||
% Set the font macro #1 to the font named #2, adding on the
|
||||
% specified font prefix (normally `cm').
|
||||
% Set the font macro #1 to the font named \fontprefix#2.
|
||||
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
|
||||
% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
|
||||
% empty to omit).
|
||||
% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
|
||||
% Example:
|
||||
% #1 = \textrm
|
||||
% #2 = \rmshape
|
||||
% #3 = 10
|
||||
% #4 = \mainmagstep
|
||||
% #5 = OT1
|
||||
%
|
||||
\def\setfont#1#2#3#4#5{%
|
||||
\font#1=\fontprefix#2#3 scaled #4
|
||||
\csname cmap#5\endcsname#1%
|
||||
}
|
||||
% This is what gets called when #5 of \setfont is empty.
|
||||
\let\cmap\gobble
|
||||
% emacs-page end of cmaps
|
||||
%
|
||||
% (end of cmaps)
|
||||
|
||||
% Use cm as the default font prefix.
|
||||
% To specify the font prefix, you must define \fontprefix
|
||||
|
@ -1778,7 +1785,7 @@
|
|||
\fi
|
||||
% Support font families that don't use the same naming scheme as CM.
|
||||
\def\rmshape{r}
|
||||
\def\rmbshape{bx} %where the normal face is bold
|
||||
\def\rmbshape{bx} % where the normal face is bold
|
||||
\def\bfshape{b}
|
||||
\def\bxshape{bx}
|
||||
\def\ttshape{tt}
|
||||
|
@ -1793,8 +1800,7 @@
|
|||
\def\scshape{csc}
|
||||
\def\scbshape{csc}
|
||||
|
||||
% Definitions for a main text size of 11pt. This is the default in
|
||||
% Texinfo.
|
||||
% Definitions for a main text size of 11pt. (The default in Texinfo.)
|
||||
%
|
||||
\def\definetextfontsizexi{%
|
||||
% Text fonts (11.2pt, magstep1).
|
||||
|
@ -1919,7 +1925,7 @@
|
|||
\textleading = 13.2pt % line spacing for 11pt CM
|
||||
\textfonts % reset the current fonts
|
||||
\rm
|
||||
} % end of 11pt text font size definitions
|
||||
} % end of 11pt text font size definitions, \definetextfontsizexi
|
||||
|
||||
|
||||
% Definitions to make the main text be 10pt Computer Modern, with
|
||||
|
@ -2051,7 +2057,7 @@
|
|||
\textleading = 12pt % line spacing for 10pt CM
|
||||
\textfonts % reset the current fonts
|
||||
\rm
|
||||
} % end of 10pt text font size definitions
|
||||
} % end of 10pt text font size definitions, \definetextfontsizex
|
||||
|
||||
|
||||
% We provide the user-level command
|
||||
|
@ -2372,7 +2378,9 @@
|
|||
\else\ifx\next-%
|
||||
\else\ifx\next.%
|
||||
\else\ptexslash
|
||||
\fi\fi\fi}
|
||||
\fi\fi\fi
|
||||
\aftersmartic
|
||||
}
|
||||
|
||||
% like \smartslanted except unconditionally uses \ttsl, and no ic.
|
||||
% @var is set to this for defun arguments.
|
||||
|
@ -2382,9 +2390,15 @@
|
|||
% ttsl for book titles, do we?
|
||||
\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
|
||||
|
||||
\def\aftersmartic{}
|
||||
\def\var#1{%
|
||||
\let\saveaftersmartic = \aftersmartic
|
||||
\def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
|
||||
\smartslanted{#1}%
|
||||
}
|
||||
|
||||
\let\i=\smartitalic
|
||||
\let\slanted=\smartslanted
|
||||
\def\var#1{\smartslanted{#1}}
|
||||
\let\dfn=\smartslanted
|
||||
\let\emph=\smartitalic
|
||||
|
||||
|
@ -2480,7 +2494,7 @@
|
|||
\plainfrenchspacing
|
||||
#1%
|
||||
}%
|
||||
\null
|
||||
\null % reset spacefactor to 1000
|
||||
}
|
||||
|
||||
% We *must* turn on hyphenation at `-' and `_' in @code.
|
||||
|
@ -2762,6 +2776,7 @@
|
|||
\ifx\temp\empty \else
|
||||
\space ({\unsepspaces \ignorespaces \temp \unskip})%
|
||||
\fi
|
||||
\null % reset \spacefactor=1000
|
||||
}
|
||||
|
||||
% @abbr for "Comput. J." and the like.
|
||||
|
@ -2774,6 +2789,7 @@
|
|||
\ifx\temp\empty \else
|
||||
\space ({\unsepspaces \ignorespaces \temp \unskip})%
|
||||
\fi
|
||||
\null % reset \spacefactor=1000
|
||||
}
|
||||
|
||||
% @asis just yields its argument. Used with @table, for example.
|
||||
|
@ -2838,20 +2854,48 @@
|
|||
}
|
||||
}
|
||||
|
||||
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
|
||||
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
|
||||
% except specified as a normal braced arg, so no newlines to worry about.
|
||||
%
|
||||
\def\outfmtnametex{tex}
|
||||
%
|
||||
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
|
||||
\long\def\doinlinefmt#1,#2,\finish{%
|
||||
\def\inlinefmtname{#1}%
|
||||
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
|
||||
}
|
||||
% For raw, must switch into @tex before parsing the argument, to avoid
|
||||
% setting catcodes prematurely. Doing it this way means that, for
|
||||
% example, @inlineraw{html, foo{bar} gets a parse error instead of being
|
||||
% ignored. But this isn't important because if people want a literal
|
||||
% *right* brace they would have to use a command anyway, so they may as
|
||||
% well use a command to get a left brace too. We could re-use the
|
||||
% delimiter character idea from \verb, but it seems like overkill.
|
||||
%
|
||||
\long\def\inlineraw{\tex \doinlineraw}
|
||||
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
|
||||
\def\doinlinerawtwo#1,#2,\finish{%
|
||||
\def\inlinerawname{#1}%
|
||||
\ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
|
||||
\endgroup % close group opened by \tex.
|
||||
}
|
||||
|
||||
|
||||
\message{glyphs,}
|
||||
% and logos.
|
||||
|
||||
% @@ prints an @.
|
||||
% @@ prints an @, as does @atchar{}.
|
||||
\def\@{\char64 }
|
||||
\let\atchar=\@
|
||||
|
||||
% Used to generate quoted braces. Unless we're in typewriter, use
|
||||
% \ecfont because the CM text fonts do not have braces, and we don't
|
||||
% want to switch into math.
|
||||
% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
|
||||
% Unless we're in typewriter, use \ecfont because the CM text fonts do
|
||||
% not have braces, and we don't want to switch into math.
|
||||
\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
|
||||
\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
|
||||
\let\{=\mylbrace
|
||||
\let\}=\myrbrace
|
||||
\let\{=\mylbrace \let\lbracechar=\{
|
||||
\let\}=\myrbrace \let\rbracechar=\}
|
||||
\begingroup
|
||||
% Definitions to produce \{ and \} commands for indices,
|
||||
% and @{ and @} for the aux/toc files.
|
||||
|
@ -2979,7 +3023,7 @@
|
|||
{\tentt \global\dimen0 = 3em}% Width of the box.
|
||||
\dimen2 = .55pt % Thickness of rules
|
||||
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
|
||||
\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
|
||||
\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
|
||||
%
|
||||
\setbox\errorbox=\hbox to \dimen0{\hfil
|
||||
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
|
||||
|
@ -4409,6 +4453,7 @@
|
|||
\definedummyword\guillemetright
|
||||
\definedummyword\guilsinglleft
|
||||
\definedummyword\guilsinglright
|
||||
\definedummyword\lbracechar
|
||||
\definedummyword\leq
|
||||
\definedummyword\minus
|
||||
\definedummyword\ogonek
|
||||
|
@ -4421,6 +4466,7 @@
|
|||
\definedummyword\quoteleft
|
||||
\definedummyword\quoteright
|
||||
\definedummyword\quotesinglbase
|
||||
\definedummyword\rbracechar
|
||||
\definedummyword\result
|
||||
\definedummyword\textdegree
|
||||
%
|
||||
|
@ -4472,7 +4518,9 @@
|
|||
\definedummyword\t
|
||||
%
|
||||
% Commands that take arguments.
|
||||
\definedummyword\abbr
|
||||
\definedummyword\acronym
|
||||
\definedummyword\anchor
|
||||
\definedummyword\cite
|
||||
\definedummyword\code
|
||||
\definedummyword\command
|
||||
|
@ -4482,7 +4530,9 @@
|
|||
\definedummyword\emph
|
||||
\definedummyword\env
|
||||
\definedummyword\file
|
||||
\definedummyword\image
|
||||
\definedummyword\indicateurl
|
||||
\definedummyword\inforef
|
||||
\definedummyword\kbd
|
||||
\definedummyword\key
|
||||
\definedummyword\math
|
||||
|
@ -4529,7 +4579,10 @@
|
|||
% content at all. So for index sorting, we map @{ and @} to strings
|
||||
% starting with |, since that ASCII character is between ASCII { and }.
|
||||
\def\{{|a}%
|
||||
\def\lbracechar{|a}%
|
||||
%
|
||||
\def\}{|b}%
|
||||
\def\rbracechar{|b}%
|
||||
%
|
||||
% Non-English letters.
|
||||
\def\AA{AA}%
|
||||
|
@ -4705,10 +4758,9 @@
|
|||
%
|
||||
% ..., ready, GO:
|
||||
%
|
||||
\def\safewhatsit#1{%
|
||||
\ifhmode
|
||||
\def\safewhatsit#1{\ifhmode
|
||||
#1%
|
||||
\else
|
||||
\else
|
||||
% \lastskip and \lastpenalty cannot both be nonzero simultaneously.
|
||||
\whatsitskip = \lastskip
|
||||
\edef\lastskipmacro{\the\lastskip}%
|
||||
|
@ -4732,7 +4784,6 @@
|
|||
% to re-insert the same penalty (values >10000 are used for various
|
||||
% signals); since we just inserted a non-discardable item, any
|
||||
% following glue (such as a \parskip) would be a breakpoint. For example:
|
||||
%
|
||||
% @deffn deffn-whatever
|
||||
% @vindex index-whatever
|
||||
% Description.
|
||||
|
@ -4745,8 +4796,7 @@
|
|||
% (the whatsit from the \write), so we must insert a \nobreak.
|
||||
\nobreak\vskip\whatsitskip
|
||||
\fi
|
||||
\fi
|
||||
}
|
||||
\fi}
|
||||
|
||||
% The index entry written in the file actually looks like
|
||||
% \entry {sortstring}{page}{topic}
|
||||
|
@ -5849,14 +5899,15 @@
|
|||
%
|
||||
% We'll almost certainly start a paragraph next, so don't let that
|
||||
% glue accumulate. (Not a breakpoint because it's preceded by a
|
||||
% discardable item.)
|
||||
% discardable item.) However, when a paragraph is not started next
|
||||
% (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
|
||||
% or the negative glue will cause weirdly wrong output, typically
|
||||
% obscuring the section heading with something else.
|
||||
\vskip-\parskip
|
||||
%
|
||||
% This is purely so the last item on the list is a known \penalty >
|
||||
% 10000. This is so \startdefun can avoid allowing breakpoints after
|
||||
% section headings. Otherwise, it would insert a valid breakpoint between:
|
||||
% @section sec-whatever
|
||||
% @deffn def-whatever
|
||||
% This is so the last item on the main vertical list is a known
|
||||
% \penalty > 10000, so \startdefun, etc., can recognize the situation
|
||||
% and do the needful.
|
||||
\penalty 10001
|
||||
}
|
||||
|
||||
|
@ -6276,7 +6327,7 @@
|
|||
% If this cartouche directly follows a sectioning command, we need the
|
||||
% \parskip glue (backspaced over by default) or the cartouche can
|
||||
% collide with the section heading.
|
||||
\ifnum\lastpenalty>10000 \vskip\parskip \fi
|
||||
\ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
|
||||
%
|
||||
\vbox\bgroup
|
||||
\baselineskip=0pt\parskip=0pt\lineskip=0pt
|
||||
|
@ -7766,7 +7817,7 @@
|
|||
\fi\fi
|
||||
}
|
||||
|
||||
|
||||
%
|
||||
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
|
||||
% the node name, #2 the name of the Info cross-reference, #3 the printed
|
||||
% node name, #4 the name of the Info file, #5 the name of the printed
|
||||
|
@ -7775,26 +7826,41 @@
|
|||
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
|
||||
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
|
||||
\def\ref#1{\xrefX[#1,,,,,,,]}
|
||||
%
|
||||
\newbox\toprefbox
|
||||
\newbox\printedrefnamebox
|
||||
\newbox\infofilenamebox
|
||||
\newbox\printedmanualbox
|
||||
%
|
||||
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
|
||||
\unsepspaces
|
||||
\def\printedmanual{\ignorespaces #5}%
|
||||
%
|
||||
% Get args without leading/trailing spaces.
|
||||
\def\printedrefname{\ignorespaces #3}%
|
||||
\setbox1=\hbox{\printedmanual\unskip}%
|
||||
\setbox0=\hbox{\printedrefname\unskip}%
|
||||
\ifdim \wd0 = 0pt
|
||||
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
|
||||
%
|
||||
\def\infofilename{\ignorespaces #4}%
|
||||
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
|
||||
%
|
||||
\def\printedmanual{\ignorespaces #5}%
|
||||
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
|
||||
%
|
||||
% If the printed reference name (arg #3) was not explicitly given in
|
||||
% the @xref, figure out what we want to use.
|
||||
\ifdim \wd\printedrefnamebox = 0pt
|
||||
% No printed node name was explicitly given.
|
||||
\expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
|
||||
% Use the node name inside the square brackets.
|
||||
% Not auto section-title: use node name inside the square brackets.
|
||||
\def\printedrefname{\ignorespaces #1}%
|
||||
\else
|
||||
% Use the actual chapter/section title appear inside
|
||||
% the square brackets. Use the real section title if we have it.
|
||||
\ifdim \wd1 > 0pt
|
||||
% It is in another manual, so we don't have it.
|
||||
% Auto section-title: use chapter/section title inside
|
||||
% the square brackets if we have it.
|
||||
\ifdim \wd\printedmanualbox > 0pt
|
||||
% It is in another manual, so we don't have it; use node name.
|
||||
\def\printedrefname{\ignorespaces #1}%
|
||||
\else
|
||||
\ifhavexrefs
|
||||
% We know the real title if we have the xref values.
|
||||
% We (should) know the real title if we have the xref values.
|
||||
\def\printedrefname{\refx{#1-title}{}}%
|
||||
\else
|
||||
% Otherwise just copy the Info node name.
|
||||
|
@ -7808,13 +7874,20 @@
|
|||
\ifpdf
|
||||
{\indexnofonts
|
||||
\turnoffactive
|
||||
\makevalueexpandable
|
||||
% This expands tokens, so do it after making catcode changes, so _
|
||||
% etc. don't get their TeX definitions.
|
||||
% etc. don't get their TeX definitions. This ignores all spaces in
|
||||
% #4, including (wrongly) those in the middle of the filename.
|
||||
\getfilename{#4}%
|
||||
%
|
||||
% See comments at \activebackslashdouble.
|
||||
{\activebackslashdouble \xdef\pdfxrefdest{#1}%
|
||||
\backslashparens\pdfxrefdest}%
|
||||
% This (wrongly) does not take account of leading or trailing
|
||||
% spaces in #1, which should be ignored.
|
||||
\edef\pdfxrefdest{#1}%
|
||||
\ifx\pdfxrefdest\empty
|
||||
\def\pdfxrefdest{Top}% no empty targets
|
||||
\else
|
||||
\txiescapepdf\pdfxrefdest % escape PDF special chars
|
||||
\fi
|
||||
%
|
||||
\leavevmode
|
||||
\startlink attr{/Border [0 0 0]}%
|
||||
|
@ -7841,29 +7914,42 @@
|
|||
\iffloat\Xthisreftitle
|
||||
% If the user specified the print name (third arg) to the ref,
|
||||
% print it instead of our usual "Figure 1.2".
|
||||
\ifdim\wd0 = 0pt
|
||||
\ifdim\wd\printedrefnamebox = 0pt
|
||||
\refx{#1-snt}{}%
|
||||
\else
|
||||
\printedrefname
|
||||
\fi
|
||||
%
|
||||
% if the user also gave the printed manual name (fifth arg), append
|
||||
% If the user also gave the printed manual name (fifth arg), append
|
||||
% "in MANUALNAME".
|
||||
\ifdim \wd1 > 0pt
|
||||
\ifdim \wd\printedmanualbox > 0pt
|
||||
\space \putwordin{} \cite{\printedmanual}%
|
||||
\fi
|
||||
\else
|
||||
% node/anchor (non-float) references.
|
||||
%
|
||||
% If we use \unhbox to print the node names, TeX does not insert
|
||||
% empty discretionaries after hyphens, which means that it will not
|
||||
% find a line break at a hyphen in a node names. Since some manuals
|
||||
% are best written with fairly long node names, containing hyphens,
|
||||
% this is a loss. Therefore, we give the text of the node name
|
||||
% again, so it is as if TeX is seeing it for the first time.
|
||||
%
|
||||
\ifdim \wd\printedmanualbox > 0pt
|
||||
% Cross-manual reference with a printed manual name.
|
||||
%
|
||||
\crossmanualxref{\cite{\printedmanual\unskip}}%
|
||||
%
|
||||
\else\ifdim \wd\infofilenamebox > 0pt
|
||||
% Cross-manual reference with only an info filename (arg 4), no
|
||||
% printed manual name (arg 5). This is essentially the same as
|
||||
% the case above; we output the filename, since we have nothing else.
|
||||
%
|
||||
\crossmanualxref{\code{\infofilename\unskip}}%
|
||||
%
|
||||
% If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
|
||||
% insert empty discretionaries after hyphens, which means that it will
|
||||
% not find a line break at a hyphen in a node names. Since some manuals
|
||||
% are best written with fairly long node names, containing hyphens, this
|
||||
% is a loss. Therefore, we give the text of the node name again, so it
|
||||
% is as if TeX is seeing it for the first time.
|
||||
\ifdim \wd1 > 0pt
|
||||
\putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
|
||||
\else
|
||||
% Reference within this manual.
|
||||
%
|
||||
% _ (for example) has to be the character _ for the purposes of the
|
||||
% control sequence corresponding to the node, but it has to expand
|
||||
% into the usual \leavevmode...\vrule stuff for purposes of
|
||||
|
@ -7875,7 +7961,7 @@
|
|||
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
|
||||
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
|
||||
}%
|
||||
% output the `[mynode]' via a macro so it can be overridden.
|
||||
% output the `[mynode]' via the macro below so it can be overridden.
|
||||
\xrefprintnodename\printedrefname
|
||||
%
|
||||
% But we always want a comma and a space:
|
||||
|
@ -7883,11 +7969,37 @@
|
|||
%
|
||||
% output the `page 3'.
|
||||
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
|
||||
\fi
|
||||
\fi\fi
|
||||
\fi
|
||||
\endlink
|
||||
\endgroup}
|
||||
|
||||
% Output a cross-manual xref to #1. Used just above (twice).
|
||||
%
|
||||
% Only include the text "Section ``foo'' in" if the foo is neither
|
||||
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
|
||||
% "see The Foo Manual", the idea being to refer to the whole manual.
|
||||
%
|
||||
% But, this being TeX, we can't easily compare our node name against the
|
||||
% string "Top" while ignoring the possible spaces before and after in
|
||||
% the input. By adding the arbitrary 7sp below, we make it much less
|
||||
% likely that a real node name would have the same width as "Top" (e.g.,
|
||||
% in a monospaced font). Hopefully it will never happen in practice.
|
||||
%
|
||||
% For the same basic reason, we retypeset the "Top" at every
|
||||
% reference, since the current font is indeterminate.
|
||||
%
|
||||
\def\crossmanualxref#1{%
|
||||
\setbox\toprefbox = \hbox{Top\kern7sp}%
|
||||
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
|
||||
\ifdim \wd2 > 7sp % nonempty?
|
||||
\ifdim \wd2 = \wd\toprefbox \else % same as Top?
|
||||
\putwordSection{} ``\printedrefname'' \putwordin{}\space
|
||||
\fi
|
||||
\fi
|
||||
#1%
|
||||
}
|
||||
|
||||
% This macro is called from \xrefX for the `[nodename]' part of xref
|
||||
% output. It's a separate macro only so it can be changed more easily,
|
||||
% since square brackets don't work well in some documents. Particularly
|
||||
|
@ -8103,7 +8215,7 @@
|
|||
% space to prevent strange expansion errors.)
|
||||
\def\supereject{\par\penalty -20000\footnoteno =0 }
|
||||
|
||||
% @footnotestyle is meaningful for info output only.
|
||||
% @footnotestyle is meaningful for Info output only.
|
||||
\let\footnotestyle=\comment
|
||||
|
||||
{\catcode `\@=11
|
||||
|
@ -8166,6 +8278,8 @@
|
|||
% expands into a box, it must come within the paragraph, lest it
|
||||
% provide a place where TeX can split the footnote.
|
||||
\footstrut
|
||||
%
|
||||
% Invoke rest of plain TeX footnote routine.
|
||||
\futurelet\next\fo@t
|
||||
}
|
||||
}%end \catcode `\@=11
|
||||
|
@ -8253,7 +8367,7 @@
|
|||
it from ftp://tug.org/tex/epsf.tex.}
|
||||
%
|
||||
\def\image#1{%
|
||||
\ifx\epsfbox\thisiundefined
|
||||
\ifx\epsfbox\thisisundefined
|
||||
\ifwarnednoepsf \else
|
||||
\errhelp = \noepsfhelp
|
||||
\errmessage{epsf.tex not found, images will be ignored}%
|
||||
|
@ -8277,6 +8391,13 @@
|
|||
% If the image is by itself, center it.
|
||||
\ifvmode
|
||||
\imagevmodetrue
|
||||
\else \ifx\centersub\centerV
|
||||
% for @center @image, we need a vbox so we can have our vertical space
|
||||
\imagevmodetrue
|
||||
\vbox\bgroup % vbox has better behavior than vtop herev
|
||||
\fi\fi
|
||||
%
|
||||
\ifimagevmode
|
||||
\nobreak\medskip
|
||||
% Usually we'll have text after the image which will insert
|
||||
% \parskip glue, so insert it here too to equalize the space
|
||||
|
@ -8286,9 +8407,13 @@
|
|||
\fi
|
||||
%
|
||||
% Leave vertical mode so that indentation from an enclosing
|
||||
% environment such as @quotation is respected. On the other hand, if
|
||||
% it's at the top level, we don't want the normal paragraph indentation.
|
||||
\noindent
|
||||
% environment such as @quotation is respected.
|
||||
% However, if we're at the top level, we don't want the
|
||||
% normal paragraph indentation.
|
||||
% On the other hand, if we are in the case of @center @image, we don't
|
||||
% want to start a paragraph, which will create a hsize-width box and
|
||||
% eradicate the centering.
|
||||
\ifx\centersub\centerV\else \noindent \fi
|
||||
%
|
||||
% Output the image.
|
||||
\ifpdf
|
||||
|
@ -8300,7 +8425,10 @@
|
|||
\epsfbox{#1.eps}%
|
||||
\fi
|
||||
%
|
||||
\ifimagevmode \medskip \fi % space after the standalone image
|
||||
\ifimagevmode
|
||||
\medskip % space after a standalone image
|
||||
\fi
|
||||
\ifx\centersub\centerV \egroup \fi
|
||||
\endgroup}
|
||||
|
||||
|
||||
|
@ -9781,14 +9909,24 @@
|
|||
|
||||
% In texinfo, backslash is an active character; it prints the backslash
|
||||
% in fixed width font.
|
||||
\catcode`\\=\active
|
||||
@def@normalbackslash{{@tt@backslashcurfont}}
|
||||
\catcode`\\=\active % @ for escape char from now on.
|
||||
|
||||
% The story here is that in math mode, the \char of \backslashcurfont
|
||||
% ends up printing the roman \ from the math symbol font (because \char
|
||||
% in math mode uses the \mathcode, and plain.tex sets
|
||||
% \mathcode`\\="026E). It seems better for @backslashchar{} to always
|
||||
% print a typewriter backslash, hence we use an explicit \mathchar,
|
||||
% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
|
||||
% ignored family value; char position "5C). We can't use " for the
|
||||
% usual hex value because it has already been made active.
|
||||
@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
|
||||
@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
|
||||
|
||||
% On startup, @fixbackslash assigns:
|
||||
% @let \ = @normalbackslash
|
||||
|
||||
% \rawbackslash defines an active \ to do \backslashcurfont.
|
||||
% \otherbackslash defines an active \ to be a literal `\' character with
|
||||
% catcode other.
|
||||
% catcode other. We switch back and forth between these.
|
||||
@gdef@rawbackslash{@let\=@backslashcurfont}
|
||||
@gdef@otherbackslash{@let\=@realbackslash}
|
||||
|
||||
|
@ -9844,10 +9982,13 @@
|
|||
@def@normalslash{/}
|
||||
|
||||
% These look ok in all fonts, so just make them not special.
|
||||
% @hashchar{} gets its own user-level command, because of #line.
|
||||
@catcode`@& = @other @def@normalamp{&}
|
||||
@catcode`@# = @other @def@normalhash{#}
|
||||
@catcode`@% = @other @def@normalpercent{%}
|
||||
|
||||
@let @hashchar = @normalhash
|
||||
|
||||
@c Finally, make ` and ' active, so that txicodequoteundirected and
|
||||
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
|
||||
@c don't make ` and ' active, @code will not get them as active chars.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Memory allocation on the stack.
|
||||
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2011 Free Software Foundation,
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -14,9 +14,9 @@
|
|||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
License along with this program; if not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
|
||||
means there is a real alloca function. */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Memory allocators such as malloc+free.
|
||||
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2012 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Read symbolic links into a buffer without size limitation, relative to fd.
|
||||
|
||||
Copyright (C) 2001, 2003-2004, 2007, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 2001, 2003-2004, 2007, 2009-2012 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Read symbolic links into a buffer without size limitation, relative to fd.
|
||||
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2012 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* File names on MS-DOS/Windows systems.
|
||||
|
||||
Copyright (C) 2000-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2001, 2004-2006, 2009-2012 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Duplicate an open file descriptor to a specified file descriptor.
|
||||
|
||||
Copyright (C) 1999, 2004-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004-2007, 2009-2012 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
|
||||
|
@ -31,7 +31,7 @@
|
|||
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
|
||||
/* Get declarations of the Win32 API functions. */
|
||||
/* Get declarations of the native Windows API functions. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* filemode.c -- make a string describing file modes
|
||||
|
||||
Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2011 Free
|
||||
Copyright (C) 1985, 1990, 1993, 1998-2000, 2004, 2006, 2009-2012 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -21,8 +21,8 @@
|
|||
#include "filemode.h"
|
||||
|
||||
/* The following is for Cray DMF (Data Migration Facility), which is a
|
||||
HSM file system. A migrated file has a `st_dm_mode' that is
|
||||
different from the normal `st_mode', so any tests for migrated
|
||||
HSM file system. A migrated file has a 'st_dm_mode' that is
|
||||
different from the normal 'st_mode', so any tests for migrated
|
||||
files should use the former. */
|
||||
#if HAVE_ST_DM_MODE
|
||||
# define IS_MIGRATED_FILE(statp) \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Make a string describing file modes.
|
||||
|
||||
Copyright (C) 1998-1999, 2003, 2006, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 1998-1999, 2003, 2006, 2009-2012 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* floating point to accurate string
|
||||
|
||||
Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 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
|
||||
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "ftoastr.h"
|
||||
|
||||
#include "intprops.h"
|
||||
#include <float.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* floating point to accurate string
|
||||
|
||||
Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2012 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
|
||||
|
@ -58,7 +58,7 @@ enum
|
|||
FTOASTR_ALWAYS_SIGNED = 2,
|
||||
|
||||
/* Output " " before positive numbers; ignored if
|
||||
FTOASTER_ALWAYS_SIGNED is also given. */
|
||||
FTOASTR_ALWAYS_SIGNED is also given. */
|
||||
FTOASTR_SPACE_POSITIVE = 4,
|
||||
|
||||
/* Pad with zeros instead of spaces; ignored if FTOASTR_LEFT_JUSTIFY
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Get the system load averages.
|
||||
|
||||
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2011 Free Software
|
||||
Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2012 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with gnulib.
|
||||
|
@ -46,7 +46,7 @@
|
|||
NLIST_STRUCT Include nlist.h, not a.out.h.
|
||||
N_NAME_POINTER The nlist n_name element is a pointer,
|
||||
not an array.
|
||||
HAVE_STRUCT_NLIST_N_UN_N_NAME `n_un.n_name' is member of `struct nlist'.
|
||||
HAVE_STRUCT_NLIST_N_UN_N_NAME 'n_un.n_name' is member of 'struct nlist'.
|
||||
LINUX_LDAV_FILE [__linux__, __CYGWIN__]: File containing
|
||||
load averages.
|
||||
|
||||
|
@ -794,7 +794,7 @@ getloadavg (double loadavg[], int nelem)
|
|||
# define LDAV_DONE
|
||||
/* This call can return -1 for an error, but with good args
|
||||
it's not supposed to fail. The first argument is for no
|
||||
apparent reason of type `long int *'. */
|
||||
apparent reason of type 'long int *'. */
|
||||
dg_sys_info ((long int *) &load_info,
|
||||
DG_SYS_INFO_LOAD_INFO_TYPE,
|
||||
DG_SYS_INFO_LOAD_VERSION_0);
|
||||
|
|
66
lib/getopt.c
66
lib/getopt.c
|
@ -2,7 +2,7 @@
|
|||
NOTE: getopt is part of the C library, so if you don't know what
|
||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||
before changing it!
|
||||
Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2011 Free Software
|
||||
Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2012 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -41,15 +41,15 @@
|
|||
# include <wchar.h>
|
||||
#endif
|
||||
|
||||
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
||||
/* This version of 'getopt' appears to the caller like standard Unix 'getopt'
|
||||
but it behaves differently for the user, since it allows the user
|
||||
to intersperse the options with the other arguments.
|
||||
|
||||
As `getopt_long' works, it permutes the elements of ARGV so that,
|
||||
As 'getopt_long' works, it permutes the elements of ARGV so that,
|
||||
when it is done, all the options precede everything else. Thus
|
||||
all application programs are extended to handle flexible argument order.
|
||||
|
||||
Using `getopt' or setting the environment variable POSIXLY_CORRECT
|
||||
Using 'getopt' or setting the environment variable POSIXLY_CORRECT
|
||||
disables permutation.
|
||||
Then the behavior is completely standard.
|
||||
|
||||
|
@ -58,24 +58,24 @@
|
|||
|
||||
#include "getopt_int.h"
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
/* For communication from 'getopt' to the caller.
|
||||
When 'getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
Also, when 'ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
and for communication between successive calls to 'getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
On entry to 'getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
When 'getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
Otherwise, 'optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
/* 1003.2 says this must be 1 before any call. */
|
||||
|
@ -137,7 +137,7 @@ extern char *__getopt_nonoption_flags;
|
|||
The other is elements [last_nonopt,optind), which contains all
|
||||
the options processed since those non-options were skipped.
|
||||
|
||||
`first_nonopt' and `last_nonopt' are relocated so that they describe
|
||||
'first_nonopt' and 'last_nonopt' are relocated so that they describe
|
||||
the new indices of the non-options in ARGV after they are moved. */
|
||||
|
||||
static void
|
||||
|
@ -154,7 +154,7 @@ exchange (char **argv, struct _getopt_data *d)
|
|||
but it consists of two parts that need to be swapped next. */
|
||||
|
||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
||||
/* First make sure the handling of the `__getopt_nonoption_flags'
|
||||
/* First make sure the handling of the '__getopt_nonoption_flags'
|
||||
string can work normally. Our top argument must be in the range
|
||||
of the string. */
|
||||
if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
|
||||
|
@ -291,48 +291,48 @@ _getopt_initialize (int argc _GL_UNUSED,
|
|||
|
||||
If an element of ARGV starts with '-', and is not exactly "-" or "--",
|
||||
then it is an option element. The characters of this element
|
||||
(aside from the initial '-') are option characters. If `getopt'
|
||||
(aside from the initial '-') are option characters. If 'getopt'
|
||||
is called repeatedly, it returns successively each of the option characters
|
||||
from each of the option elements.
|
||||
|
||||
If `getopt' finds another option character, it returns that character,
|
||||
updating `optind' and `nextchar' so that the next call to `getopt' can
|
||||
If 'getopt' finds another option character, it returns that character,
|
||||
updating 'optind' and 'nextchar' so that the next call to 'getopt' can
|
||||
resume the scan with the following option character or ARGV-element.
|
||||
|
||||
If there are no more option characters, `getopt' returns -1.
|
||||
Then `optind' is the index in ARGV of the first ARGV-element
|
||||
If there are no more option characters, 'getopt' returns -1.
|
||||
Then 'optind' is the index in ARGV of the first ARGV-element
|
||||
that is not an option. (The ARGV-elements have been permuted
|
||||
so that those that are not options now come last.)
|
||||
|
||||
OPTSTRING is a string containing the legitimate option characters.
|
||||
If an option character is seen that is not listed in OPTSTRING,
|
||||
return '?' after printing an error message. If you set `opterr' to
|
||||
return '?' after printing an error message. If you set 'opterr' to
|
||||
zero, the error message is suppressed but we still return '?'.
|
||||
|
||||
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
|
||||
so the following text in the same ARGV-element, or the text of the following
|
||||
ARGV-element, is returned in `optarg'. Two colons mean an option that
|
||||
ARGV-element, is returned in 'optarg'. Two colons mean an option that
|
||||
wants an optional arg; if there is text in the current ARGV-element,
|
||||
it is returned in `optarg', otherwise `optarg' is set to zero.
|
||||
it is returned in 'optarg', otherwise 'optarg' is set to zero.
|
||||
|
||||
If OPTSTRING starts with `-' or `+', it requests different methods of
|
||||
If OPTSTRING starts with '-' or '+', it requests different methods of
|
||||
handling the non-option ARGV-elements.
|
||||
See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
|
||||
|
||||
Long-named options begin with `--' instead of `-'.
|
||||
Long-named options begin with '--' instead of '-'.
|
||||
Their names may be abbreviated as long as the abbreviation is unique
|
||||
or is an exact match for some defined option. If they have an
|
||||
argument, it follows the option name in the same ARGV-element, separated
|
||||
from the option name by a `=', or else the in next ARGV-element.
|
||||
When `getopt' finds a long-named option, it returns 0 if that option's
|
||||
`flag' field is nonzero, the value of the option's `val' field
|
||||
if the `flag' field is zero.
|
||||
from the option name by a '=', or else the in next ARGV-element.
|
||||
When 'getopt' finds a long-named option, it returns 0 if that option's
|
||||
'flag' field is nonzero, the value of the option's 'val' field
|
||||
if the 'flag' field is zero.
|
||||
|
||||
The elements of ARGV aren't really const, because we permute them.
|
||||
But we pretend they're const in the prototype to be compatible
|
||||
with other systems.
|
||||
|
||||
LONGOPTS is a vector of `struct option' terminated by an
|
||||
LONGOPTS is a vector of 'struct option' terminated by an
|
||||
element containing a name which is zero.
|
||||
|
||||
LONGIND returns the index in LONGOPT of the long-named option found.
|
||||
|
@ -409,7 +409,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
|
|||
d->__last_nonopt = d->optind;
|
||||
}
|
||||
|
||||
/* The special ARGV-element `--' means premature end of options.
|
||||
/* The special ARGV-element '--' means premature end of options.
|
||||
Skip it like a null option,
|
||||
then exchange with previous non-options as if it were an option,
|
||||
then skip everything else like a non-option. */
|
||||
|
@ -788,7 +788,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
|
|||
char c = *d->__nextchar++;
|
||||
const char *temp = strchr (optstring, c);
|
||||
|
||||
/* Increment `optind' when we start to process its last character. */
|
||||
/* Increment 'optind' when we start to process its last character. */
|
||||
if (*d->__nextchar == '\0')
|
||||
++d->optind;
|
||||
|
||||
|
@ -887,7 +887,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
|
|||
return c;
|
||||
}
|
||||
else
|
||||
/* We already incremented `d->optind' once;
|
||||
/* We already incremented 'd->optind' once;
|
||||
increment it again when taking next ARGV-elt as argument. */
|
||||
d->optarg = argv[d->optind++];
|
||||
|
||||
|
@ -1114,7 +1114,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
|
|||
c = '?';
|
||||
}
|
||||
else
|
||||
/* We already incremented `optind' once;
|
||||
/* We already incremented 'optind' once;
|
||||
increment it again when taking next ARGV-elt as argument. */
|
||||
d->optarg = argv[d->optind++];
|
||||
d->__nextchar = NULL;
|
||||
|
@ -1177,7 +1177,7 @@ __posix_getopt (int argc, char *const *argv, const char *optstring)
|
|||
#ifdef TEST
|
||||
|
||||
/* Compile with -DTEST to make an executable for use in testing
|
||||
the above definition of `getopt'. */
|
||||
the above definition of 'getopt'. */
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Declarations for getopt.
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2011 Free Software
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2012 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
|||
getopt_long_only can permute argv; this is required for backward
|
||||
compatibility (e.g., for LSB 2.0.1).
|
||||
|
||||
This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
|
||||
This used to be '#if defined __GETOPT_PREFIX && !defined __need_getopt',
|
||||
but it caused redefinition warnings if both unistd.h and getopt.h were
|
||||
included, since unistd.h includes getopt.h having previously defined
|
||||
__need_getopt.
|
||||
|
@ -128,29 +128,29 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
/* For communication from 'getopt' to the caller.
|
||||
When 'getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
Also, when 'ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
and for communication between successive calls to 'getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
On entry to 'getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
When 'getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
Otherwise, 'optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
extern int optind;
|
||||
|
||||
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||
/* Callers store zero here to inhibit the error message 'getopt' prints
|
||||
for unrecognized options. */
|
||||
|
||||
extern int opterr;
|
||||
|
@ -162,24 +162,24 @@ extern int optopt;
|
|||
#ifndef __need_getopt
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of `struct option' terminated by an element containing a name which is
|
||||
of 'struct option' terminated by an element containing a name which is
|
||||
zero.
|
||||
|
||||
The field `has_arg' is:
|
||||
The field 'has_arg' is:
|
||||
no_argument (or 0) if the option does not take an argument,
|
||||
required_argument (or 1) if the option requires an argument,
|
||||
optional_argument (or 2) if the option takes an optional argument.
|
||||
|
||||
If the field `flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field `val' when the option is found, but
|
||||
If the field 'flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field 'val' when the option is found, but
|
||||
left unchanged if the option is not found.
|
||||
|
||||
To have a long-named option do something other than set an `int' to
|
||||
a compiled-in constant, such as set a value from `optarg', set the
|
||||
option's `flag' field to zero and its `val' field to a nonzero
|
||||
To have a long-named option do something other than set an 'int' to
|
||||
a compiled-in constant, such as set a value from 'optarg', set the
|
||||
option's 'flag' field to zero and its 'val' field to a nonzero
|
||||
value (the equivalent single-letter option character, if there is
|
||||
one). For long options that have a zero `flag' field, `getopt'
|
||||
returns the contents of the `val' field. */
|
||||
one). For long options that have a zero 'flag' field, 'getopt'
|
||||
returns the contents of the 'val' field. */
|
||||
|
||||
# if !GNULIB_defined_struct_option
|
||||
struct option
|
||||
|
@ -194,7 +194,7 @@ struct option
|
|||
# define GNULIB_defined_struct_option 1
|
||||
# endif
|
||||
|
||||
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||
/* Names for the values of the 'has_arg' field of 'struct option'. */
|
||||
|
||||
# define no_argument 0
|
||||
# define required_argument 1
|
||||
|
@ -208,23 +208,23 @@ struct option
|
|||
|
||||
Return the option character from OPTS just read. Return -1 when
|
||||
there are no more options. For unrecognized options, or options
|
||||
missing arguments, `optopt' is set to the option letter, and '?' is
|
||||
missing arguments, 'optopt' is set to the option letter, and '?' is
|
||||
returned.
|
||||
|
||||
The OPTS string is a list of characters which are recognized option
|
||||
letters, optionally followed by colons, specifying that that letter
|
||||
takes an argument, to be placed in `optarg'.
|
||||
takes an argument, to be placed in 'optarg'.
|
||||
|
||||
If a letter in OPTS is followed by two colons, its argument is
|
||||
optional. This behavior is specific to the GNU `getopt'.
|
||||
optional. This behavior is specific to the GNU 'getopt'.
|
||||
|
||||
The argument `--' causes premature termination of argument
|
||||
scanning, explicitly telling `getopt' that there are no more
|
||||
The argument '--' causes premature termination of argument
|
||||
scanning, explicitly telling 'getopt' that there are no more
|
||||
options.
|
||||
|
||||
If OPTS begins with `-', then non-option arguments are treated as
|
||||
If OPTS begins with '-', then non-option arguments are treated as
|
||||
arguments to the option '\1'. This behavior is specific to the GNU
|
||||
`getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in
|
||||
'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
|
||||
the environment, then do not permute arguments. */
|
||||
|
||||
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2011 Free Software
|
||||
Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2012 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -141,11 +141,11 @@ main (int argc, char **argv)
|
|||
break;
|
||||
|
||||
case 'c':
|
||||
printf ("option c with value `%s'\n", optarg);
|
||||
printf ("option c with value '%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
printf ("option d with value `%s'\n", optarg);
|
||||
printf ("option d with value '%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Internal declarations for getopt.
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2011 Free Software
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2012 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -40,7 +40,7 @@ extern int _getopt_internal (int ___argc, char **___argv,
|
|||
stop option processing when the first non-option is seen.
|
||||
This is what Unix does.
|
||||
This mode of operation is selected by either setting the environment
|
||||
variable POSIXLY_CORRECT, or using `+' as the first character
|
||||
variable POSIXLY_CORRECT, or using '+' as the first character
|
||||
of the list of option characters, or by calling getopt.
|
||||
|
||||
PERMUTE is the default. We permute the contents of ARGV as we
|
||||
|
@ -52,12 +52,12 @@ extern int _getopt_internal (int ___argc, char **___argv,
|
|||
written to expect options and other ARGV-elements in any order
|
||||
and that care about the ordering of the two. We describe each
|
||||
non-option ARGV-element as if it were the argument of an option
|
||||
with character code 1. Using `-' as the first character of the
|
||||
with character code 1. Using '-' as the first character of the
|
||||
list of option characters selects this mode of operation.
|
||||
|
||||
The special argument `--' forces an end of option-scanning regardless
|
||||
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
|
||||
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
|
||||
The special argument '--' forces an end of option-scanning regardless
|
||||
of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
|
||||
'--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
|
||||
|
||||
enum __ord
|
||||
{
|
||||
|
@ -99,8 +99,8 @@ struct _getopt_data
|
|||
/* Handle permutation of arguments. */
|
||||
|
||||
/* Describe the part of ARGV that contains non-options that have
|
||||
been skipped. `first_nonopt' is the index in ARGV of the first
|
||||
of them; `last_nonopt' is the index after the last of them. */
|
||||
been skipped. 'first_nonopt' is the index in ARGV of the first
|
||||
of them; 'last_nonopt' is the index after the last of them. */
|
||||
|
||||
int __first_nonopt;
|
||||
int __last_nonopt;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software
|
||||
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
@ -185,7 +184,7 @@ npgettext_aux (const char *domain,
|
|||
#include <string.h>
|
||||
|
||||
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
|
||||
(((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
|
||||
(((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
|
||||
/* || __STDC_VERSION__ >= 199901L */ )
|
||||
|
||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
## DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -204,7 +204,7 @@ BUILT_SOURCES += inttypes.h
|
|||
|
||||
# We need the following in order to create <inttypes.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
inttypes.h: inttypes.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H)
|
||||
inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
|
||||
|
@ -225,10 +225,12 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_N
|
|||
-e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
|
||||
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
|
||||
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
|
||||
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
|
||||
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
|
||||
-e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
|
||||
-e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
|
||||
-e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||
< $(srcdir)/inttypes.in.h; \
|
||||
|
@ -430,6 +432,29 @@ EXTRA_libgnu_a_SOURCES += stat.c
|
|||
|
||||
## end gnulib module stat
|
||||
|
||||
## begin gnulib module stdalign
|
||||
|
||||
BUILT_SOURCES += $(STDALIGN_H)
|
||||
|
||||
# We need the following in order to create <stdalign.h> when the system
|
||||
# doesn't have one that works.
|
||||
if GL_GENERATE_STDALIGN_H
|
||||
stdalign.h: stdalign.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/stdalign.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
else
|
||||
stdalign.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += stdalign.h stdalign.h-t
|
||||
|
||||
EXTRA_DIST += stdalign.in.h
|
||||
|
||||
## end gnulib module stdalign
|
||||
|
||||
## begin gnulib module stdarg
|
||||
|
||||
BUILT_SOURCES += $(STDARG_H)
|
||||
|
@ -599,7 +624,6 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
|
|||
-e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
|
||||
-e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
|
||||
-e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
|
||||
-e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \
|
||||
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
|
||||
-e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
|
||||
-e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
|
||||
|
@ -719,8 +743,11 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
|||
-e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
|
||||
-e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
|
||||
-e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
|
||||
-e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
|
||||
-e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
|
||||
-e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
|
||||
-e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
|
||||
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
|
||||
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
|
||||
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
|
||||
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
|
||||
|
@ -745,7 +772,10 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
|||
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
|
||||
-e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
|
||||
-e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
|
||||
-e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
|
||||
-e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
|
||||
-e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
|
||||
-e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
|
||||
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
|
||||
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
|
||||
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
|
||||
|
@ -763,7 +793,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
|||
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
|
||||
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
|
||||
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
|
||||
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
|
||||
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
|
||||
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
|
||||
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
|
||||
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
|
||||
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
|
||||
|
@ -854,6 +886,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
|
|||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
|
||||
-e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
|
||||
-e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
|
||||
-e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
|
||||
-e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
|
||||
|
@ -900,6 +933,31 @@ EXTRA_DIST += sys_stat.in.h
|
|||
|
||||
## end gnulib module sys_stat
|
||||
|
||||
## begin gnulib module sys_types
|
||||
|
||||
BUILT_SOURCES += sys/types.h
|
||||
|
||||
# We need the following in order to create <sys/types.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
sys/types.h: sys_types.in.h $(top_builddir)/config.status
|
||||
$(AM_V_at)$(MKDIR_P) sys
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
|
||||
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
|
||||
< $(srcdir)/sys_types.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += sys/types.h sys/types.h-t
|
||||
|
||||
EXTRA_DIST += sys_types.in.h
|
||||
|
||||
## end gnulib module sys_types
|
||||
|
||||
## begin gnulib module time
|
||||
|
||||
BUILT_SOURCES += time.h
|
||||
|
@ -973,6 +1031,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
|||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
|
||||
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
|
||||
-e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
|
||||
-e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
|
||||
-e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
|
||||
|
@ -997,6 +1056,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
|||
-e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
|
||||
-e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
|
||||
-e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
|
||||
-e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
|
||||
-e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
|
||||
-e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
|
||||
-e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
|
||||
|
@ -1009,11 +1069,12 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
|||
-e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
|
||||
-e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
|
||||
-e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
|
||||
-e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
|
||||
-e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
|
||||
-e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
|
||||
-e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
|
||||
-e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
|
||||
-e 's/@''GNULIB_UNISTD_H_GETOPT''@/$(GNULIB_UNISTD_H_GETOPT)/g' \
|
||||
-e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
|
||||
-e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
|
||||
-e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
|
||||
-e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
|
||||
|
@ -1046,6 +1107,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
|||
-e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
|
||||
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
|
||||
-e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
|
||||
-e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
|
||||
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
|
||||
-e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
|
||||
-e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
|
||||
|
@ -1058,6 +1120,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
|||
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
|
||||
-e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
|
||||
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
|
||||
-e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
|
||||
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
|
||||
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
|
||||
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
|
||||
|
@ -1067,11 +1130,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
|||
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
|
||||
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
|
||||
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
|
||||
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
|
||||
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
|
||||
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
|
||||
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
|
||||
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
|
||||
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
|
||||
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
|
||||
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
|
||||
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
|
||||
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ignore a function return without a compiler warning
|
||||
|
||||
Copyright (C) 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2012 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
|
||||
|
@ -35,16 +35,6 @@
|
|||
#ifndef _GL_IGNORE_VALUE_H
|
||||
# define _GL_IGNORE_VALUE_H
|
||||
|
||||
# ifndef _GL_ATTRIBUTE_DEPRECATED
|
||||
/* The __attribute__((__deprecated__)) feature
|
||||
is available in gcc versions 3.1 and newer. */
|
||||
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
|
||||
# define _GL_ATTRIBUTE_DEPRECATED /* empty */
|
||||
# else
|
||||
# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* The __attribute__((__warn_unused_result__)) feature
|
||||
is available in gcc versions 3.4 and newer,
|
||||
while the typeof feature has been available since 2.7 at least. */
|
||||
|
@ -54,9 +44,4 @@
|
|||
# define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
|
||||
# endif
|
||||
|
||||
/* ignore_value works for scalars, pointers and aggregates;
|
||||
deprecate ignore_ptr. */
|
||||
static inline void _GL_ATTRIBUTE_DEPRECATED
|
||||
ignore_ptr (void *p) { (void) p; } /* deprecated: use ignore_value */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* intprops.h -- properties of integer types
|
||||
|
||||
Copyright (C) 2001-2005, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2005, 2009-2012 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
|
||||
|
|
1866
lib/inttypes.in.h
1866
lib/inttypes.in.h
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
/* Work around a bug of lstat on some systems
|
||||
|
||||
Copyright (C) 1997-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2006, 2008-2012 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
|
||||
|
@ -51,11 +51,11 @@ orig_lstat (const char *filename, struct stat *buf)
|
|||
# include <errno.h>
|
||||
|
||||
/* lstat works differently on Linux and Solaris systems. POSIX (see
|
||||
`pathname resolution' in the glossary) requires that programs like
|
||||
`ls' take into consideration the fact that FILE has a trailing slash
|
||||
"pathname resolution" in the glossary) requires that programs like
|
||||
'ls' take into consideration the fact that FILE has a trailing slash
|
||||
when FILE is a symbolic link. On Linux and Solaris 10 systems, the
|
||||
lstat function already has the desired semantics (in treating
|
||||
`lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)',
|
||||
'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)',
|
||||
but on Solaris 9 and earlier it does not.
|
||||
|
||||
If FILE has a trailing slash and specifies a symbolic link,
|
||||
|
|
17
lib/md5.c
17
lib/md5.c
|
@ -1,6 +1,6 @@
|
|||
/* Functions to compute MD5 message digest of files or memory blocks.
|
||||
according to the definition of MD5 in RFC 1321 from April 1992.
|
||||
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2011 Free Software
|
||||
Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2012 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -15,8 +15,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
|
||||
|
||||
|
@ -24,7 +23,8 @@
|
|||
|
||||
#include "md5.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdalign.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -254,8 +254,7 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
|
|||
if (len >= 64)
|
||||
{
|
||||
#if !_STRING_ARCH_unaligned
|
||||
# define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
|
||||
# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
|
||||
if (UNALIGNED_P (buffer))
|
||||
while (len > 64)
|
||||
{
|
||||
|
@ -313,13 +312,13 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
|
|||
uint32_t B = ctx->B;
|
||||
uint32_t C = ctx->C;
|
||||
uint32_t D = ctx->D;
|
||||
uint32_t lolen = len;
|
||||
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
ctx->total[0] += lolen;
|
||||
ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
|
||||
|
||||
/* Process all bytes in the buffer with 64 bytes in each round of
|
||||
the loop. */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Declaration of functions and data types used for MD5 sum computing
|
||||
library functions.
|
||||
Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2011 Free Software
|
||||
Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2012 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
@ -15,8 +15,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _MD5_H
|
||||
#define _MD5_H 1
|
||||
|
@ -73,7 +72,7 @@ struct md5_ctx
|
|||
|
||||
/*
|
||||
* The following three functions are build up the low level used in
|
||||
* the functions `md5_stream' and `md5_buffer'.
|
||||
* the functions 'md5_stream' and 'md5_buffer'.
|
||||
*/
|
||||
|
||||
/* Initialize structure containing state of computation.
|
||||
|
|
430
lib/mktime.c
430
lib/mktime.c
|
@ -1,21 +1,21 @@
|
|||
/* Convert a `struct tm' to a time_t value.
|
||||
Copyright (C) 1993-1999, 2002-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Convert a 'struct tm' to a time_t value.
|
||||
Copyright (C) 1993-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Paul Eggert <eggert@twinsun.com>.
|
||||
|
||||
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, or (at your option)
|
||||
any later version.
|
||||
The GNU C Library 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,
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Define this to have a standalone program to test this implementation of
|
||||
mktime. */
|
||||
|
@ -25,26 +25,8 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Some of the code in this file assumes that signed integer overflow
|
||||
silently wraps around. This assumption can't easily be programmed
|
||||
around, nor can it be checked for portably at compile-time or
|
||||
easily eliminated at run-time.
|
||||
|
||||
Define WRAPV to 1 if the assumption is valid. Otherwise, define it
|
||||
to 0; this forces the use of slower code that, while not guaranteed
|
||||
by the C Standard, works on all production platforms that we know
|
||||
about. */
|
||||
#ifndef WRAPV
|
||||
# if (__GNUC__ == 4 && 4 <= __GNUC_MINOR__) || 4 < __GNUC__
|
||||
# pragma GCC optimize ("wrapv")
|
||||
# define WRAPV 1
|
||||
# else
|
||||
# define WRAPV 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Assume that leap seconds are possible, unless told otherwise.
|
||||
If the host has a `zic' command with a `-L leapsecondfilename' option,
|
||||
If the host has a 'zic' command with a '-L leapsecondfilename' option,
|
||||
then it supports leap seconds; otherwise it probably doesn't. */
|
||||
#ifndef LEAP_SECONDS_POSSIBLE
|
||||
# define LEAP_SECONDS_POSSIBLE 1
|
||||
|
@ -54,7 +36,7 @@
|
|||
|
||||
#include <limits.h>
|
||||
|
||||
#include <string.h> /* For the real memcpy prototype. */
|
||||
#include <string.h> /* For the real memcpy prototype. */
|
||||
|
||||
#if DEBUG
|
||||
# include <stdio.h>
|
||||
|
@ -64,6 +46,28 @@
|
|||
# define mktime my_mktime
|
||||
#endif /* DEBUG */
|
||||
|
||||
/* Some of the code in this file assumes that signed integer overflow
|
||||
silently wraps around. This assumption can't easily be programmed
|
||||
around, nor can it be checked for portably at compile-time or
|
||||
easily eliminated at run-time.
|
||||
|
||||
Define WRAPV to 1 if the assumption is valid and if
|
||||
#pragma GCC optimize ("wrapv")
|
||||
does not trigger GCC bug 51793
|
||||
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51793>.
|
||||
Otherwise, define it to 0; this forces the use of slower code that,
|
||||
while not guaranteed by the C Standard, works on all production
|
||||
platforms that we know about. */
|
||||
#ifndef WRAPV
|
||||
# if (((__GNUC__ == 4 && 4 <= __GNUC_MINOR__) || 4 < __GNUC__) \
|
||||
&& defined __GLIBC__)
|
||||
# pragma GCC optimize ("wrapv")
|
||||
# define WRAPV 1
|
||||
# else
|
||||
# define WRAPV 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Verify a requirement at compile-time (unlike assert, which is runtime). */
|
||||
#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
|
||||
|
||||
|
@ -112,12 +116,12 @@ verify (long_int_is_wide_enough, INT_MAX == INT_MAX * (long_int) 2 / 2);
|
|||
your host. */
|
||||
#define TYPE_MINIMUM(t) \
|
||||
((t) (! TYPE_SIGNED (t) \
|
||||
? (t) 0 \
|
||||
: ~ TYPE_MAXIMUM (t)))
|
||||
? (t) 0 \
|
||||
: ~ TYPE_MAXIMUM (t)))
|
||||
#define TYPE_MAXIMUM(t) \
|
||||
((t) (! TYPE_SIGNED (t) \
|
||||
? (t) -1 \
|
||||
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
|
||||
? (t) -1 \
|
||||
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
|
||||
|
||||
#ifndef TIME_T_MIN
|
||||
# define TIME_T_MIN TYPE_MINIMUM (time_t)
|
||||
|
@ -129,9 +133,9 @@ verify (long_int_is_wide_enough, INT_MAX == INT_MAX * (long_int) 2 / 2);
|
|||
|
||||
verify (time_t_is_integer, TYPE_IS_INTEGER (time_t));
|
||||
verify (twos_complement_arithmetic,
|
||||
(TYPE_TWOS_COMPLEMENT (int)
|
||||
&& TYPE_TWOS_COMPLEMENT (long_int)
|
||||
&& TYPE_TWOS_COMPLEMENT (time_t)));
|
||||
(TYPE_TWOS_COMPLEMENT (int)
|
||||
&& TYPE_TWOS_COMPLEMENT (long_int)
|
||||
&& TYPE_TWOS_COMPLEMENT (time_t)));
|
||||
|
||||
#define EPOCH_YEAR 1970
|
||||
#define TM_YEAR_BASE 1900
|
||||
|
@ -146,7 +150,7 @@ leapyear (long_int year)
|
|||
return
|
||||
((year & 3) == 0
|
||||
&& (year % 100 != 0
|
||||
|| ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3)));
|
||||
|| ((year / 100) & 3) == (- (TM_YEAR_BASE / 100) & 3)));
|
||||
}
|
||||
|
||||
/* How many days come before each month (0-12). */
|
||||
|
@ -178,7 +182,7 @@ const unsigned short int __mon_yday[2][13] =
|
|||
static int
|
||||
isdst_differ (int a, int b)
|
||||
{
|
||||
return (!a != !b) & (0 <= a) & (0 <= b);
|
||||
return (!a != !b) && (0 <= a) && (0 <= b);
|
||||
}
|
||||
|
||||
/* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
|
||||
|
@ -194,7 +198,7 @@ isdst_differ (int a, int b)
|
|||
|
||||
static inline time_t
|
||||
ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
|
||||
int year0, int yday0, int hour0, int min0, int sec0)
|
||||
int year0, int yday0, int hour0, int min0, int sec0)
|
||||
{
|
||||
verify (C99_integer_division, -1 / 2 == 0);
|
||||
|
||||
|
@ -275,15 +279,15 @@ time_t_int_add_ok (time_t a, int b)
|
|||
yield a value equal to *T. */
|
||||
static time_t
|
||||
guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
|
||||
const time_t *t, const struct tm *tp)
|
||||
const time_t *t, const struct tm *tp)
|
||||
{
|
||||
if (tp)
|
||||
{
|
||||
time_t d = ydhms_diff (year, yday, hour, min, sec,
|
||||
tp->tm_year, tp->tm_yday,
|
||||
tp->tm_hour, tp->tm_min, tp->tm_sec);
|
||||
tp->tm_year, tp->tm_yday,
|
||||
tp->tm_hour, tp->tm_min, tp->tm_sec);
|
||||
if (time_t_add_ok (*t, d))
|
||||
return *t + d;
|
||||
return *t + d;
|
||||
}
|
||||
|
||||
/* Overflow occurred one way or another. Return the nearest result
|
||||
|
@ -292,8 +296,8 @@ guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
|
|||
match; and don't oscillate between two values, as that would
|
||||
confuse the spring-forward gap detector. */
|
||||
return (*t < TIME_T_MIDPOINT
|
||||
? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN)
|
||||
: (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX));
|
||||
? (*t <= TIME_T_MIN + 1 ? *t + 1 : TIME_T_MIN)
|
||||
: (TIME_T_MAX - 1 <= *t ? *t - 1 : TIME_T_MAX));
|
||||
}
|
||||
|
||||
/* Use CONVERT to convert *T to a broken down time in *TP.
|
||||
|
@ -301,7 +305,7 @@ guess_time_tm (long_int year, long_int yday, int hour, int min, int sec,
|
|||
it is the nearest in-range value and then convert that. */
|
||||
static struct tm *
|
||||
ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
|
||||
time_t *t, struct tm *tp)
|
||||
time_t *t, struct tm *tp)
|
||||
{
|
||||
struct tm *r = convert (t, tp);
|
||||
|
||||
|
@ -311,25 +315,25 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
|
|||
time_t ok = 0;
|
||||
|
||||
/* BAD is a known unconvertible time_t, and OK is a known good one.
|
||||
Use binary search to narrow the range between BAD and OK until
|
||||
they differ by 1. */
|
||||
Use binary search to narrow the range between BAD and OK until
|
||||
they differ by 1. */
|
||||
while (bad != ok + (bad < 0 ? -1 : 1))
|
||||
{
|
||||
time_t mid = *t = time_t_avg (ok, bad);
|
||||
r = convert (t, tp);
|
||||
if (r)
|
||||
ok = mid;
|
||||
else
|
||||
bad = mid;
|
||||
}
|
||||
{
|
||||
time_t mid = *t = time_t_avg (ok, bad);
|
||||
r = convert (t, tp);
|
||||
if (r)
|
||||
ok = mid;
|
||||
else
|
||||
bad = mid;
|
||||
}
|
||||
|
||||
if (!r && ok)
|
||||
{
|
||||
/* The last conversion attempt failed;
|
||||
revert to the most recent successful attempt. */
|
||||
*t = ok;
|
||||
r = convert (t, tp);
|
||||
}
|
||||
{
|
||||
/* The last conversion attempt failed;
|
||||
revert to the most recent successful attempt. */
|
||||
*t = ok;
|
||||
r = convert (t, tp);
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
|
@ -344,8 +348,8 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
|
|||
This function is external because it is used also by timegm.c. */
|
||||
time_t
|
||||
__mktime_internal (struct tm *tp,
|
||||
struct tm *(*convert) (const time_t *, struct tm *),
|
||||
time_t *offset)
|
||||
struct tm *(*convert) (const time_t *, struct tm *),
|
||||
time_t *offset)
|
||||
{
|
||||
time_t t, gt, t0, t1, t2;
|
||||
struct tm tm;
|
||||
|
@ -384,8 +388,8 @@ __mktime_internal (struct tm *tp,
|
|||
/* Calculate day of year from year, month, and day of month.
|
||||
The result need not be in range. */
|
||||
int mon_yday = ((__mon_yday[leapyear (year)]
|
||||
[mon_remainder + 12 * negative_mon_remainder])
|
||||
- 1);
|
||||
[mon_remainder + 12 * negative_mon_remainder])
|
||||
- 1);
|
||||
long_int lmday = mday;
|
||||
long_int yday = mon_yday + lmday;
|
||||
|
||||
|
@ -396,33 +400,33 @@ __mktime_internal (struct tm *tp,
|
|||
if (LEAP_SECONDS_POSSIBLE)
|
||||
{
|
||||
/* Handle out-of-range seconds specially,
|
||||
since ydhms_tm_diff assumes every minute has 60 seconds. */
|
||||
since ydhms_tm_diff assumes every minute has 60 seconds. */
|
||||
if (sec < 0)
|
||||
sec = 0;
|
||||
sec = 0;
|
||||
if (59 < sec)
|
||||
sec = 59;
|
||||
sec = 59;
|
||||
}
|
||||
|
||||
/* Invert CONVERT by probing. First assume the same offset as last
|
||||
time. */
|
||||
|
||||
t0 = ydhms_diff (year, yday, hour, min, sec,
|
||||
EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset);
|
||||
EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, - guessed_offset);
|
||||
|
||||
if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3)
|
||||
{
|
||||
/* time_t isn't large enough to rule out overflows, so check
|
||||
for major overflows. A gross check suffices, since if t0
|
||||
has overflowed, it is off by a multiple of TIME_T_MAX -
|
||||
TIME_T_MIN + 1. So ignore any component of the difference
|
||||
that is bounded by a small value. */
|
||||
for major overflows. A gross check suffices, since if t0
|
||||
has overflowed, it is off by a multiple of TIME_T_MAX -
|
||||
TIME_T_MIN + 1. So ignore any component of the difference
|
||||
that is bounded by a small value. */
|
||||
|
||||
/* Approximate log base 2 of the number of time units per
|
||||
biennium. A biennium is 2 years; use this unit instead of
|
||||
years to avoid integer overflow. For example, 2 average
|
||||
Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds,
|
||||
which is 63113904 seconds, and rint (log2 (63113904)) is
|
||||
26. */
|
||||
biennium. A biennium is 2 years; use this unit instead of
|
||||
years to avoid integer overflow. For example, 2 average
|
||||
Gregorian years are 2 * 365.2425 * 24 * 60 * 60 seconds,
|
||||
which is 63113904 seconds, and rint (log2 (63113904)) is
|
||||
26. */
|
||||
int ALOG2_SECONDS_PER_BIENNIUM = 26;
|
||||
int ALOG2_MINUTES_PER_BIENNIUM = 20;
|
||||
int ALOG2_HOURS_PER_BIENNIUM = 14;
|
||||
|
@ -430,64 +434,64 @@ __mktime_internal (struct tm *tp,
|
|||
int LOG2_YEARS_PER_BIENNIUM = 1;
|
||||
|
||||
int approx_requested_biennia =
|
||||
(SHR (year_requested, LOG2_YEARS_PER_BIENNIUM)
|
||||
- SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM)
|
||||
+ SHR (mday, ALOG2_DAYS_PER_BIENNIUM)
|
||||
+ SHR (hour, ALOG2_HOURS_PER_BIENNIUM)
|
||||
+ SHR (min, ALOG2_MINUTES_PER_BIENNIUM)
|
||||
+ (LEAP_SECONDS_POSSIBLE
|
||||
? 0
|
||||
: SHR (sec, ALOG2_SECONDS_PER_BIENNIUM)));
|
||||
(SHR (year_requested, LOG2_YEARS_PER_BIENNIUM)
|
||||
- SHR (EPOCH_YEAR - TM_YEAR_BASE, LOG2_YEARS_PER_BIENNIUM)
|
||||
+ SHR (mday, ALOG2_DAYS_PER_BIENNIUM)
|
||||
+ SHR (hour, ALOG2_HOURS_PER_BIENNIUM)
|
||||
+ SHR (min, ALOG2_MINUTES_PER_BIENNIUM)
|
||||
+ (LEAP_SECONDS_POSSIBLE
|
||||
? 0
|
||||
: SHR (sec, ALOG2_SECONDS_PER_BIENNIUM)));
|
||||
|
||||
int approx_biennia = SHR (t0, ALOG2_SECONDS_PER_BIENNIUM);
|
||||
int diff = approx_biennia - approx_requested_biennia;
|
||||
int abs_diff = diff < 0 ? -1 - diff : diff;
|
||||
int approx_abs_diff = diff < 0 ? -1 - diff : diff;
|
||||
|
||||
/* IRIX 4.0.5 cc miscalculates TIME_T_MIN / 3: it erroneously
|
||||
gives a positive value of 715827882. Setting a variable
|
||||
first then doing math on it seems to work.
|
||||
(ghazi@caip.rutgers.edu) */
|
||||
gives a positive value of 715827882. Setting a variable
|
||||
first then doing math on it seems to work.
|
||||
(ghazi@caip.rutgers.edu) */
|
||||
time_t time_t_max = TIME_T_MAX;
|
||||
time_t time_t_min = TIME_T_MIN;
|
||||
time_t overflow_threshold =
|
||||
(time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM;
|
||||
(time_t_max / 3 - time_t_min / 3) >> ALOG2_SECONDS_PER_BIENNIUM;
|
||||
|
||||
if (overflow_threshold < abs_diff)
|
||||
{
|
||||
/* Overflow occurred. Try repairing it; this might work if
|
||||
the time zone offset is enough to undo the overflow. */
|
||||
time_t repaired_t0 = -1 - t0;
|
||||
approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM);
|
||||
diff = approx_biennia - approx_requested_biennia;
|
||||
abs_diff = diff < 0 ? -1 - diff : diff;
|
||||
if (overflow_threshold < abs_diff)
|
||||
return -1;
|
||||
guessed_offset += repaired_t0 - t0;
|
||||
t0 = repaired_t0;
|
||||
}
|
||||
if (overflow_threshold < approx_abs_diff)
|
||||
{
|
||||
/* Overflow occurred. Try repairing it; this might work if
|
||||
the time zone offset is enough to undo the overflow. */
|
||||
time_t repaired_t0 = -1 - t0;
|
||||
approx_biennia = SHR (repaired_t0, ALOG2_SECONDS_PER_BIENNIUM);
|
||||
diff = approx_biennia - approx_requested_biennia;
|
||||
approx_abs_diff = diff < 0 ? -1 - diff : diff;
|
||||
if (overflow_threshold < approx_abs_diff)
|
||||
return -1;
|
||||
guessed_offset += repaired_t0 - t0;
|
||||
t0 = repaired_t0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Repeatedly use the error to improve the guess. */
|
||||
|
||||
for (t = t1 = t2 = t0, dst2 = 0;
|
||||
(gt = guess_time_tm (year, yday, hour, min, sec, &t,
|
||||
ranged_convert (convert, &t, &tm)),
|
||||
t != gt);
|
||||
ranged_convert (convert, &t, &tm)),
|
||||
t != gt);
|
||||
t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0)
|
||||
if (t == t1 && t != t2
|
||||
&& (tm.tm_isdst < 0
|
||||
|| (isdst < 0
|
||||
? dst2 <= (tm.tm_isdst != 0)
|
||||
: (isdst != 0) != (tm.tm_isdst != 0))))
|
||||
&& (tm.tm_isdst < 0
|
||||
|| (isdst < 0
|
||||
? dst2 <= (tm.tm_isdst != 0)
|
||||
: (isdst != 0) != (tm.tm_isdst != 0))))
|
||||
/* We can't possibly find a match, as we are oscillating
|
||||
between two values. The requested time probably falls
|
||||
within a spring-forward gap of size GT - T. Follow the common
|
||||
practice in this case, which is to return a time that is GT - T
|
||||
away from the requested time, preferring a time whose
|
||||
tm_isdst differs from the requested value. (If no tm_isdst
|
||||
was requested and only one of the two values has a nonzero
|
||||
tm_isdst, prefer that value.) In practice, this is more
|
||||
useful than returning -1. */
|
||||
between two values. The requested time probably falls
|
||||
within a spring-forward gap of size GT - T. Follow the common
|
||||
practice in this case, which is to return a time that is GT - T
|
||||
away from the requested time, preferring a time whose
|
||||
tm_isdst differs from the requested value. (If no tm_isdst
|
||||
was requested and only one of the two values has a nonzero
|
||||
tm_isdst, prefer that value.) In practice, this is more
|
||||
useful than returning -1. */
|
||||
goto offset_found;
|
||||
else if (--remaining_probes == 0)
|
||||
return -1;
|
||||
|
@ -497,50 +501,50 @@ __mktime_internal (struct tm *tp,
|
|||
if (isdst_differ (isdst, tm.tm_isdst))
|
||||
{
|
||||
/* tm.tm_isdst has the wrong value. Look for a neighboring
|
||||
time with the right value, and use its UTC offset.
|
||||
time with the right value, and use its UTC offset.
|
||||
|
||||
Heuristic: probe the adjacent timestamps in both directions,
|
||||
looking for the desired isdst. This should work for all real
|
||||
time zone histories in the tz database. */
|
||||
Heuristic: probe the adjacent timestamps in both directions,
|
||||
looking for the desired isdst. This should work for all real
|
||||
time zone histories in the tz database. */
|
||||
|
||||
/* Distance between probes when looking for a DST boundary. In
|
||||
tzdata2003a, the shortest period of DST is 601200 seconds
|
||||
(e.g., America/Recife starting 2000-10-08 01:00), and the
|
||||
shortest period of non-DST surrounded by DST is 694800
|
||||
seconds (Africa/Tunis starting 1943-04-17 01:00). Use the
|
||||
minimum of these two values, so we don't miss these short
|
||||
periods when probing. */
|
||||
tzdata2003a, the shortest period of DST is 601200 seconds
|
||||
(e.g., America/Recife starting 2000-10-08 01:00), and the
|
||||
shortest period of non-DST surrounded by DST is 694800
|
||||
seconds (Africa/Tunis starting 1943-04-17 01:00). Use the
|
||||
minimum of these two values, so we don't miss these short
|
||||
periods when probing. */
|
||||
int stride = 601200;
|
||||
|
||||
/* The longest period of DST in tzdata2003a is 536454000 seconds
|
||||
(e.g., America/Jujuy starting 1946-10-01 01:00). The longest
|
||||
period of non-DST is much longer, but it makes no real sense
|
||||
to search for more than a year of non-DST, so use the DST
|
||||
max. */
|
||||
(e.g., America/Jujuy starting 1946-10-01 01:00). The longest
|
||||
period of non-DST is much longer, but it makes no real sense
|
||||
to search for more than a year of non-DST, so use the DST
|
||||
max. */
|
||||
int duration_max = 536454000;
|
||||
|
||||
/* Search in both directions, so the maximum distance is half
|
||||
the duration; add the stride to avoid off-by-1 problems. */
|
||||
the duration; add the stride to avoid off-by-1 problems. */
|
||||
int delta_bound = duration_max / 2 + stride;
|
||||
|
||||
int delta, direction;
|
||||
|
||||
for (delta = stride; delta < delta_bound; delta += stride)
|
||||
for (direction = -1; direction <= 1; direction += 2)
|
||||
if (time_t_int_add_ok (t, delta * direction))
|
||||
{
|
||||
time_t ot = t + delta * direction;
|
||||
struct tm otm;
|
||||
ranged_convert (convert, &ot, &otm);
|
||||
if (! isdst_differ (isdst, otm.tm_isdst))
|
||||
{
|
||||
/* We found the desired tm_isdst.
|
||||
Extrapolate back to the desired time. */
|
||||
t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm);
|
||||
ranged_convert (convert, &t, &tm);
|
||||
goto offset_found;
|
||||
}
|
||||
}
|
||||
for (direction = -1; direction <= 1; direction += 2)
|
||||
if (time_t_int_add_ok (t, delta * direction))
|
||||
{
|
||||
time_t ot = t + delta * direction;
|
||||
struct tm otm;
|
||||
ranged_convert (convert, &ot, &otm);
|
||||
if (! isdst_differ (isdst, otm.tm_isdst))
|
||||
{
|
||||
/* We found the desired tm_isdst.
|
||||
Extrapolate back to the desired time. */
|
||||
t = guess_time_tm (year, yday, hour, min, sec, &ot, &otm);
|
||||
ranged_convert (convert, &t, &tm);
|
||||
goto offset_found;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
offset_found:
|
||||
|
@ -549,16 +553,16 @@ __mktime_internal (struct tm *tp,
|
|||
if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec)
|
||||
{
|
||||
/* Adjust time to reflect the tm_sec requested, not the normalized value.
|
||||
Also, repair any damage from a false match due to a leap second. */
|
||||
Also, repair any damage from a false match due to a leap second. */
|
||||
int sec_adjustment = (sec == 0 && tm.tm_sec == 60) - sec;
|
||||
if (! time_t_int_add_ok (t, sec_requested))
|
||||
return -1;
|
||||
return -1;
|
||||
t1 = t + sec_requested;
|
||||
if (! time_t_int_add_ok (t1, sec_adjustment))
|
||||
return -1;
|
||||
return -1;
|
||||
t2 = t1 + sec_adjustment;
|
||||
if (! convert (&t2, &tm))
|
||||
return -1;
|
||||
return -1;
|
||||
t = t2;
|
||||
}
|
||||
|
||||
|
@ -579,7 +583,7 @@ mktime (struct tm *tp)
|
|||
{
|
||||
#ifdef _LIBC
|
||||
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
|
||||
time zone names contained in the external variable `tzname' shall
|
||||
time zone names contained in the external variable 'tzname' shall
|
||||
be set as if the tzset() function had been called. */
|
||||
__tzset ();
|
||||
#endif
|
||||
|
@ -602,13 +606,13 @@ static int
|
|||
not_equal_tm (const struct tm *a, const struct tm *b)
|
||||
{
|
||||
return ((a->tm_sec ^ b->tm_sec)
|
||||
| (a->tm_min ^ b->tm_min)
|
||||
| (a->tm_hour ^ b->tm_hour)
|
||||
| (a->tm_mday ^ b->tm_mday)
|
||||
| (a->tm_mon ^ b->tm_mon)
|
||||
| (a->tm_year ^ b->tm_year)
|
||||
| (a->tm_yday ^ b->tm_yday)
|
||||
| isdst_differ (a->tm_isdst, b->tm_isdst));
|
||||
| (a->tm_min ^ b->tm_min)
|
||||
| (a->tm_hour ^ b->tm_hour)
|
||||
| (a->tm_mday ^ b->tm_mday)
|
||||
| (a->tm_mon ^ b->tm_mon)
|
||||
| (a->tm_year ^ b->tm_year)
|
||||
| (a->tm_yday ^ b->tm_yday)
|
||||
| isdst_differ (a->tm_isdst, b->tm_isdst));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -616,9 +620,9 @@ print_tm (const struct tm *tp)
|
|||
{
|
||||
if (tp)
|
||||
printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
|
||||
tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
|
||||
tp->tm_hour, tp->tm_min, tp->tm_sec,
|
||||
tp->tm_yday, tp->tm_wday, tp->tm_isdst);
|
||||
tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
|
||||
tp->tm_hour, tp->tm_min, tp->tm_sec,
|
||||
tp->tm_yday, tp->tm_wday, tp->tm_isdst);
|
||||
else
|
||||
printf ("0");
|
||||
}
|
||||
|
@ -650,11 +654,11 @@ main (int argc, char **argv)
|
|||
|
||||
if ((argc == 3 || argc == 4)
|
||||
&& (sscanf (argv[1], "%d-%d-%d%c",
|
||||
&tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
|
||||
== 3)
|
||||
&tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
|
||||
== 3)
|
||||
&& (sscanf (argv[2], "%d:%d:%d%c",
|
||||
&tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
|
||||
== 3))
|
||||
&tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
|
||||
== 3))
|
||||
{
|
||||
tm.tm_year -= TM_YEAR_BASE;
|
||||
tm.tm_mon--;
|
||||
|
@ -663,10 +667,10 @@ main (int argc, char **argv)
|
|||
tl = mktime (&tmk);
|
||||
lt = localtime (&tl);
|
||||
if (lt)
|
||||
{
|
||||
tml = *lt;
|
||||
lt = &tml;
|
||||
}
|
||||
{
|
||||
tml = *lt;
|
||||
lt = &tml;
|
||||
}
|
||||
printf ("mktime returns %ld == ", (long int) tl);
|
||||
print_tm (&tmk);
|
||||
printf ("\n");
|
||||
|
@ -679,51 +683,51 @@ main (int argc, char **argv)
|
|||
time_t to = atol (argv[3]);
|
||||
|
||||
if (argc == 4)
|
||||
for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
|
||||
{
|
||||
lt = localtime (&tl);
|
||||
if (lt)
|
||||
{
|
||||
tmk = tml = *lt;
|
||||
tk = mktime (&tmk);
|
||||
status |= check_result (tk, tmk, tl, &tml);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("localtime (%ld) yields 0\n", (long int) tl);
|
||||
status = 1;
|
||||
}
|
||||
tl1 = tl + by;
|
||||
if ((tl1 < tl) != (by < 0))
|
||||
break;
|
||||
}
|
||||
for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
|
||||
{
|
||||
lt = localtime (&tl);
|
||||
if (lt)
|
||||
{
|
||||
tmk = tml = *lt;
|
||||
tk = mktime (&tmk);
|
||||
status |= check_result (tk, tmk, tl, &tml);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("localtime (%ld) yields 0\n", (long int) tl);
|
||||
status = 1;
|
||||
}
|
||||
tl1 = tl + by;
|
||||
if ((tl1 < tl) != (by < 0))
|
||||
break;
|
||||
}
|
||||
else
|
||||
for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
|
||||
{
|
||||
/* Null benchmark. */
|
||||
lt = localtime (&tl);
|
||||
if (lt)
|
||||
{
|
||||
tmk = tml = *lt;
|
||||
tk = tl;
|
||||
status |= check_result (tk, tmk, tl, &tml);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("localtime (%ld) yields 0\n", (long int) tl);
|
||||
status = 1;
|
||||
}
|
||||
tl1 = tl + by;
|
||||
if ((tl1 < tl) != (by < 0))
|
||||
break;
|
||||
}
|
||||
for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1)
|
||||
{
|
||||
/* Null benchmark. */
|
||||
lt = localtime (&tl);
|
||||
if (lt)
|
||||
{
|
||||
tmk = tml = *lt;
|
||||
tk = tl;
|
||||
status |= check_result (tk, tmk, tl, &tml);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("localtime (%ld) yields 0\n", (long int) tl);
|
||||
status = 1;
|
||||
}
|
||||
tl1 = tl + by;
|
||||
if ((tl1 < tl) != (by < 0))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
printf ("Usage:\
|
||||
\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
|
||||
\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
|
||||
\t%s FROM BY TO - # Do not test those values (for benchmark).\n",
|
||||
argv[0], argv[0], argv[0]);
|
||||
argv[0], argv[0], argv[0]);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Define PATH_MAX somehow. Requires sys/types.h.
|
||||
Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2011 Free Software
|
||||
Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2012 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _PATHMAX_H
|
||||
# define _PATHMAX_H
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* POSIX compatible signal blocking for threads.
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2012 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Stub for readlink().
|
||||
Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2007, 2009-2012 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
|
||||
|
|
17
lib/sha1.c
17
lib/sha1.c
|
@ -1,7 +1,7 @@
|
|||
/* sha1.c - Functions to compute SHA1 message digest of files or
|
||||
memory blocks according to the NIST specification FIPS-180-1.
|
||||
|
||||
Copyright (C) 2000-2001, 2003-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2001, 2003-2006, 2008-2012 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
|
||||
|
@ -14,8 +14,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Scott G. Miller
|
||||
Credits:
|
||||
|
@ -26,7 +25,8 @@
|
|||
|
||||
#include "sha1.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdalign.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -241,8 +241,7 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
|
|||
if (len >= 64)
|
||||
{
|
||||
#if !_STRING_ARCH_unaligned
|
||||
# define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
|
||||
# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
|
||||
if (UNALIGNED_P (buffer))
|
||||
while (len > 64)
|
||||
{
|
||||
|
@ -306,13 +305,13 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
|
|||
uint32_t c = ctx->C;
|
||||
uint32_t d = ctx->D;
|
||||
uint32_t e = ctx->E;
|
||||
uint32_t lolen = len;
|
||||
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
ctx->total[0] += lolen;
|
||||
ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
|
||||
|
||||
#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n))))
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Declarations of functions and data types used for SHA1 sum
|
||||
library functions.
|
||||
Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2011 Free Software
|
||||
Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2012 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
|
@ -14,8 +14,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef SHA1_H
|
||||
# define SHA1_H 1
|
||||
|
|
14
lib/sha256.c
14
lib/sha256.c
|
@ -1,7 +1,7 @@
|
|||
/* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or
|
||||
memory blocks according to the NIST specification FIPS-180-2.
|
||||
|
||||
Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2008-2012 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
|
||||
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include "sha256.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdalign.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -373,8 +374,7 @@ sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
|
|||
if (len >= 64)
|
||||
{
|
||||
#if !_STRING_ARCH_unaligned
|
||||
# define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
|
||||
# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
|
||||
if (UNALIGNED_P (buffer))
|
||||
while (len > 64)
|
||||
{
|
||||
|
@ -454,13 +454,13 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
|
|||
uint32_t f = ctx->state[5];
|
||||
uint32_t g = ctx->state[6];
|
||||
uint32_t h = ctx->state[7];
|
||||
uint32_t lolen = len;
|
||||
|
||||
/* First increment the byte count. FIPS PUB 180-2 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
ctx->total[0] += lolen;
|
||||
ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
|
||||
|
||||
#define rol(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
|
||||
#define S0(x) (rol(x,25)^rol(x,14)^(x>>3))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Declarations of functions and data types used for SHA256 and SHA224 sum
|
||||
library functions.
|
||||
Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2008-2012 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
|
||||
|
|
16
lib/sha512.c
16
lib/sha512.c
|
@ -1,7 +1,7 @@
|
|||
/* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or
|
||||
memory blocks according to the NIST specification FIPS-180-2.
|
||||
|
||||
Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2008-2012 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
|
||||
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include "sha512.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdalign.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -381,8 +382,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
|
|||
if (len >= 128)
|
||||
{
|
||||
#if !_STRING_ARCH_unaligned
|
||||
# define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
# define UNALIGNED_P(p) (((size_t) p) % alignof (u64) != 0)
|
||||
# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (u64) != 0)
|
||||
if (UNALIGNED_P (buffer))
|
||||
while (len > 128)
|
||||
{
|
||||
|
@ -485,13 +485,15 @@ sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
|
|||
u64 f = ctx->state[5];
|
||||
u64 g = ctx->state[6];
|
||||
u64 h = ctx->state[7];
|
||||
u64 lolen = u64size (len);
|
||||
|
||||
/* First increment the byte count. FIPS PUB 180-2 specifies the possible
|
||||
length of the file up to 2^128 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] = u64plus (ctx->total[0], u64lo (len));
|
||||
if (u64lt (ctx->total[0], u64lo (len)))
|
||||
ctx->total[1] = u64plus (ctx->total[1], u64lo (1));
|
||||
ctx->total[0] = u64plus (ctx->total[0], lolen);
|
||||
ctx->total[1] = u64plus (ctx->total[1],
|
||||
u64plus (u64size (len >> 31 >> 31 >> 2),
|
||||
u64lo (u64lt (ctx->total[0], lolen))));
|
||||
|
||||
#define S0(x) u64xor (u64rol(x, 63), u64xor (u64rol (x, 56), u64shr (x, 7)))
|
||||
#define S1(x) u64xor (u64rol (x, 45), u64xor (u64rol (x, 3), u64shr (x, 6)))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Declarations of functions and data types used for SHA512 and SHA384 sum
|
||||
library functions.
|
||||
Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2008-2012 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* A GNU-like <signal.h>.
|
||||
|
||||
Copyright (C) 2006-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2012 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* POSIX compatible signal blocking.
|
||||
Copyright (C) 2006-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2006.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
@ -32,7 +32,7 @@
|
|||
also does not have the POSIX sigaction() function, only the
|
||||
signal() function. We also assume signal() has SysV semantics,
|
||||
where any handler is uninstalled prior to being invoked. This is
|
||||
true for Woe32 platforms. */
|
||||
true for native Windows platforms. */
|
||||
|
||||
/* We use raw signal(), but also provide a wrapper rpl_signal() so
|
||||
that applications can query or change a blocked signal. */
|
||||
|
@ -344,5 +344,6 @@ _gl_raise_SIGPIPE (void)
|
|||
else if (handler != SIG_IGN)
|
||||
(*handler) (SIGPIPE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
16
lib/stat.c
16
lib/stat.c
|
@ -1,5 +1,5 @@
|
|||
/* Work around platform bugs in stat.
|
||||
Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2012 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
|
||||
|
@ -27,6 +27,20 @@
|
|||
#include <sys/stat.h>
|
||||
#undef __need_system_sys_stat_h
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# if _GL_WINDOWS_64_BIT_ST_SIZE
|
||||
# define stat _stati64
|
||||
# define REPLACE_FUNC_STAT_DIR 1
|
||||
# undef REPLACE_FUNC_STAT_FILE
|
||||
# elif REPLACE_FUNC_STAT_FILE
|
||||
/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a.
|
||||
Bypass it. */
|
||||
# define stat _stat
|
||||
# define REPLACE_FUNC_STAT_DIR 1
|
||||
# undef REPLACE_FUNC_STAT_FILE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static inline int
|
||||
orig_stat (const char *filename, struct stat *buf)
|
||||
{
|
||||
|
|
90
lib/stdalign.in.h
Normal file
90
lib/stdalign.in.h
Normal file
|
@ -0,0 +1,90 @@
|
|||
/* A substitute for ISO C11 <stdalign.h>.
|
||||
|
||||
Copyright 2011-2012 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert and Bruno Haible. */
|
||||
|
||||
#ifndef _GL_STDALIGN_H
|
||||
#define _GL_STDALIGN_H
|
||||
|
||||
/* ISO C11 <stdalign.h> for platforms that lack it.
|
||||
|
||||
References:
|
||||
ISO C11 (latest free draft
|
||||
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf>)
|
||||
sections 6.5.3.4, 6.7.5, 7.15.
|
||||
C++11 (latest free draft
|
||||
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
|
||||
section 18.10. */
|
||||
|
||||
/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
|
||||
requirement of a structure member (i.e., slot or field) that is of
|
||||
type TYPE, as an integer constant expression.
|
||||
|
||||
This differs from GCC's __alignof__ operator, which can yield a
|
||||
better-performing alignment for an object of that type. For
|
||||
example, on x86 with GCC, __alignof__ (double) and __alignof__
|
||||
(long long) are 8, whereas alignof (double) and alignof (long long)
|
||||
are 4 unless the option '-malign-double' is used.
|
||||
|
||||
The result cannot be used as a value for an 'enum' constant, if you
|
||||
want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
|
||||
#include <stddef.h>
|
||||
#if defined __cplusplus
|
||||
template <class __t> struct __alignof_helper { char __a; __t __b; };
|
||||
# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
|
||||
#else
|
||||
# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
|
||||
#endif
|
||||
#define alignof _Alignof
|
||||
#define __alignof_is_defined 1
|
||||
|
||||
/* alignas (A), also known as _Alignas (A), aligns a variable or type
|
||||
to the alignment A, where A is an integer constant expression. For
|
||||
example:
|
||||
|
||||
int alignas (8) foo;
|
||||
struct s { int a; int alignas (8) bar; };
|
||||
|
||||
aligns the address of FOO and the offset of BAR to be multiples of 8.
|
||||
|
||||
A should be a power of two that is at least the type's alignment
|
||||
and at most the implementation's alignment limit. This limit is
|
||||
2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
|
||||
to MSVC through at least version 10.0, A should be an integer
|
||||
constant, as MSVC does not support expressions such as 1 << 3.
|
||||
To be portable to Sun C 5.11, do not align auto variables to
|
||||
anything stricter than their default alignment.
|
||||
|
||||
The following C11 requirements are not supported here:
|
||||
|
||||
- If A is zero, alignas has no effect.
|
||||
- alignas can be used multiple times; the strictest one wins.
|
||||
- alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
|
||||
|
||||
*/
|
||||
|
||||
#if __GNUC__ || __IBMC__ || __IBMCPP__ || 0x5110 <= __SUNPRO_C
|
||||
# define _Alignas(a) __attribute__ ((__aligned__ (a)))
|
||||
#elif 1300 <= _MSC_VER
|
||||
# define _Alignas(a) __declspec (align (a))
|
||||
#endif
|
||||
#ifdef _Alignas
|
||||
# define alignas _Alignas
|
||||
# define __alignas_is_defined 1
|
||||
#endif
|
||||
|
||||
#endif /* _GL_STDALIGN_H */
|
|
@ -1,5 +1,5 @@
|
|||
/* Substitute for and wrapper around <stdarg.h>.
|
||||
Copyright (C) 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2012 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
|
||||
|
@ -12,8 +12,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_STDARG_H
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2003, 2006-2011 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001-2003, 2006-2012 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -12,8 +12,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_STDBOOL_H
|
||||
#define _GL_STDBOOL_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
|
||||
|
||||
Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2012 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
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Eric Blake. */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
|
||||
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
|
||||
This file is part of gnulib.
|
||||
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C 99 <stdint.h> for platforms that lack it.
|
||||
|
@ -34,6 +33,16 @@
|
|||
<inttypes.h>. */
|
||||
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
|
||||
|
||||
/* On Android (Bionic libc), <sys/types.h> includes this file before
|
||||
having defined 'time_t'. Therefore in this case avoid including
|
||||
other system header files; just include the system's <stdint.h>.
|
||||
Ideally we should test __BIONIC__ here, but it is only defined after
|
||||
<sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
|
||||
#if defined __ANDROID__ \
|
||||
&& defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
|
||||
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
|
||||
#else
|
||||
|
||||
/* Get those types that are already defined in other system include
|
||||
files, so that we can "#define int8_t signed char" below without
|
||||
worrying about a later system include file containing a "typedef
|
||||
|
@ -49,6 +58,17 @@
|
|||
diagnostics. */
|
||||
# define __STDINT_H__
|
||||
# endif
|
||||
|
||||
/* Some pre-C++11 <stdint.h> implementations need this. */
|
||||
# ifdef __cplusplus
|
||||
# ifndef __STDC_CONSTANT_MACROS
|
||||
# define __STDC_CONSTANT_MACROS 1
|
||||
# endif
|
||||
# ifndef __STDC_LIMIT_MACROS
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Other systems may have an incomplete or buggy <stdint.h>.
|
||||
Include it before <inttypes.h>, since any "#include <stdint.h>"
|
||||
in <inttypes.h> would reinclude us, skipping our contents because
|
||||
|
@ -70,7 +90,8 @@
|
|||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
|
||||
/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
|
||||
LONG_MIN, LONG_MAX, ULONG_MAX. */
|
||||
#include <limits.h>
|
||||
|
||||
#if @HAVE_INTTYPES_H@
|
||||
|
@ -226,8 +247,9 @@ typedef unsigned long long int gl_uint64_t;
|
|||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
|
||||
are taken from the same list of types. Assume that 'long int'
|
||||
is fast enough for all narrower integers. */
|
||||
are taken from the same list of types. The following code normally
|
||||
uses types consistent with glibc, as that lessens the chance of
|
||||
incompatibility with older GNU hosts. */
|
||||
|
||||
#undef int_fast8_t
|
||||
#undef uint_fast8_t
|
||||
|
@ -237,12 +259,21 @@ typedef unsigned long long int gl_uint64_t;
|
|||
#undef uint_fast32_t
|
||||
#undef int_fast64_t
|
||||
#undef uint_fast64_t
|
||||
typedef long int gl_int_fast8_t;
|
||||
typedef unsigned long int gl_uint_fast8_t;
|
||||
typedef long int gl_int_fast16_t;
|
||||
typedef unsigned long int gl_uint_fast16_t;
|
||||
typedef signed char gl_int_fast8_t;
|
||||
typedef unsigned char gl_uint_fast8_t;
|
||||
|
||||
#ifdef __sun
|
||||
/* Define types compatible with SunOS 5.10, so that code compiled under
|
||||
earlier SunOS versions works with code compiled under SunOS 5.10. */
|
||||
typedef int gl_int_fast32_t;
|
||||
typedef unsigned int gl_uint_fast32_t;
|
||||
#else
|
||||
typedef long int gl_int_fast32_t;
|
||||
typedef unsigned long int gl_uint_fast32_t;
|
||||
#endif
|
||||
typedef gl_int_fast32_t gl_int_fast16_t;
|
||||
typedef gl_uint_fast32_t gl_uint_fast16_t;
|
||||
|
||||
#define int_fast8_t gl_int_fast8_t
|
||||
#define uint_fast8_t gl_uint_fast8_t
|
||||
#define int_fast16_t gl_int_fast16_t
|
||||
|
@ -313,8 +344,6 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
|
|||
|
||||
/* 7.18.2. Limits of specified-width integer types */
|
||||
|
||||
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
|
||||
|
||||
/* 7.18.2.1. Limits of exact-width integer types */
|
||||
|
||||
/* Here we assume a standard architecture where the hardware integer
|
||||
|
@ -400,23 +429,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
|
|||
#undef INT_FAST8_MIN
|
||||
#undef INT_FAST8_MAX
|
||||
#undef UINT_FAST8_MAX
|
||||
#define INT_FAST8_MIN LONG_MIN
|
||||
#define INT_FAST8_MAX LONG_MAX
|
||||
#define UINT_FAST8_MAX ULONG_MAX
|
||||
#define INT_FAST8_MIN SCHAR_MIN
|
||||
#define INT_FAST8_MAX SCHAR_MAX
|
||||
#define UINT_FAST8_MAX UCHAR_MAX
|
||||
|
||||
#undef INT_FAST16_MIN
|
||||
#undef INT_FAST16_MAX
|
||||
#undef UINT_FAST16_MAX
|
||||
#define INT_FAST16_MIN LONG_MIN
|
||||
#define INT_FAST16_MAX LONG_MAX
|
||||
#define UINT_FAST16_MAX ULONG_MAX
|
||||
#define INT_FAST16_MIN INT_FAST32_MIN
|
||||
#define INT_FAST16_MAX INT_FAST32_MAX
|
||||
#define UINT_FAST16_MAX UINT_FAST32_MAX
|
||||
|
||||
#undef INT_FAST32_MIN
|
||||
#undef INT_FAST32_MAX
|
||||
#undef UINT_FAST32_MAX
|
||||
#define INT_FAST32_MIN LONG_MIN
|
||||
#define INT_FAST32_MAX LONG_MAX
|
||||
#define UINT_FAST32_MAX ULONG_MAX
|
||||
#ifdef __sun
|
||||
# define INT_FAST32_MIN INT_MIN
|
||||
# define INT_FAST32_MAX INT_MAX
|
||||
# define UINT_FAST32_MAX UINT_MAX
|
||||
#else
|
||||
# define INT_FAST32_MIN LONG_MIN
|
||||
# define INT_FAST32_MAX LONG_MAX
|
||||
# define UINT_FAST32_MAX ULONG_MAX
|
||||
#endif
|
||||
|
||||
#undef INT_FAST64_MIN
|
||||
#undef INT_FAST64_MAX
|
||||
|
@ -534,12 +569,8 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
|
|||
#define WINT_MAX \
|
||||
_STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
|
||||
|
||||
#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
|
||||
|
||||
/* 7.18.4. Macros for integer constants */
|
||||
|
||||
#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
|
||||
|
||||
/* 7.18.4.1. Macros for minimum-width integer constants */
|
||||
/* According to ISO C 99 Technical Corrigendum 1 */
|
||||
|
||||
|
@ -600,7 +631,6 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_STDINT_H */
|
||||
#endif /* !(defined __ANDROID__ && ...) */
|
||||
#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* A GNU-like <stdio.h>.
|
||||
|
||||
Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2007-2012 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
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
|
@ -53,7 +52,8 @@
|
|||
#include <stddef.h>
|
||||
|
||||
/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8
|
||||
and eglibc 2.11.2. */
|
||||
and eglibc 2.11.2.
|
||||
May also define off_t to a 64-bit type on native Windows. */
|
||||
#include <sys/types.h>
|
||||
|
||||
/* The __attribute__ feature is available in gcc versions 2.5 and later.
|
||||
|
@ -186,7 +186,7 @@ _GL_CXXALIASWARN (fdopen);
|
|||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef fdopen
|
||||
/* Assume fdopen is always declared. */
|
||||
_GL_WARN_ON_USE (fdopen, "fdopen on Win32 platforms is not POSIX compatible - "
|
||||
_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
|
||||
"use gnulib module fdopen for portability");
|
||||
#endif
|
||||
|
||||
|
@ -259,7 +259,7 @@ _GL_CXXALIASWARN (fopen);
|
|||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef fopen
|
||||
/* Assume fopen is always declared. */
|
||||
_GL_WARN_ON_USE (fopen, "fopen on Win32 platforms is not POSIX compatible - "
|
||||
_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
|
||||
"use gnulib module fopen for portability");
|
||||
#endif
|
||||
|
||||
|
@ -387,7 +387,7 @@ _GL_CXXALIASWARN (freopen);
|
|||
# undef freopen
|
||||
/* Assume freopen is always declared. */
|
||||
_GL_WARN_ON_USE (freopen,
|
||||
"freopen on Win32 platforms is not POSIX compatible - "
|
||||
"freopen on native Windows platforms is not POSIX compliant - "
|
||||
"use gnulib module freopen for portability");
|
||||
#endif
|
||||
|
||||
|
@ -699,22 +699,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_GETS@
|
||||
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef gets
|
||||
# define gets rpl_gets
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (gets, char *, (char *s));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (gets, char *, (char *s));
|
||||
# undef gets
|
||||
# endif
|
||||
_GL_CXXALIASWARN (gets);
|
||||
/* It is very rare that the developer ever has full control of stdin,
|
||||
so any use of gets warrants an unconditional warning. Assume it is
|
||||
always declared, since it is required by C89. */
|
||||
so any use of gets warrants an unconditional warning; besides, C11
|
||||
removed it. */
|
||||
#undef gets
|
||||
#if HAVE_RAW_DECL_GETS
|
||||
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
|
||||
#endif
|
||||
|
||||
|
@ -779,7 +768,7 @@ _GL_CXXALIASWARN (pclose);
|
|||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef pclose
|
||||
# if HAVE_RAW_DECL_PCLOSE
|
||||
_GL_WARN_ON_USE (pclose, "popen is unportable - "
|
||||
_GL_WARN_ON_USE (pclose, "pclose is unportable - "
|
||||
"use gnulib module pclose for more portability");
|
||||
# endif
|
||||
#endif
|
||||
|
@ -1054,9 +1043,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/* Some people would argue that sprintf should be handled like gets
|
||||
(for example, OpenBSD issues a link warning for both functions),
|
||||
since both can cause security holes due to buffer overruns.
|
||||
/* Some people would argue that all sprintf uses should be warned about
|
||||
(for example, OpenBSD issues a link warning for it),
|
||||
since it can cause security holes due to buffer overruns.
|
||||
However, we believe that sprintf can be used safely, and is more
|
||||
efficient than snprintf in those safe cases; and as proof of our
|
||||
belief, we use sprintf in several gnulib modules. So this header
|
||||
|
|
190
lib/stdlib.in.h
190
lib/stdlib.in.h
|
@ -1,6 +1,6 @@
|
|||
/* A GNU-like <stdlib.h>.
|
||||
|
||||
Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 2001-2004, 2006-2012 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
|
||||
|
@ -49,6 +49,11 @@
|
|||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
|
||||
/* Native Windows platforms declare mktemp() in <io.h>. */
|
||||
#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM_R@
|
||||
|
||||
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
|
||||
|
@ -58,7 +63,7 @@
|
|||
# include <random.h>
|
||||
# endif
|
||||
|
||||
# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@
|
||||
# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
|
||||
|
@ -89,6 +94,14 @@ struct random_data
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* The __attribute__ feature is available in gcc versions 2.5 and later.
|
||||
The attribute __pure__ was added in gcc 2.96. */
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
|
||||
#else
|
||||
# define _GL_ATTRIBUTE_PURE /* empty */
|
||||
#endif
|
||||
|
||||
/* The definition of _Noreturn is copied here. */
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
@ -133,7 +146,9 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
|
|||
/* Parse a signed decimal integer.
|
||||
Returns the value of the integer. Errors are not detected. */
|
||||
# if !@HAVE_ATOLL@
|
||||
_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
|
||||
_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
|
||||
_GL_ATTRIBUTE_PURE
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
|
||||
_GL_CXXALIASWARN (atoll);
|
||||
|
@ -247,7 +262,7 @@ _GL_CXXALIASWARN (grantpt);
|
|||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef grantpt
|
||||
# if HAVE_RAW_DECL_GRANTPT
|
||||
_GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
|
||||
_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
|
||||
"use gnulib module grantpt for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
@ -423,6 +438,22 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_POSIX_OPENPT@
|
||||
/* Return an FD open to the master side of a pseudo-terminal. Flags should
|
||||
include O_RDWR, and may also include O_NOCTTY. */
|
||||
# if !@HAVE_POSIX_OPENPT@
|
||||
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
|
||||
_GL_CXXALIASWARN (posix_openpt);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef posix_openpt
|
||||
# if HAVE_RAW_DECL_POSIX_OPENPT
|
||||
_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
|
||||
"use gnulib module posix_openpt for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_PTSNAME@
|
||||
/* Return the pathname of the pseudo-terminal slave associated with
|
||||
the master FD is open on, or NULL on errors. */
|
||||
|
@ -439,6 +470,32 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_PTSNAME_R@
|
||||
/* Set the pathname of the pseudo-terminal slave associated with
|
||||
the master FD is open on and return 0, or set errno and return
|
||||
non-zero on errors. */
|
||||
# if @REPLACE_PTSNAME_R@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef ptsname_r
|
||||
# define ptsname_r rpl_ptsname_r
|
||||
# endif
|
||||
_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));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ptsname_r);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef ptsname_r
|
||||
# if HAVE_RAW_DECL_PTSNAME_R
|
||||
_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
|
||||
"use gnulib module ptsname_r for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_PUTENV@
|
||||
# if @REPLACE_PUTENV@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
|
@ -462,12 +519,83 @@ _GL_CXXALIASWARN (putenv);
|
|||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_RANDOM@
|
||||
# if !@HAVE_RANDOM@
|
||||
_GL_FUNCDECL_SYS (random, long, (void));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (random, long, (void));
|
||||
_GL_CXXALIASWARN (random);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef random
|
||||
# if HAVE_RAW_DECL_RANDOM
|
||||
_GL_WARN_ON_USE (random, "random is unportable - "
|
||||
"use gnulib module random for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM@
|
||||
# if !@HAVE_RANDOM@
|
||||
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
|
||||
_GL_CXXALIASWARN (srandom);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef srandom
|
||||
# if HAVE_RAW_DECL_SRANDOM
|
||||
_GL_WARN_ON_USE (srandom, "srandom is unportable - "
|
||||
"use gnulib module random for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM@
|
||||
# if !@HAVE_RANDOM@
|
||||
_GL_FUNCDECL_SYS (initstate, char *,
|
||||
(unsigned int seed, char *buf, size_t buf_size)
|
||||
_GL_ARG_NONNULL ((2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (initstate, char *,
|
||||
(unsigned int seed, char *buf, size_t buf_size));
|
||||
_GL_CXXALIASWARN (initstate);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef initstate
|
||||
# if HAVE_RAW_DECL_INITSTATE_R
|
||||
_GL_WARN_ON_USE (initstate, "initstate is unportable - "
|
||||
"use gnulib module random for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM@
|
||||
# if !@HAVE_RANDOM@
|
||||
_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
|
||||
_GL_CXXALIASWARN (setstate);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef setstate
|
||||
# if HAVE_RAW_DECL_SETSTATE_R
|
||||
_GL_WARN_ON_USE (setstate, "setstate is unportable - "
|
||||
"use gnulib module random for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_RANDOM_R@
|
||||
# if !@HAVE_RANDOM_R@
|
||||
# if @REPLACE_RANDOM_R@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef random_r
|
||||
# define random_r rpl_random_r
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
|
||||
# else
|
||||
# if !@HAVE_RANDOM_R@
|
||||
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (random_r);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef random_r
|
||||
|
@ -478,13 +606,25 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - "
|
|||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM_R@
|
||||
# if !@HAVE_RANDOM_R@
|
||||
# if @REPLACE_RANDOM_R@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef srandom_r
|
||||
# define srandom_r rpl_srandom_r
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (srandom_r, int,
|
||||
(unsigned int seed, struct random_data *rand_state)
|
||||
_GL_ARG_NONNULL ((2)));
|
||||
_GL_CXXALIAS_RPL (srandom_r, int,
|
||||
(unsigned int seed, struct random_data *rand_state));
|
||||
# else
|
||||
# if !@HAVE_RANDOM_R@
|
||||
_GL_FUNCDECL_SYS (srandom_r, int,
|
||||
(unsigned int seed, struct random_data *rand_state)
|
||||
_GL_ARG_NONNULL ((2)));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (srandom_r, int,
|
||||
(unsigned int seed, struct random_data *rand_state));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (srandom_r);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef srandom_r
|
||||
|
@ -495,15 +635,29 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
|
|||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM_R@
|
||||
# if !@HAVE_RANDOM_R@
|
||||
# if @REPLACE_RANDOM_R@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef initstate_r
|
||||
# define initstate_r rpl_initstate_r
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (initstate_r, int,
|
||||
(unsigned int seed, char *buf, size_t buf_size,
|
||||
struct random_data *rand_state)
|
||||
_GL_ARG_NONNULL ((2, 4)));
|
||||
_GL_CXXALIAS_RPL (initstate_r, int,
|
||||
(unsigned int seed, char *buf, size_t buf_size,
|
||||
struct random_data *rand_state));
|
||||
# else
|
||||
# if !@HAVE_RANDOM_R@
|
||||
_GL_FUNCDECL_SYS (initstate_r, int,
|
||||
(unsigned int seed, char *buf, size_t buf_size,
|
||||
struct random_data *rand_state)
|
||||
_GL_ARG_NONNULL ((2, 4)));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (initstate_r, int,
|
||||
(unsigned int seed, char *buf, size_t buf_size,
|
||||
struct random_data *rand_state));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (initstate_r);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef initstate_r
|
||||
|
@ -514,13 +668,25 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
|
|||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM_R@
|
||||
# if !@HAVE_RANDOM_R@
|
||||
# if @REPLACE_RANDOM_R@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef setstate_r
|
||||
# define setstate_r rpl_setstate_r
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (setstate_r, int,
|
||||
(char *arg_state, struct random_data *rand_state)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (setstate_r, int,
|
||||
(char *arg_state, struct random_data *rand_state));
|
||||
# else
|
||||
# if !@HAVE_RANDOM_R@
|
||||
_GL_FUNCDECL_SYS (setstate_r, int,
|
||||
(char *arg_state, struct random_data *rand_state)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (setstate_r, int,
|
||||
(char *arg_state, struct random_data *rand_state));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (setstate_r);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef setstate_r
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1991-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
@ -40,7 +40,7 @@
|
|||
extern char *tzname[];
|
||||
#endif
|
||||
|
||||
/* Do multibyte processing if multibytes are supported, unless
|
||||
/* Do multibyte processing if multibyte encodings are supported, unless
|
||||
multibyte sequences are safe in formats. Multibyte sequences are
|
||||
safe if they cannot contain byte sequences that look like format
|
||||
conversion specifications. The multibyte encodings used by the
|
||||
|
@ -289,7 +289,7 @@ extern char *tzname[];
|
|||
# define TOLOWER(Ch, L) tolower (Ch)
|
||||
# endif
|
||||
#endif
|
||||
/* We don't use `isdigit' here since the locale dependent
|
||||
/* We don't use 'isdigit' here since the locale dependent
|
||||
interpretation is not what we want here. We only need to accept
|
||||
the arabic digits in the ASCII range. One day there is perhaps a
|
||||
more reliable way to accept other sets of digits. */
|
||||
|
@ -437,7 +437,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
|
|||
#ifdef _NL_CURRENT
|
||||
/* We cannot make the following values variables since we must delay
|
||||
the evaluation of these values until really needed since some
|
||||
expressions might not be valid in every situation. The `struct tm'
|
||||
expressions might not be valid in every situation. The 'struct tm'
|
||||
might be generated by a strptime() call that initialized
|
||||
only a few elements. Dereference the pointers only if the format
|
||||
requires this. Then it is ok to fail if the pointers are invalid. */
|
||||
|
@ -896,7 +896,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
|
|||
goto do_number_body;
|
||||
|
||||
do_number_spacepad:
|
||||
/* Force `_' flag unless overridden by `0' or `-' flag. */
|
||||
/* Force '_' flag unless overridden by '0' or '-' flag. */
|
||||
if (pad != L_('0') && pad != L_('-'))
|
||||
pad = L_('_');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* declarations for strftime.c
|
||||
|
||||
Copyright (C) 2002, 2004, 2008-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2004, 2008-2012 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Convert string representation of a number into an intmax_t value.
|
||||
|
||||
Copyright (C) 1999, 2001-2004, 2006, 2009-2011 Free Software Foundation,
|
||||
Copyright (C) 1999, 2001-2004, 2006, 2009-2012 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
|
14
lib/strtol.c
14
lib/strtol.c
|
@ -1,6 +1,6 @@
|
|||
/* Convert string representation of a number into an integer value.
|
||||
|
||||
Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2011 Free Software
|
||||
Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2012 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
|
@ -40,7 +40,7 @@
|
|||
# include "../locale/localeinfo.h"
|
||||
#endif
|
||||
|
||||
/* Nonzero if we are defining `strtoul' or `strtoull', operating on
|
||||
/* Nonzero if we are defining 'strtoul' or 'strtoull', operating on
|
||||
unsigned integers. */
|
||||
#ifndef UNSIGNED
|
||||
# define UNSIGNED 0
|
||||
|
@ -110,8 +110,8 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/* If QUAD is defined, we are defining `strtoll' or `strtoull',
|
||||
operating on `long long int's. */
|
||||
/* If QUAD is defined, we are defining 'strtoll' or 'strtoull',
|
||||
operating on 'long long int's. */
|
||||
#ifdef QUAD
|
||||
# define LONG long long
|
||||
# define STRTOL_LONG_MIN LLONG_MIN
|
||||
|
@ -227,7 +227,7 @@
|
|||
|
||||
|
||||
|
||||
/* Convert NPTR to an `unsigned long int' or `long int' in base BASE.
|
||||
/* Convert NPTR to an 'unsigned long int' or 'long int' in base BASE.
|
||||
If BASE is 0 the base is determined by the presence of a leading
|
||||
zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal.
|
||||
If BASE is < 2 or > 36, it is reset to 10.
|
||||
|
@ -380,7 +380,7 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
|||
|
||||
#if !UNSIGNED
|
||||
/* Check for a value that is within the range of
|
||||
`unsigned LONG int', but outside the range of `LONG int'. */
|
||||
'unsigned LONG int', but outside the range of 'LONG int'. */
|
||||
if (overflow == 0
|
||||
&& i > (negative
|
||||
? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1
|
||||
|
@ -405,7 +405,7 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
|||
/* We must handle a special case here: the base is 0 or 16 and the
|
||||
first two characters are '0' and 'x', but the rest are no
|
||||
hexadecimal digits. This is no error case. We return 0 and
|
||||
ENDPTR points to the `x`. */
|
||||
ENDPTR points to the 'x'. */
|
||||
if (endptr != NULL)
|
||||
{
|
||||
if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Function to parse a `long long int' from text.
|
||||
Copyright (C) 1995-1997, 1999, 2001, 2009-2011 Free Software Foundation,
|
||||
/* Function to parse a 'long long int' from text.
|
||||
Copyright (C) 1995-1997, 1999, 2001, 2009-2012 Free Software Foundation,
|
||||
Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1991, 1997, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1997, 2009-2012 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Function to parse an `unsigned long long int' from text.
|
||||
Copyright (C) 1995-1997, 1999, 2009-2011 Free Software Foundation, Inc.
|
||||
/* Function to parse an 'unsigned long long int' from text.
|
||||
Copyright (C) 1995-1997, 1999, 2009-2012 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Stub for symlink().
|
||||
Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2012 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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Provide a more complete sys/stat header file.
|
||||
Copyright (C) 2005-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2012 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
|
||||
|
@ -12,8 +12,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */
|
||||
|
||||
|
@ -36,7 +35,8 @@
|
|||
|
||||
#ifndef _@GUARD_PREFIX@_SYS_STAT_H
|
||||
|
||||
/* Get nlink_t. */
|
||||
/* Get nlink_t.
|
||||
May also define off_t to a 64-bit type on native Windows. */
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Get struct timespec. */
|
||||
|
@ -62,6 +62,16 @@
|
|||
# include <direct.h> /* mingw64, MSVC 9 */
|
||||
#endif
|
||||
|
||||
/* Native Windows platforms declare umask() in <io.h>. */
|
||||
#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
/* Large File Support on native Windows. */
|
||||
#if @WINDOWS_64_BIT_ST_SIZE@
|
||||
# define stat _stati64
|
||||
#endif
|
||||
|
||||
#ifndef S_IFIFO
|
||||
# ifdef _S_IFIFO
|
||||
# define S_IFIFO _S_IFIFO
|
||||
|
@ -331,6 +341,9 @@ _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
|
|||
_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (fstat);
|
||||
#elif @WINDOWS_64_BIT_ST_SIZE@
|
||||
/* Above, we define stat to _stati64. */
|
||||
# define fstat _fstati64
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef fstat
|
||||
# if HAVE_RAW_DECL_FSTAT
|
||||
|
@ -611,14 +624,55 @@ _GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
|
|||
/* We can't use the object-like #define stat rpl_stat, because of
|
||||
struct stat. This means that rpl_stat will not be used if the user
|
||||
does (stat)(a,b). Oh well. */
|
||||
# undef stat
|
||||
# ifdef _LARGE_FILES
|
||||
# if defined _AIX && defined stat && defined _LARGE_FILES
|
||||
/* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
|
||||
so we have to replace stat64() instead of stat(). */
|
||||
# define stat stat64
|
||||
# undef stat64
|
||||
# define stat64(name, st) rpl_stat (name, st)
|
||||
# else /* !_LARGE_FILES */
|
||||
# elif @WINDOWS_64_BIT_ST_SIZE@
|
||||
/* Above, we define stat to _stati64. */
|
||||
# if defined __MINGW32__ && defined _stati64
|
||||
# ifndef _USE_32BIT_TIME_T
|
||||
/* The system headers define _stati64 to _stat64. */
|
||||
# undef _stat64
|
||||
# define _stat64(name, st) rpl_stat (name, st)
|
||||
# endif
|
||||
# elif defined _MSC_VER && defined _stati64
|
||||
# ifdef _USE_32BIT_TIME_T
|
||||
/* The system headers define _stati64 to _stat32i64. */
|
||||
# undef _stat32i64
|
||||
# define _stat32i64(name, st) rpl_stat (name, st)
|
||||
# else
|
||||
/* The system headers define _stati64 to _stat64. */
|
||||
# undef _stat64
|
||||
# define _stat64(name, st) rpl_stat (name, st)
|
||||
# endif
|
||||
# else
|
||||
# undef _stati64
|
||||
# define _stati64(name, st) rpl_stat (name, st)
|
||||
# endif
|
||||
# elif defined __MINGW32__ && defined stat
|
||||
# ifdef _USE_32BIT_TIME_T
|
||||
/* The system headers define stat to _stat32i64. */
|
||||
# undef _stat32i64
|
||||
# define _stat32i64(name, st) rpl_stat (name, st)
|
||||
# else
|
||||
/* The system headers define stat to _stat64. */
|
||||
# undef _stat64
|
||||
# define _stat64(name, st) rpl_stat (name, st)
|
||||
# endif
|
||||
# elif defined _MSC_VER && defined stat
|
||||
# ifdef _USE_32BIT_TIME_T
|
||||
/* The system headers define stat to _stat32. */
|
||||
# undef _stat32
|
||||
# define _stat32(name, st) rpl_stat (name, st)
|
||||
# else
|
||||
/* The system headers define stat to _stat64i32. */
|
||||
# undef _stat64i32
|
||||
# define _stat64i32(name, st) rpl_stat (name, st)
|
||||
# endif
|
||||
# else /* !(_AIX ||__MINGW32__ || _MSC_VER) */
|
||||
# undef stat
|
||||
# define stat(name, st) rpl_stat (name, st)
|
||||
# endif /* !_LARGE_FILES */
|
||||
_GL_EXTERN_C int stat (const char *name, struct stat *buf)
|
||||
|
|
51
lib/sys_types.in.h
Normal file
51
lib/sys_types.in.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* Provide a more complete sys/types.h.
|
||||
|
||||
Copyright (C) 2011-2012 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
|
||||
#define _@GUARD_PREFIX@_SYS_TYPES_H
|
||||
|
||||
/* Override off_t if Large File Support is requested on native Windows. */
|
||||
#if @WINDOWS_64_BIT_OFF_T@
|
||||
/* Same as int64_t in <stdint.h>. */
|
||||
# if defined _MSC_VER
|
||||
# define off_t __int64
|
||||
# else
|
||||
# define off_t long long int
|
||||
# endif
|
||||
/* Indicator, for gnulib internal purposes. */
|
||||
# define _GL_WINDOWS_64_BIT_OFF_T 1
|
||||
#endif
|
||||
|
||||
/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
|
||||
/* But avoid namespace pollution on glibc systems. */
|
||||
#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
|
||||
&& ! defined __GLIBC__
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
|
||||
#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
|
|
@ -1,6 +1,6 @@
|
|||
/* A more-standard <time.h>.
|
||||
|
||||
Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2012 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
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Reentrant time functions like localtime_r.
|
||||
|
||||
Copyright (C) 2003, 2006-2007, 2010-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2006-2007, 2010-2012 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
|
||||
|
@ -13,8 +13,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
|
13
lib/u64.h
13
lib/u64.h
|
@ -1,6 +1,6 @@
|
|||
/* uint64_t-like operations that work even on hosts lacking uint64_t
|
||||
|
||||
Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2012 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
|
||||
|
@ -30,6 +30,7 @@ typedef uint64_t u64;
|
|||
# define u64hilo(hi, lo) ((u64) (((u64) (hi) << 32) + (lo)))
|
||||
# define u64init(hi, lo) u64hilo (hi, lo)
|
||||
# define u64lo(x) ((u64) (x))
|
||||
# define u64size(x) u64lo (x)
|
||||
# define u64lt(x, y) ((x) < (y))
|
||||
# define u64and(x, y) ((x) & (y))
|
||||
# define u64or(x, y) ((x) | (y))
|
||||
|
@ -72,6 +73,16 @@ u64lo (uint32_t lo)
|
|||
return r;
|
||||
}
|
||||
|
||||
/* Return a u64 value representing SIZE. */
|
||||
static inline u64
|
||||
u64size (size_t size)
|
||||
{
|
||||
u64 r;
|
||||
r.hi = size >> 31 >> 1;
|
||||
r.lo = size;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X < Y. */
|
||||
static inline int
|
||||
u64lt (u64 x, u64 y)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Substitute for and wrapper around <unistd.h>.
|
||||
Copyright (C) 2003-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2012 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
|
||||
|
@ -12,8 +12,7 @@
|
|||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
|
@ -84,12 +83,19 @@
|
|||
#endif
|
||||
|
||||
/* Native Windows platforms declare chdir, getcwd, rmdir in
|
||||
<io.h> and/or <direct.h>, not in <unistd.h>. */
|
||||
<io.h> and/or <direct.h>, not in <unistd.h>.
|
||||
They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
|
||||
lseek(), read(), unlink(), write() in <io.h>. */
|
||||
#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
|
||||
|| defined GNULIB_POSIXCHECK) \
|
||||
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
|
||||
# include <io.h> /* mingw32, mingw64 */
|
||||
# include <direct.h> /* mingw64, MSVC 9 */
|
||||
#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
|
||||
|| @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
|
||||
|| defined GNULIB_POSIXCHECK) \
|
||||
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
|
||||
|
@ -101,8 +107,9 @@
|
|||
# include <netdb.h>
|
||||
#endif
|
||||
|
||||
/* MSVC defines off_t in <sys/types.h>. */
|
||||
#if !@HAVE_UNISTD_H@
|
||||
/* MSVC defines off_t in <sys/types.h>.
|
||||
May also define off_t to a 64-bit type on native Windows. */
|
||||
#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@
|
||||
/* Get off_t. */
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
@ -556,10 +563,19 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
|
|||
Return 0 if successful, otherwise -1 and errno set.
|
||||
See the POSIX:2008 specification
|
||||
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. */
|
||||
# if !@HAVE_FTRUNCATE@
|
||||
# if @REPLACE_FTRUNCATE@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef ftruncate
|
||||
# define ftruncate rpl_ftruncate
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
|
||||
_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
|
||||
# else
|
||||
# if !@HAVE_FTRUNCATE@
|
||||
_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
|
||||
# endif
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (ftruncate);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef ftruncate
|
||||
|
@ -935,6 +951,27 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
|
|||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_ISATTY@
|
||||
# if @REPLACE_ISATTY@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef isatty
|
||||
# define isatty rpl_isatty
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (isatty, int, (int fd));
|
||||
_GL_CXXALIAS_RPL (isatty, int, (int fd));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (isatty, int, (int fd));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (isatty);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef isatty
|
||||
# if HAVE_RAW_DECL_ISATTY
|
||||
_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
|
||||
"use gnulib module isatty for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_LCHOWN@
|
||||
/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
|
||||
to GID (if GID is not -1). Do not follow symbolic links.
|
||||
|
@ -1268,6 +1305,33 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
|
|||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_SETHOSTNAME@
|
||||
/* Set the host name of the machine.
|
||||
The host name may or may not be fully qualified.
|
||||
|
||||
Put LEN bytes of NAME into the host name.
|
||||
Return 0 if successful, otherwise, set errno and return -1.
|
||||
|
||||
Platforms with no ability to set the hostname return -1 and set
|
||||
errno = ENOSYS. */
|
||||
# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
|
||||
_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5
|
||||
and FreeBSD 6.4 the second parameter is int. On Solaris 11
|
||||
2011-10, the first parameter is not const. */
|
||||
_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
|
||||
_GL_CXXALIASWARN (sethostname);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef sethostname
|
||||
# if HAVE_RAW_DECL_SETHOSTNAME
|
||||
_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
|
||||
"use gnulib module sethostname for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_SLEEP@
|
||||
/* Pause the execution of the current thread for N seconds.
|
||||
Returns the number of seconds left to sleep.
|
||||
|
|
16
lib/verify.h
16
lib/verify.h
|
@ -1,6 +1,6 @@
|
|||
/* Compile-time assert-like macros.
|
||||
|
||||
Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2009-2012 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
|
||||
|
@ -21,13 +21,11 @@
|
|||
# define _GL_VERIFY_H
|
||||
|
||||
|
||||
/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per the
|
||||
C1X draft N1548 section 6.7.10. This is supported by GCC 4.6.0 and
|
||||
later, in C mode, and its use here generates easier-to-read diagnostics
|
||||
when verify (R) fails.
|
||||
/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
|
||||
This is supported by GCC 4.6.0 and later, in C mode, and its use
|
||||
here generates easier-to-read diagnostics when verify (R) fails.
|
||||
|
||||
Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per the
|
||||
C++0X draft N3242 section 7.(4).
|
||||
Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
|
||||
This will likely be supported by future GCC versions, in C++ mode.
|
||||
|
||||
Use this only with GCC. If we were willing to slow 'configure'
|
||||
|
@ -188,7 +186,7 @@ template <int w>
|
|||
trailing ';'. If R is false, fail at compile-time, preferably
|
||||
with a diagnostic that includes the string-literal DIAGNOSTIC.
|
||||
|
||||
Unfortunately, unlike C1X, this implementation must appear as an
|
||||
Unfortunately, unlike C11, this implementation must appear as an
|
||||
ordinary declaration, and cannot appear inside struct { ... }. */
|
||||
|
||||
# ifdef _GL_HAVE__STATIC_ASSERT
|
||||
|
@ -205,7 +203,7 @@ template <int w>
|
|||
# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
|
||||
# endif
|
||||
# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
|
||||
# define static_assert _Static_assert /* Draft C1X requires this #define. */
|
||||
# define static_assert _Static_assert /* C11 requires this #define. */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 00gnulib.m4 serial 2
|
||||
dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
18
m4/alloca.m4
18
m4/alloca.m4
|
@ -1,5 +1,5 @@
|
|||
# alloca.m4 serial 13
|
||||
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
|
||||
# alloca.m4 serial 14
|
||||
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2012 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -53,8 +53,8 @@ m4_version_prereq([2.69], [] ,[
|
|||
|
||||
# _AC_LIBOBJ_ALLOCA
|
||||
# -----------------
|
||||
# Set up the LIBOBJ replacement of `alloca'. Well, not exactly
|
||||
# AC_LIBOBJ since we actually set the output variable `ALLOCA'.
|
||||
# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly
|
||||
# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
|
||||
# Nevertheless, for Automake, AC_LIBSOURCES it.
|
||||
m4_define([_AC_LIBOBJ_ALLOCA],
|
||||
[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
|
||||
|
@ -63,9 +63,9 @@ m4_define([_AC_LIBOBJ_ALLOCA],
|
|||
# use ar to extract alloca.o from them instead of compiling alloca.c.
|
||||
AC_LIBSOURCES(alloca.c)
|
||||
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
|
||||
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using `alloca.c'.])
|
||||
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
|
||||
|
||||
AC_CACHE_CHECK(whether `alloca.c' needs Cray hooks, ac_cv_os_cray,
|
||||
AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
|
||||
[AC_EGREP_CPP(webecray,
|
||||
[#if defined CRAY && ! defined CRAY2
|
||||
webecray
|
||||
|
@ -77,10 +77,10 @@ if test $ac_cv_os_cray = yes; then
|
|||
for ac_func in _getb67 GETB67 getb67; do
|
||||
AC_CHECK_FUNC($ac_func,
|
||||
[AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
|
||||
[Define to one of `_getb67', `GETB67',
|
||||
`getb67' for Cray-2 and Cray-YMP
|
||||
[Define to one of '_getb67', 'GETB67',
|
||||
'getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for
|
||||
`alloca.c' support on those systems.])
|
||||
'alloca.c' support on those systems.])
|
||||
break])
|
||||
done
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# c-strtod.m4 serial 14
|
||||
|
||||
# Copyright (C) 2004-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004-2006, 2009-2012 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
|
29
m4/dup2.m4
29
m4/dup2.m4
|
@ -1,5 +1,5 @@
|
|||
#serial 16
|
||||
dnl Copyright (C) 2002, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
#serial 18
|
||||
dnl Copyright (C) 2002, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -45,29 +45,34 @@ AC_DEFUN([gl_FUNC_DUP2],
|
|||
[gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
|
||||
[case "$host_os" in
|
||||
mingw*) # on this platform, dup2 always returns 0 for success
|
||||
gl_cv_func_dup2_works=no;;
|
||||
gl_cv_func_dup2_works="guessing no" ;;
|
||||
cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
|
||||
gl_cv_func_dup2_works=no;;
|
||||
gl_cv_func_dup2_works="guessing no" ;;
|
||||
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
|
||||
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
|
||||
gl_cv_func_dup2_works=no;;
|
||||
gl_cv_func_dup2_works="guessing no" ;;
|
||||
freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
|
||||
gl_cv_func_dup2_works=no;;
|
||||
gl_cv_func_dup2_works="guessing no" ;;
|
||||
haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
|
||||
gl_cv_func_dup2_works=no;;
|
||||
*) gl_cv_func_dup2_works=yes;;
|
||||
gl_cv_func_dup2_works="guessing no" ;;
|
||||
*) gl_cv_func_dup2_works="guessing yes" ;;
|
||||
esac])
|
||||
])
|
||||
if test "$gl_cv_func_dup2_works" = no; then
|
||||
REPLACE_DUP2=1
|
||||
fi
|
||||
case "$gl_cv_func_dup2_works" in
|
||||
*yes) ;;
|
||||
*)
|
||||
REPLACE_DUP2=1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
|
||||
dnl to keep fchdir's bookkeeping up-to-date.
|
||||
m4_ifdef([gl_FUNC_FCHDIR], [
|
||||
gl_TEST_FCHDIR
|
||||
if test $HAVE_FCHDIR = 0; then
|
||||
REPLACE_DUP2=1
|
||||
if test $HAVE_DUP2 = 1; then
|
||||
REPLACE_DUP2=1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# serial 10 -*- Autoconf -*-
|
||||
# serial 11 -*- Autoconf -*-
|
||||
# Enable extensions on systems that normally disable them.
|
||||
|
||||
# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -43,7 +43,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
|
|||
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
|
||||
if test "$MINIX" = yes; then
|
||||
AC_DEFINE([_POSIX_SOURCE], [1],
|
||||
[Define to 1 if you need to in order for `stat' and other
|
||||
[Define to 1 if you need to in order for 'stat' and other
|
||||
things to work.])
|
||||
AC_DEFINE([_POSIX_1_SOURCE], [2],
|
||||
[Define to 2 if the system does not provide POSIX.1 features
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# filemode.m4 serial 8
|
||||
dnl Copyright (C) 2002, 2005-2006, 2009-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2002, 2005-2006, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Check for getloadavg.
|
||||
|
||||
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2011 Free Software
|
||||
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2012 Free Software
|
||||
# Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
|
@ -100,7 +100,7 @@ AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
|
|||
|
||||
# gl_PREREQ_GETLOADAVG
|
||||
# --------------------
|
||||
# Set up the AC_LIBOBJ replacement of `getloadavg'.
|
||||
# Set up the AC_LIBOBJ replacement of 'getloadavg'.
|
||||
AC_DEFUN([gl_PREREQ_GETLOADAVG],
|
||||
[
|
||||
# Figure out what our getloadavg.c needs.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# getopt.m4 serial 38
|
||||
dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
# getopt.m4 serial 39
|
||||
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -25,8 +25,6 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
|
|||
if test $REPLACE_GETOPT = 1; then
|
||||
dnl Arrange for getopt.h to be created.
|
||||
gl_GETOPT_SUBSTITUTE_HEADER
|
||||
dnl Arrange for unistd.h to include getopt.h.
|
||||
GNULIB_UNISTD_H_GETOPT=1
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# gnulib-common.m4 serial 31
|
||||
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
# gnulib-common.m4 serial 32
|
||||
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -13,12 +13,13 @@ AC_DEFUN([gl_COMMON], [
|
|||
])
|
||||
AC_DEFUN([gl_COMMON_BODY], [
|
||||
AH_VERBATIM([_Noreturn],
|
||||
[/* The _Noreturn keyword of draft C1X. */
|
||||
#ifndef _Noreturn
|
||||
[/* The _Noreturn keyword of C11. */
|
||||
#if ! (defined _Noreturn \
|
||||
|| (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
|
||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||
|| 0x5110 <= __SUNPRO_C)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# elif 1200 <= _MSC_VER
|
||||
# elif defined _MSC_VER && 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn
|
||||
|
@ -224,7 +225,7 @@ m4_ifndef([AS_VAR_IF],
|
|||
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
|
||||
# to CC twice
|
||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
|
||||
# - AC_PROG_CC_STDC is likely to change when C1X is an ISO standard.
|
||||
# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
|
||||
AC_DEFUN([gl_PROG_CC_C99],
|
||||
[
|
||||
dnl Change that version number to the minimum Autoconf version that supports
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
# Copyright (C) 2002-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -78,6 +78,7 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module socklen:
|
||||
# Code from module ssize_t:
|
||||
# Code from module stat:
|
||||
# Code from module stdalign:
|
||||
# Code from module stdarg:
|
||||
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
|
||||
dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
|
||||
|
@ -96,6 +97,7 @@ AC_DEFUN([gl_EARLY],
|
|||
# Code from module strtoumax:
|
||||
# Code from module symlink:
|
||||
# Code from module sys_stat:
|
||||
# Code from module sys_types:
|
||||
# Code from module time:
|
||||
# Code from module time_r:
|
||||
# Code from module u64:
|
||||
|
@ -145,16 +147,23 @@ if test $REPLACE_GETOPT = 1; then
|
|||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_PREREQ_GETOPT
|
||||
dnl Arrange for unistd.h to include getopt.h.
|
||||
GNULIB_GL_UNISTD_H_GETOPT=1
|
||||
fi
|
||||
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
|
||||
gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
|
||||
gl_FUNC_GETOPT_POSIX
|
||||
if test $REPLACE_GETOPT = 1; then
|
||||
AC_LIBOBJ([getopt])
|
||||
AC_LIBOBJ([getopt1])
|
||||
gl_PREREQ_GETOPT
|
||||
dnl Arrange for unistd.h to include getopt.h.
|
||||
GNULIB_GL_UNISTD_H_GETOPT=1
|
||||
fi
|
||||
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
gl_INTTYPES_INCOMPLETE
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
gl_FUNC_LSTAT
|
||||
if test $REPLACE_LSTAT = 1; then
|
||||
AC_LIBOBJ([lstat])
|
||||
|
@ -183,6 +192,7 @@ gl_UNISTD_MODULE_INDICATOR([readlink])
|
|||
gl_SIGNAL_H
|
||||
gl_TYPE_SOCKLEN_T
|
||||
gt_TYPE_SSIZE_T
|
||||
gl_STDALIGN_H
|
||||
gl_STDARG_H
|
||||
AM_STDBOOL_H
|
||||
gl_STDDEF_H
|
||||
|
@ -191,7 +201,7 @@ gl_STDIO_H
|
|||
gl_STDLIB_H
|
||||
gl_FUNC_GNU_STRFTIME
|
||||
gl_FUNC_STRTOIMAX
|
||||
if test $ac_cv_func_strtoimax = no; then
|
||||
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
|
||||
AC_LIBOBJ([strtoimax])
|
||||
gl_PREREQ_STRTOIMAX
|
||||
fi
|
||||
|
@ -209,6 +219,8 @@ fi
|
|||
gl_UNISTD_MODULE_INDICATOR([symlink])
|
||||
gl_HEADER_SYS_STAT_H
|
||||
AC_PROG_MKDIR_P
|
||||
gl_SYS_TYPES_H
|
||||
AC_PROG_MKDIR_P
|
||||
gl_HEADER_TIME_H
|
||||
gl_TIME_R
|
||||
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
|
||||
|
@ -218,7 +230,6 @@ fi
|
|||
gl_TIME_MODULE_INDICATOR([time_r])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
gl_UNISTD_H
|
||||
AC_SUBST([WARN_CFLAGS])
|
||||
gl_gnulib_enabled_dosname=false
|
||||
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
|
||||
gl_gnulib_enabled_pathmax=false
|
||||
|
@ -326,18 +337,18 @@ gl_STDLIB_MODULE_INDICATOR([strtoull])
|
|||
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
|
||||
func_gl_gnulib_m4code_stat
|
||||
fi
|
||||
if test $ac_cv_func_strtoimax = no; then
|
||||
func_gl_gnulib_m4code_verify
|
||||
fi
|
||||
if test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes; then
|
||||
if { test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
|
||||
func_gl_gnulib_m4code_strtoll
|
||||
fi
|
||||
if test $ac_cv_func_strtoumax = no; then
|
||||
if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
|
||||
func_gl_gnulib_m4code_verify
|
||||
fi
|
||||
if test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then
|
||||
func_gl_gnulib_m4code_strtoull
|
||||
fi
|
||||
if test $ac_cv_func_strtoumax = no; then
|
||||
func_gl_gnulib_m4code_verify
|
||||
fi
|
||||
m4_pattern_allow([^gl_GNULIB_ENABLED_])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_dosname], [$gl_gnulib_enabled_dosname])
|
||||
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
|
||||
|
@ -530,6 +541,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/signal.in.h
|
||||
lib/sigprocmask.c
|
||||
lib/stat.c
|
||||
lib/stdalign.in.h
|
||||
lib/stdarg.in.h
|
||||
lib/stdbool.in.h
|
||||
lib/stddef.in.h
|
||||
|
@ -546,6 +558,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
lib/strtoumax.c
|
||||
lib/symlink.c
|
||||
lib/sys_stat.in.h
|
||||
lib/sys_types.in.h
|
||||
lib/time.in.h
|
||||
lib/time_r.c
|
||||
lib/u64.h
|
||||
|
@ -570,6 +583,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/mktime.m4
|
||||
m4/multiarch.m4
|
||||
m4/nocrash.m4
|
||||
m4/off_t.m4
|
||||
m4/pathmax.m4
|
||||
m4/pthread_sigmask.m4
|
||||
m4/readlink.m4
|
||||
|
@ -582,6 +596,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/ssize_t.m4
|
||||
m4/st_dm_mode.m4
|
||||
m4/stat.m4
|
||||
m4/stdalign.m4
|
||||
m4/stdarg.m4
|
||||
m4/stdbool.m4
|
||||
m4/stddef_h.m4
|
||||
|
@ -595,6 +610,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/strtoumax.m4
|
||||
m4/symlink.m4
|
||||
m4/sys_stat_h.m4
|
||||
m4/sys_types_h.m4
|
||||
m4/time_h.m4
|
||||
m4/time_r.m4
|
||||
m4/tm_gmtoff.m4
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# gnulib-tool.m4 serial 2
|
||||
dnl Copyright (C) 2004-2005, 2009-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2004-2005, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# include_next.m4 serial 22
|
||||
dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
|
||||
# include_next.m4 serial 23
|
||||
dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -143,7 +143,7 @@ choke me
|
|||
# even if the compiler does not support include_next.
|
||||
# The three "///" are to pacify Sun C 5.8, which otherwise would say
|
||||
# "warning: #include of /usr/include/... may be non-portable".
|
||||
# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
|
||||
# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
|
||||
# Note: This macro assumes that the header file is not empty after
|
||||
# preprocessing, i.e. it does not only define preprocessor macros but also
|
||||
# provides some type/enum definitions or function/variable declarations.
|
||||
|
@ -219,12 +219,17 @@ changequote(,)
|
|||
gl_dirsep_regex='[/\\]'
|
||||
;;
|
||||
*)
|
||||
gl_dirsep_regex='/'
|
||||
gl_dirsep_regex='\/'
|
||||
;;
|
||||
esac
|
||||
dnl A sed expression that turns a string into a basic regular
|
||||
dnl expression, for use within "/.../".
|
||||
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
|
||||
changequote([,])
|
||||
gl_absolute_header_sed='\|'"${gl_dirsep_regex}"']m4_defn([gl_HEADER_NAME])[|{
|
||||
s|.*"\(.*'"${gl_dirsep_regex}"']m4_defn([gl_HEADER_NAME])[\)".*|\1|
|
||||
gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
|
||||
| sed -e "$gl_make_literal_regex_sed"`
|
||||
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
|
||||
s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
|
||||
changequote(,)dnl
|
||||
s|^/[^/]|//&|
|
||||
changequote([,])dnl
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# inttypes.m4 serial 24
|
||||
dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
|
||||
# inttypes.m4 serial 26
|
||||
dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -24,22 +24,6 @@ AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
|
|||
|
||||
AC_REQUIRE([gl_MULTIARCH])
|
||||
|
||||
dnl Ensure that <stdint.h> defines the limit macros, since gnulib's
|
||||
dnl <inttypes.h> relies on them. This macro is only needed when a
|
||||
dnl C++ compiler is in use; it has no effect for a C compiler.
|
||||
dnl Also be careful to define __STDC_LIMIT_MACROS only when gnulib's
|
||||
dnl <inttypes.h> is going to be created, and to avoid redefinition warnings
|
||||
dnl if the __STDC_LIMIT_MACROS is already defined through the CPPFLAGS.
|
||||
AC_DEFINE([GL_TRIGGER_STDC_LIMIT_MACROS], [1],
|
||||
[Define to make the limit macros in <stdint.h> visible.])
|
||||
AH_VERBATIM([__STDC_LIMIT_MACROS_ZZZ],
|
||||
[/* Ensure that <stdint.h> defines the limit macros, since gnulib's
|
||||
<inttypes.h> relies on them. */
|
||||
#if defined __cplusplus && !defined __STDC_LIMIT_MACROS && GL_TRIGGER_STDC_LIMIT_MACROS
|
||||
# define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
])
|
||||
|
||||
dnl Check for declarations of anything we want to poison if the
|
||||
dnl corresponding gnulib module is not in use.
|
||||
gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
|
||||
|
@ -163,6 +147,7 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
|
|||
HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
|
||||
HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
|
||||
HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
|
||||
REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
|
||||
INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
|
||||
INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
|
||||
PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Enable large files on systems where this is not the default.
|
||||
|
||||
# Copyright 1992-1996, 1998-2011 Free Software Foundation, Inc.
|
||||
# Copyright 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -102,3 +102,48 @@ fi
|
|||
])# AC_SYS_LARGEFILE
|
||||
|
||||
])# m4_version_prereq 2.69
|
||||
|
||||
# Enable large files on systems where this is implemented by Gnulib, not by the
|
||||
# system headers.
|
||||
# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
|
||||
# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
|
||||
AC_DEFUN([gl_LARGEFILE],
|
||||
[
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
dnl Native Windows.
|
||||
dnl mingw64 defines off_t to a 64-bit type already, if
|
||||
dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
|
||||
AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
|
||||
]],
|
||||
[[]])],
|
||||
[gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
|
||||
])
|
||||
if test $gl_cv_type_off_t_64 = no; then
|
||||
WINDOWS_64_BIT_OFF_T=1
|
||||
else
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
fi
|
||||
dnl But all native Windows platforms (including mingw64) have a 32-bit
|
||||
dnl st_size member in 'struct stat'.
|
||||
WINDOWS_64_BIT_ST_SIZE=1
|
||||
;;
|
||||
*)
|
||||
dnl Nothing to do on gnulib's side.
|
||||
dnl A 64-bit off_t is
|
||||
dnl - already the default on MacOS X, FreeBSD, NetBSD, OpenBSD, IRIX,
|
||||
dnl OSF/1, Cygwin,
|
||||
dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
|
||||
dnl glibc, HP-UX, Solaris,
|
||||
dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
|
||||
dnl - impossible to achieve on Minix 3.1.8.
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
WINDOWS_64_BIT_ST_SIZE=0
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# longlong.m4 serial 16
|
||||
dnl Copyright (C) 1999-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# longlong.m4 serial 17
|
||||
dnl Copyright (C) 1999-2007, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -51,7 +51,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
|
|||
fi])
|
||||
if test $ac_cv_type_long_long_int = yes; then
|
||||
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
|
||||
[Define to 1 if the system has the type `long long int'.])
|
||||
[Define to 1 if the system has the type 'long long int'.])
|
||||
fi
|
||||
])
|
||||
|
||||
|
@ -77,7 +77,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
|
|||
fi])
|
||||
if test $ac_cv_type_unsigned_long_long_int = yes; then
|
||||
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
|
||||
[Define to 1 if the system has the type `unsigned long long int'.])
|
||||
[Define to 1 if the system has the type 'unsigned long long int'.])
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
35
m4/lstat.m4
35
m4/lstat.m4
|
@ -1,6 +1,6 @@
|
|||
# serial 23
|
||||
# serial 25
|
||||
|
||||
# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -16,9 +16,11 @@ AC_DEFUN([gl_FUNC_LSTAT],
|
|||
AC_CHECK_FUNCS_ONCE([lstat])
|
||||
if test $ac_cv_func_lstat = yes; then
|
||||
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
|
||||
if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then
|
||||
REPLACE_LSTAT=1
|
||||
fi
|
||||
case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
|
||||
*no)
|
||||
REPLACE_LSTAT=1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
HAVE_LSTAT=0
|
||||
fi
|
||||
|
@ -51,20 +53,25 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
|
|||
]])],
|
||||
[gl_cv_func_lstat_dereferences_slashed_symlink=yes],
|
||||
[gl_cv_func_lstat_dereferences_slashed_symlink=no],
|
||||
[# When cross-compiling, be pessimistic so we will end up using the
|
||||
# replacement version of lstat that checks for trailing slashes and
|
||||
# calls lstat a second time when necessary.
|
||||
gl_cv_func_lstat_dereferences_slashed_symlink=no
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
else
|
||||
# If the 'ln -s' command failed, then we probably don't even
|
||||
# have an lstat function.
|
||||
gl_cv_func_lstat_dereferences_slashed_symlink=no
|
||||
gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
|
||||
fi
|
||||
rm -f conftest.sym conftest.file
|
||||
])
|
||||
test $gl_cv_func_lstat_dereferences_slashed_symlink = yes &&
|
||||
AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
|
||||
[Define to 1 if `lstat' dereferences a symlink specified
|
||||
with a trailing slash.])
|
||||
case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
|
||||
*yes)
|
||||
AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
|
||||
[Define to 1 if 'lstat' dereferences a symlink specified
|
||||
with a trailing slash.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# md5.m4 serial 12
|
||||
dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# serial 21
|
||||
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
|
||||
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# multiarch.m4 serial 6
|
||||
dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# nocrash.m4 serial 3
|
||||
dnl Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
18
m4/off_t.m4
Normal file
18
m4/off_t.m4
Normal file
|
@ -0,0 +1,18 @@
|
|||
# off_t.m4 serial 1
|
||||
dnl Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Check whether to override the 'off_t' type.
|
||||
dnl Set WINDOWS_64_BIT_OFF_T.
|
||||
|
||||
AC_DEFUN([gl_TYPE_OFF_T],
|
||||
[
|
||||
m4_ifdef([gl_LARGEFILE], [
|
||||
AC_REQUIRE([gl_LARGEFILE])
|
||||
], [
|
||||
WINDOWS_64_BIT_OFF_T=0
|
||||
])
|
||||
AC_SUBST([WINDOWS_64_BIT_OFF_T])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# pathmax.m4 serial 10
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
|
||||
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
|
||||
dnl Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
# pthread_sigmask.m4 serial 12
|
||||
dnl Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
# pthread_sigmask.m4 serial 13
|
||||
dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
|
||||
[
|
||||
AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
|
||||
|
||||
AC_CHECK_FUNCS_ONCE([pthread_sigmask])
|
||||
LIB_PTHREAD_SIGMASK=
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# readlink.m4 serial 11
|
||||
dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
|
||||
# readlink.m4 serial 12
|
||||
dnl Copyright (C) 2003, 2007, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
|
|||
AC_DEFUN([gl_FUNC_READLINK],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
|
||||
AC_CHECK_FUNCS_ONCE([readlink])
|
||||
if test $ac_cv_func_readlink = no; then
|
||||
HAVE_READLINK=0
|
||||
|
@ -32,15 +33,26 @@ AC_DEFUN([gl_FUNC_READLINK],
|
|||
]], [[char buf[20];
|
||||
return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
|
||||
[gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
|
||||
[gl_cv_func_readlink_works="guessing no"])
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_readlink_works="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
rm -f conftest.link conftest.lnk2])
|
||||
if test "$gl_cv_func_readlink_works" != yes; then
|
||||
AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
|
||||
fails to recognize a trailing slash.])
|
||||
REPLACE_READLINK=1
|
||||
elif test "$gl_cv_decl_readlink_works" != yes; then
|
||||
REPLACE_READLINK=1
|
||||
fi
|
||||
case "$gl_cv_func_readlink_works" in
|
||||
*yes)
|
||||
if test "$gl_cv_decl_readlink_works" != yes; then
|
||||
REPLACE_READLINK=1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
|
||||
fails to recognize a trailing slash.])
|
||||
REPLACE_READLINK=1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# sha1.m4 serial 10
|
||||
dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# sha256.m4 serial 5
|
||||
dnl Copyright (C) 2005, 2008-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2005, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# sha512.m4 serial 6
|
||||
dnl Copyright (C) 2005-2006, 2008-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2005-2006, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# signal_h.m4 serial 18
|
||||
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# signalblocking.m4 serial 13
|
||||
dnl Copyright (C) 2001-2002, 2006-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2001-2002, 2006-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# socklen.m4 serial 10
|
||||
dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# ssize_t.m4 serial 5 (gettext-0.18.2)
|
||||
dnl Copyright (C) 2001-2003, 2006, 2010-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2001-2003, 2006, 2010-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# serial 6
|
||||
|
||||
# Copyright (C) 1998-1999, 2001, 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998-1999, 2001, 2009-2012 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
|
17
m4/stat.m4
17
m4/stat.m4
|
@ -1,6 +1,6 @@
|
|||
# serial 8
|
||||
# serial 10
|
||||
|
||||
# Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2012 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -23,8 +23,9 @@ AC_DEFUN([gl_FUNC_STAT],
|
|||
mingw*) gl_cv_func_stat_dir_slash="guessing no";;
|
||||
*) gl_cv_func_stat_dir_slash="guessing yes";;
|
||||
esac])])
|
||||
dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/")
|
||||
dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
|
||||
dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
|
||||
dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
|
||||
dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
|
||||
AC_CACHE_CHECK([whether stat handles trailing slashes on files],
|
||||
[gl_cv_func_stat_file_slash],
|
||||
[touch conftest.tmp
|
||||
|
@ -46,7 +47,13 @@ AC_DEFUN([gl_FUNC_STAT],
|
|||
return result;
|
||||
]])],
|
||||
[gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
|
||||
[gl_cv_func_stat_file_slash="guessing no"])
|
||||
[case "$host_os" in
|
||||
# Guess yes on glibc systems.
|
||||
*-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
|
||||
# If we don't know, assume the worst.
|
||||
*) gl_cv_func_stat_file_slash="guessing no" ;;
|
||||
esac
|
||||
])
|
||||
rm -f conftest.tmp conftest.lnk])
|
||||
case $gl_cv_func_stat_dir_slash in
|
||||
*no) REPLACE_STAT=1
|
||||
|
|
51
m4/stdalign.m4
Normal file
51
m4/stdalign.m4
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Check for stdalign.h that conforms to C11.
|
||||
|
||||
dnl Copyright 2011-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Prepare for substituting <stdalign.h> if it is not supported.
|
||||
|
||||
AC_DEFUN([gl_STDALIGN_H],
|
||||
[
|
||||
AC_CACHE_CHECK([for working stdalign.h],
|
||||
[gl_cv_header_working_stdalign_h],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <stdalign.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* Test that alignof yields a result consistent with offsetof.
|
||||
This catches GCC bug 52023
|
||||
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
|
||||
#ifdef __cplusplus
|
||||
template <class t> struct alignof_helper { char a; t b; };
|
||||
# define ao(type) offsetof (alignof_helper<type>, b)
|
||||
#else
|
||||
# define ao(type) offsetof (struct { char a; type b; }, b)
|
||||
#endif
|
||||
char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
|
||||
char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
|
||||
char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
|
||||
|
||||
/* Test _Alignas only on platforms where gnulib can help. */
|
||||
#if \
|
||||
(__GNUC__ || __IBMC__ || __IBMCPP__ \
|
||||
|| 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
|
||||
int alignas (8) alignas_int = 1;
|
||||
char test_alignas[_Alignof (alignas_int) == 8 ? 1 : -1];
|
||||
#endif
|
||||
]])],
|
||||
[gl_cv_header_working_stdalign_h=yes],
|
||||
[gl_cv_header_working_stdalign_h=no])])
|
||||
|
||||
if test $gl_cv_header_working_stdalign_h = yes; then
|
||||
STDALIGN_H=''
|
||||
else
|
||||
STDALIGN_H='stdalign.h'
|
||||
fi
|
||||
|
||||
AC_SUBST([STDALIGN_H])
|
||||
AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"])
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
# stdarg.m4 serial 6
|
||||
dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 2006, 2008-2012 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue