Commit f6c7ed54 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

update gnulib

This comes from gnulib 348402f2aac342bc925b7aaea9ee3cc353f427a9 plus
a custom patch to support compilation of arpg in C++11.

* lib/hard-locale.c, lib/hard-locale.h, m4/hard-locale.m4, m4/ltargz.m4:
New files.
* lib/Makefile.am, lib/alloca.in.h, lib/argmatch.c, lib/argmatch.h,
lib/argp-ba.c, lib/argp-eexst.c, lib/argp-fmtstream.c,
lib/argp-fmtstream.h, lib/argp-fs-xinl.c, lib/argp-help.c,
lib/argp-namefrob.h, lib/argp-parse.c, lib/argp-pin.c, lib/argp-pv.c,
lib/argp-pvh.c, lib/argp-xinl.c, lib/argp.h, lib/asnprintf.c,
lib/basename-lgpl.c, lib/c-ctype.h, lib/c-strcase.h, lib/c-strcasecmp.c,
lib/c-strcaseeq.h, lib/c-strncasecmp.c, lib/config.charset,
lib/dirname-lgpl.c, lib/dirname.h, lib/dosname.h, lib/errno.in.h,
lib/error.c, lib/error.h, lib/exitfail.c, lib/exitfail.h,
lib/fcntl.in.h, lib/float+.h, lib/float.c, lib/float.in.h, lib/getopt.c,
lib/getopt.in.h, lib/getopt1.c, lib/getopt_int.h, lib/gettext.h,
lib/gettimeofday.c, lib/hard-locale.h, lib/intprops.h, lib/isatty.c,
lib/itold.c, lib/localcharset.c, lib/localcharset.h, lib/lstat.c,
lib/malloc.c, lib/mbrtowc.c, lib/mbsinit.c, lib/memchr.c, lib/mempcpy.c,
lib/mkstemp.c, lib/mkstemps.c, lib/msvc-inval.c, lib/msvc-inval.h,
lib/msvc-nothrow.c, lib/msvc-nothrow.h, lib/pathmax.h,
lib/printf-args.c, lib/printf-args.h, lib/printf-parse.c,
lib/printf-parse.h, lib/progname.c, lib/progname.h, lib/quote.h,
lib/quotearg.c, lib/quotearg.h, lib/rawmemchr.c, lib/ref-add.sin,
lib/ref-del.sin, lib/secure_getenv.c, lib/size_max.h, lib/sleep.c,
lib/stat.c, lib/stdalign.in.h, lib/stdbool.in.h, lib/stddef.in.h,
lib/stdint.in.h, lib/stdio.in.h, lib/stdlib.in.h, lib/stpcpy.c,
lib/strcasecmp.c, lib/strchrnul.c, lib/streq.h, lib/strerror-override.c,
lib/strerror-override.h, lib/strerror.c, lib/string.in.h,
lib/strings.in.h, lib/stripslash.c, lib/strncasecmp.c, lib/strndup.c,
lib/strnlen.c, lib/strverscmp.c, lib/sys_stat.in.h, lib/sys_time.in.h,
lib/sys_types.in.h, lib/sys_wait.in.h, lib/sysexits.in.h,
lib/tempname.c, lib/tempname.h, lib/time.in.h, lib/unistd.in.h,
lib/vasnprintf.c, lib/vasnprintf.h, lib/verify.h, lib/vsnprintf.c,
lib/wchar.in.h, lib/wctype.in.h, lib/xalloc-die.c,
lib/xalloc-oversized.h, lib/xalloc.h, lib/xmalloc.c, lib/xsize.h,
m4/00gnulib.m4, m4/absolute-header.m4, m4/alloca.m4, m4/argp.m4,
m4/codeset.m4, m4/configmake.m4, m4/dirname.m4, m4/double-slash-root.m4,
m4/errno_h.m4, m4/error.m4, m4/exponentd.m4, m4/extensions.m4,
m4/extern-inline.m4, m4/fcntl-o.m4, m4/fcntl_h.m4, m4/float_h.m4,
m4/getopt.m4, m4/gettimeofday.m4, m4/glibc21.m4, m4/gnulib-cache.m4,
m4/gnulib-common.m4, m4/gnulib-comp.m4, m4/gnulib-tool.m4,
m4/include_next.m4, m4/intmax_t.m4, m4/inttypes_h.m4, m4/isatty.m4,
m4/largefile.m4, m4/localcharset.m4, m4/locale-fr.m4, m4/locale-ja.m4,
m4/locale-zh.m4, m4/longlong.m4, m4/lstat.m4, m4/malloc.m4,
m4/math_h.m4, m4/mbrtowc.m4, m4/mbsinit.m4, m4/mbstate_t.m4,
m4/memchr.m4, m4/mempcpy.m4, m4/mkstemp.m4, m4/mkstemps.m4,
m4/mmap-anon.m4, m4/msvc-inval.m4, m4/msvc-nothrow.m4, m4/multiarch.m4,
m4/nocrash.m4, m4/off_t.m4, m4/pathmax.m4, m4/printf.m4, m4/quote.m4,
m4/quotearg.m4, m4/rawmemchr.m4, m4/secure_getenv.m4, m4/size_max.m4,
m4/sleep.m4, m4/ssize_t.m4, m4/stat.m4, m4/stdalign.m4, m4/stdbool.m4,
m4/stddef_h.m4, m4/stdint.m4, m4/stdint_h.m4, m4/stdio_h.m4,
m4/stdlib_h.m4, m4/stpcpy.m4, m4/strcase.m4, m4/strchrnul.m4,
m4/strerror.m4, m4/string_h.m4, m4/strings_h.m4, m4/strndup.m4,
m4/strnlen.m4, m4/strverscmp.m4, m4/sys_socket_h.m4, m4/sys_stat_h.m4,
m4/sys_time_h.m4, m4/sys_types_h.m4, m4/sys_wait_h.m4, m4/sysexits.m4,
m4/tempname.m4, m4/time_h.m4, m4/unistd_h.m4, m4/vasnprintf.m4,
m4/vsnprintf.m4, m4/warn-on-use.m4, m4/wchar_h.m4, m4/wchar_t.m4,
m4/wctype_h.m4, m4/wint_t.m4, m4/xalloc.m4, m4/xsize.m4,
tests/core/randtgba.cc, tools/snippet/arg-nonnull.h,
tools/snippet/c++defs.h, tools/snippet/warn-on-use.h: Update.
parent 561672d3
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2002-2015 Free Software Foundation, Inc.
# Copyright (C) 2002-2016 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
......@@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=tools --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files argmatch argp error isatty mkstemp mkstemps progname stpcpy strverscmp sys_wait
# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=tools --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files argmatch argp error isatty mkstemp mkstemps progname stpcpy strverscmp sys_wait
AUTOMAKE_OPTIONS = 1.9.6 gnits
......@@ -346,6 +346,14 @@ EXTRA_libgnu_la_SOURCES += gettimeofday.c
## end gnulib module gettimeofday
## begin gnulib module hard-locale
libgnu_la_SOURCES += hard-locale.c
EXTRA_DIST += hard-locale.h
## end gnulib module hard-locale
## begin gnulib module intprops
......
/* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001-2004, 2006-2015 Free Software Foundation,
Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
Inc.
This program is free software; you can redistribute it and/or modify it
......
/* argmatch.c -- find a match for a string in an array
Copyright (C) 1990, 1998-1999, 2001-2007, 2009-2015 Free Software
Copyright (C) 1990, 1998-1999, 2001-2007, 2009-2016 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
......
/* argmatch.h -- definitions and prototypes for argmatch.c
Copyright (C) 1990, 1998-1999, 2001-2002, 2004-2005, 2009-2015 Free Software
Copyright (C) 1990, 1998-1999, 2001-2002, 2004-2005, 2009-2016 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
......
/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
Copyright (C) 1996-1997, 1999, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......
/* Default definition for ARGP_ERR_EXIT_STATUS
Copyright (C) 1997, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1997, 2009-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......
/* Word-wrapping and line-truncating streams
Copyright (C) 1997-1999, 2001-2003, 2005, 2009-2015 Free Software
Foundation, Inc.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......@@ -39,7 +38,7 @@
#define isblank(ch) ((ch)==' ' || (ch)=='\t')
#endif
#if defined _LIBC && defined USE_IN_LIBIO
#ifdef _LIBC
# include <wchar.h>
# include <libio/libioP.h>
# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
......@@ -100,7 +99,7 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
__argp_fmtstream_update (fs);
if (fs->p > fs->buf)
{
#ifdef USE_IN_LIBIO
#ifdef _LIBC
__fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
#else
fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
......@@ -149,7 +148,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
size_t i;
for (i = 0; i < pad; i++)
{
#ifdef USE_IN_LIBIO
#ifdef _LIBC
if (_IO_fwide (fs->stream, 0) > 0)
putwc_unlocked (L' ', fs->stream);
else
......@@ -315,7 +314,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
*nl++ = ' ';
else
for (i = 0; i < fs->wmargin; ++i)
#ifdef USE_IN_LIBIO
#ifdef _LIBC
if (_IO_fwide (fs->stream, 0) > 0)
putwc_unlocked (L' ', fs->stream);
else
......
/* Word-wrapping and line-truncating streams.
Copyright (C) 1997, 2006-2015 Free Software Foundation, Inc.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......@@ -40,8 +40,7 @@
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
#endif
#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
|| (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
#if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
/* line_wrap_stream is available, so use that. */
#define ARGP_FMTSTREAM_USE_LINEWRAP
#endif
......@@ -87,6 +86,7 @@ typedef FILE *argp_fmtstream_t;
#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */
/* Guess we have to define our own version. */
struct argp_fmtstream
{
......@@ -207,63 +207,11 @@ _GL_INLINE_HEADER_BEGIN
#endif
#ifndef ARGP_FS_EI
# ifdef __GNUC__
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
inline semantics, unless -fgnu89-inline is used. It defines a macro
__GNUC_STDC_INLINE__ to indicate this situation or a macro
__GNUC_GNU_INLINE__ to indicate the opposite situation.
GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
semantics but warns, unless -fgnu89-inline is used:
warning: C99 inline functions are not supported; using GNU89
warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
Whereas Apple GCC 4.0.1 build 5479 without -std=c99 or -std=gnu99
implements the GNU C inline semantics and defines the macro
__GNUC_GNU_INLINE__, but it does not warn and does not support
__attribute__ ((__gnu_inline__)).
All in all, these are the possible combinations. For every compiler,
we need to choose ARGP_FS_EI so that the corresponding table cell
contains an "ok".
\ ARGP_FS_EI inline extern extern
\ inline inline
CC \ __attribute__
((gnu_inline))
gcc 4.3.0 error ok ok
gcc 4.3.0 -std=gnu99 -fgnu89-inline error ok ok
gcc 4.3.0 -std=gnu99 ok error ok
gcc 4.2.2 error ok ok
gcc 4.2.2 -std=gnu99 -fgnu89-inline error ok ok
gcc 4.2.2 -std=gnu99 error warning ok
gcc 4.1.2 error ok warning
gcc 4.1.2 -std=gnu99 error ok warning
Apple gcc 4.0.1 error ok warning
Apple gcc 4.0.1 -std=gnu99 ok error warning
*/
# if defined __GNUC_STDC_INLINE__
# define ARGP_FS_EI inline
# elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
# define ARGP_FS_EI extern inline __attribute__ ((__gnu_inline__))
# else
# define ARGP_FS_EI extern inline
# endif
# else
/* With other compilers, assume the ISO C99 meaning of 'inline', if
the compiler supports 'inline' at all. */
# define ARGP_FS_EI inline
# endif
#define ARGP_FS_EI extern inline
#endif
ARGP_FS_EI size_t
__argp_fmtstream_write (argp_fmtstream_t __fs,
const char *__str, size_t __len)
__argp_fmtstream_write (argp_fmtstream_t __fs, const char *__str, size_t __len)
{
if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len))
{
......
/* Real definitions for extern inline functions in argp-fmtstream.h
Copyright (C) 1997, 2003-2004, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......
This diff is collapsed.
/* Name frobnication for compiling argp outside of glibc
Copyright (C) 1997, 2003, 2007, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......@@ -138,7 +138,7 @@
#endif /* !_LIBC */
#ifndef __set_errno
# define __set_errno(e) (errno = (e))
#define __set_errno(e) (errno = (e))
#endif
#if defined GNULIB_ARGP_DISABLE_DIRNAME
......
/* Hierarchical argument parsing, layered over getopt
Copyright (C) 1995-2000, 2002-2004, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......@@ -34,7 +34,7 @@
# include <libintl.h>
# undef dgettext
# define dgettext(domain, msgid) \
INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
__dcgettext (domain, msgid, LC_MESSAGES)
#else
# include "gettext.h"
#endif
......@@ -80,9 +80,10 @@ static const struct argp_option argp_default_options[] =
{
{"help", '?', 0, 0, N_("give this help list"), -1},
{"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0},
{"program-name",OPT_PROGNAME,N_("NAME"), OPTION_HIDDEN, N_("set the program name"), 0},
{"program-name",OPT_PROGNAME, N_("NAME"), OPTION_HIDDEN,
N_("set the program name"), 0},
{"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
N_("hang for SECS seconds (default 3600)"), 0},
N_("hang for SECS seconds (default 3600)"), 0},
{NULL, 0, 0, 0, NULL, 0}
};
......
/* Full and short program names for argp module
Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2005, 2009-2016 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
......
/* Default definition for ARGP_PROGRAM_VERSION.
Copyright (C) 1996-1997, 1999, 2006, 2009-2015 Free Software Foundation,
Inc.
Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......
/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
Copyright (C) 1996-1997, 1999, 2004, 2009-2015 Free Software Foundation,
Inc.
Copyright (C) 1996-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......
/* Real definitions for extern inline functions in argp.h
Copyright (C) 1997-1998, 2004, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......
/* Hierarchical argument parsing, layered over getopt.
Copyright (C) 1995-1999, 2003-2015 Free Software Foundation, Inc.
Copyright (C) 1995-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
......@@ -146,15 +146,14 @@ struct argp_option
/* Valid only in conjunction with OPTION_DOC. This option disables translation
of option name. */
#define OPTION_NO_TRANS 0x20
struct argp; /* fwd declare this type */
struct argp_state; /* " */
struct argp_child; /* " */
/* The type of a pointer to an argp parsing function. */
typedef error_t (*argp_parser_t) (int key, char *arg,
struct argp_state *state);
typedef error_t (*argp_parser_t) (int __key, char *__arg,
struct argp_state *__state);
/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
returns will simply be ignored. For user keys, this error will be turned
......@@ -589,28 +588,7 @@ _GL_INLINE_HEADER_BEGIN
# endif
# ifndef ARGP_EI
# ifdef __GNUC__
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
inline semantics, unless -fgnu89-inline is used. It defines a macro
__GNUC_STDC_INLINE__ to indicate this situation or a macro
__GNUC_GNU_INLINE__ to indicate the opposite situation.
GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
semantics but warns, unless -fgnu89-inline is used:
warning: C99 inline functions are not supported; using GNU89
warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. */
# if defined __GNUC_STDC_INLINE__
# define ARGP_EI __inline__
# elif defined __GNUC_GNU_INLINE__
# define ARGP_EI extern __inline__ __attribute__ ((__gnu_inline__))
# else
# define ARGP_EI extern __inline__
# endif
# else
/* With other compilers, assume the ISO C99 meaning of 'inline', if
the compiler supports 'inline' at all. */
# define ARGP_EI inline
# endif
# define ARGP_EI __extern_inline
# endif
ARGP_EI void
......
/* Formatted output to strings.
Copyright (C) 1999, 2002, 2006, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1999, 2002, 2006, 2009-2016 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
......
/* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2015 Free Software
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
......
......@@ -5,7 +5,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
Copyright (C) 2000-2003, 2006, 2008-2015 Free Software Foundation, Inc.
Copyright (C) 2000-2003, 2006, 2008-2016 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
......
/* Case-insensitive string comparison functions in C locale.
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2015 Free Software
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2016 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
......
/* c-strcasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2016 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
......
/* Optimized case-insensitive string comparison in C locale.
Copyright (C) 2001-2002, 2007, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2001-2002, 2007, 2009-2016 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
......
/* c-strncasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2016 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
......
#! /bin/sh
# Output a system dependent table of character encoding aliases.
#
# Copyright (C) 2000-2004, 2006-2015 Free Software Foundation, Inc.
# Copyright (C) 2000-2004, 2006-2016 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
......
/* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2015 Free Software
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
......
/* Take file names apart into directory and base names.
Copyright (C) 1998, 2001, 2003-2006, 2009-2015 Free Software Foundation,
Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
Inc.
This program is free software: you can redistribute it and/or modify
......
/* File names on MS-DOS/Windows systems.
Copyright (C) 2000-2001, 2004-2006, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2000-2001, 2004-2006, 2009-2016 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
......
/* A POSIX-like <errno.h>.
Copyright (C) 2008-2015 Free Software Foundation, Inc.
Copyright (C) 2008-2016 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
......
/* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000-2007, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 1990-1998, 2000-2007, 2009-2016 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
......
/* Declaration for error-reporting function
Copyright (C) 1995-1997, 2003, 2006, 2008-2015 Free Software Foundation,
Copyright (C) 1995-1997, 2003, 2006, 2008-2016 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
......
/* Failure exit status
Copyright (C) 2002-2003, 2005-2007, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2002-2003, 2005-2007, 2009-2016 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
......
/* Failure exit status
Copyright (C) 2002, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2002, 2009-2016 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
......
/* Like <fcntl.h>, but with non-working flags defined to 0.
Copyright (C) 2006-2015 Free Software Foundation, Inc.
Copyright (C) 2006-2016 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
......
/* Supplemental information about the floating-point formats.
Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2007.
This program is free software; you can redistribute it and/or modify
......
/* Auxiliary definitions for <float.h>.
Copyright (C) 2011-2015 Free Software Foundation, Inc.
Copyright (C) 2011-2016 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This program is free software: you can redistribute it and/or modify
......
/* A correct <float.h>.
Copyright (C) 2007-2015 Free Software Foundation, Inc.
Copyright (C) 2007-2016 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
......
......@@ -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-2015 Free Software
Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2016 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
......
/* Declarations for getopt.
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2015 Free Software
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2016 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
......
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2015 Free Software
Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2016 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
......
/* Internal declarations for getopt.
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2015 Free Software
Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2016 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
......
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2015 Free Software
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
......@@ -225,15 +225,17 @@ dcpgettext_expr (const char *domain,
if (msg_ctxt_id != NULL)
#endif
{
int found_translation;
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
translation = dcgettext (domain, msg_ctxt_id, category);
found_translation = (translation != msg_ctxt_id);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
if (msg_ctxt_id != buf)
free (msg_ctxt_id);
#endif
if (translation != msg_ctxt_id)
if (found_translation)
return translation;
}
return msgid;
......@@ -271,15 +273,17 @@ dcnpgettext_expr (const char *domain,
if (msg_ctxt_id != NULL)
#endif
{
int found_translation;
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
msg_ctxt_id[msgctxt_len - 1] = '\004';
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
if (msg_ctxt_id != buf)
free (msg_ctxt_id);
#endif
if (!(translation == msg_ctxt_id || translation == msgid_plural))
if (found_translation)
return translation;
}
return (n == 1 ? msgid : msgid_plural);
......
/* Provide gettimeofday for systems that don't have it or for which it's broken.
Copyright (C) 2001-2003, 2005-2007, 2009-2015 Free Software Foundation, Inc.
Copyright (C) 2001-2003, 2005-2007, 2009-2016 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
......
/* hard-locale.c -- Determine whether a locale is hard.
Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(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/>. */
#include <config.h>
#include "hard-locale.h"
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#ifdef __GLIBC__
# define GLIBC_VERSION __GLIBC__
#elif defined __UCLIBC__
# define GLIBC_VERSION 2
#else
# define GLIBC_VERSION 0
#endif
/* Return true if the current CATEGORY locale is hard, i.e. if you
can't get away with assuming traditional C or POSIX behavior. */
bool
hard_locale (int category)
{
bool hard = true;
char const *p = setlocale (category, NULL);
if (p)
{
if (2 <= GLIBC_VERSION)
{
if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
hard = false;
}
else
{
char *locale = strdup (p);
if (locale)
{
/* Temporarily set the locale to the "C" and "POSIX" locales
to find their names, so that we can determine whether one
or the other is the caller's locale. */
if (((p = setlocale (category, "C"))
&& strcmp (p, locale) == 0)
|| ((p = setlocale (category, "POSIX"))
&& strcmp (p, locale) == 0))
hard = false;
/* Restore the caller's locale. */
setlocale (category, locale);
free (locale);
}
}
}
return hard;
}
/* Determine whether a locale is hard.
Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(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