1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

po,intl: Update to 0.19.3.

This commit is contained in:
Werner Koch 2015-02-26 19:01:30 +01:00
parent 52c6c30647
commit 8adbf74b93
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
99 changed files with 2722 additions and 1928 deletions

View File

@ -868,7 +868,7 @@ dnl Checks for libraries.
# needs to find this string. Without # needs to find this string. Without
# it "make distcheck" may fail. # it "make distcheck" may fail.
AM_PO_SUBDIRS AM_PO_SUBDIRS
AM_GNU_GETTEXT_VERSION([0.18.1]) AM_GNU_GETTEXT_VERSION([0.19.3])
if test "$try_gettext" = yes; then if test "$try_gettext" = yes; then
AM_GNU_GETTEXT(,[need-ngettext]) AM_GNU_GETTEXT(,[need-ngettext])
# gettext requires some extra checks. These really should be part of # gettext requires some extra checks. These really should be part of

View File

@ -1,25 +1,23 @@
# Makefile for directory with message catalog handling library of GNU gettext # Makefile for directory with message catalog handling library of GNU gettext
# Copyright (C) 1995-1998, 2000-2007, 2009-2010 Free Software Foundation, Inc. # Copyright (C) 1995-1998, 2000-2007, 2009-2012 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify
# under the terms of the GNU Library General Public License as published # it under the terms of the GNU Lesser General Public License as published by
# by the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2.1 of the License, or
# any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Library General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Library General Public # You should have received a copy of the GNU Lesser General Public License
# License along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
VERSION = @VERSION@ VERSION = @VERSION@
SHELL = /bin/sh SHELL = @SHELL@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
@ -125,12 +123,13 @@ HEADERS = \
lock.h \ lock.h \
relocatable.h \ relocatable.h \
tsearch.h tsearch.c \ tsearch.h tsearch.c \
verify.h \
xsize.h \ xsize.h \
printf-args.h printf-args.c \ printf-args.h printf-args.c \
printf-parse.h wprintf-parse.h printf-parse.c \ printf-parse.h wprintf-parse.h printf-parse.c \
vasnprintf.h vasnwprintf.h vasnprintf.c \ vasnprintf.h vasnwprintf.h vasnprintf.c \
os2compat.h \ os2compat.h \
libgnuintl.h.in libgnuintl.in.h
SOURCES = \ SOURCES = \
bindtextdom.c \ bindtextdom.c \
dcgettext.c \ dcgettext.c \
@ -159,6 +158,7 @@ SOURCES = \
printf.c \ printf.c \
setlocale.c \ setlocale.c \
version.c \ version.c \
xsize.c \
osdep.c \ osdep.c \
os2compat.c \ os2compat.c \
intl-exports.c \ intl-exports.c \
@ -191,6 +191,7 @@ OBJECTS = \
printf.$lo \ printf.$lo \
setlocale.$lo \ setlocale.$lo \
version.$lo \ version.$lo \
xsize.$lo \
osdep.$lo \ osdep.$lo \
intl-compat.$lo intl-compat.$lo
OBJECTS_RES_yes = libintl.res.$lo OBJECTS_RES_yes = libintl.res.$lo
@ -200,9 +201,10 @@ config.charset locale.alias ref-add.sin ref-del.sin export.h libintl.rc \
$(HEADERS) $(SOURCES) $(HEADERS) $(SOURCES)
DISTFILES.generated = plural.c DISTFILES.generated = plural.c
DISTFILES.normal = VERSION DISTFILES.normal = VERSION
DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc README.woe32 DISTFILES.gettext = ChangeLog COPYING.LIB libintl.glibc README.woe32
DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \ DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h \ COPYING.LIB-2 COPYING.LIB-2.0 COPYING.LIB-2.1 \
gettext.h libgettext.h plural-eval.c libgnuintl.h \
libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \ libgnuintl.h_vms Makefile.vms libgnuintl.h.msvc-static \
libgnuintl.h.msvc-shared Makefile.msvc libgnuintl.h.msvc-shared Makefile.msvc
@ -232,7 +234,7 @@ libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@)
# Maintainers of other packages that include the intl directory must *not* # Maintainers of other packages that include the intl directory must *not*
# change these values. # change these values.
LTV_CURRENT=9 LTV_CURRENT=9
LTV_REVISION=1 LTV_REVISION=2
LTV_AGE=1 LTV_AGE=1
.SUFFIXES: .SUFFIXES:
@ -299,6 +301,8 @@ setlocale.lo: $(srcdir)/setlocale.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/setlocale.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/setlocale.c
version.lo: $(srcdir)/version.c version.lo: $(srcdir)/version.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/version.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/version.c
xsize.lo: $(srcdir)/xsize.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/xsize.c
osdep.lo: $(srcdir)/osdep.c osdep.lo: $(srcdir)/osdep.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/osdep.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/osdep.c
intl-compat.lo: $(srcdir)/intl-compat.c intl-compat.lo: $(srcdir)/intl-compat.c
@ -341,14 +345,14 @@ ref-del.sed: $(srcdir)/ref-del.sin
INCLUDES = -I. -I$(srcdir) -I.. INCLUDES = -I. -I$(srcdir) -I..
libgnuintl.h: $(srcdir)/libgnuintl.h.in libgnuintl.h: $(srcdir)/libgnuintl.in.h
sed -e '/IN_LIBGLOCALE/d' \ sed -e '/IN_LIBGLOCALE/d' \
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
-e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
< $(srcdir)/libgnuintl.h.in \ < $(srcdir)/libgnuintl.in.h \
| if test '@WOE32DLL@' = yes; then \ | if test '@WOE32DLL@' = yes; then \
sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \ sed -e 's/extern \([^()]*\);/extern __declspec (dllimport) \1;/'; \
else \ else \
@ -359,14 +363,14 @@ libgnuintl.h: $(srcdir)/libgnuintl.h.in
| sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \ | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
> libgnuintl.h > libgnuintl.h
libintl.h: $(srcdir)/libgnuintl.h.in libintl.h: $(srcdir)/libgnuintl.in.h
sed -e '/IN_LIBGLOCALE/d' \ sed -e '/IN_LIBGLOCALE/d' \
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \ -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
-e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
< $(srcdir)/libgnuintl.h.in > libintl.h < $(srcdir)/libgnuintl.in.h > libintl.h
charset.alias: $(srcdir)/config.charset charset.alias: $(srcdir)/config.charset
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@ $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
@ -378,7 +382,7 @@ check: all
# system which has the GNU gettext() function in its C library or in a # system which has the GNU gettext() function in its C library or in a
# separate library. # separate library.
# If you want to use the one which comes with this version of the # If you want to use the one which comes with this version of the
# package, you have to use `configure --with-included-gettext'. # package, you have to use "configure --with-included-gettext".
install: install-exec install-data install: install-exec install-data
install-exec: all install-exec: all
if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
@ -456,8 +460,7 @@ install-data: all
if test "$(PACKAGE)" = "gettext-tools"; then \ if test "$(PACKAGE)" = "gettext-tools"; then \
$(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
$(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
$(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ dists="COPYING.LIB $(DISTFILES.common)"; \
dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
for file in $$dists; do \ for file in $$dists; do \
$(INSTALL_DATA) $(srcdir)/$$file \ $(INSTALL_DATA) $(srcdir)/$$file \
$(DESTDIR)$(gettextsrcdir)/$$file; \ $(DESTDIR)$(gettextsrcdir)/$$file; \
@ -567,7 +570,7 @@ uninstall:
: ; \ : ; \
fi fi
if test "$(PACKAGE)" = "gettext-tools"; then \ if test "$(PACKAGE)" = "gettext-tools"; then \
for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ for file in VERSION COPYING.LIB $(DISTFILES.common) $(DISTFILES.generated); do \
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
done; \ done; \
else \ else \
@ -586,7 +589,7 @@ dcigettext.$lo: $(srcdir)/eval-plural.h
localcharset.$lo: $(srcdir)/localcharset.h localcharset.$lo: $(srcdir)/localcharset.h
bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h bindtextdom.$lo dcigettext.$lo finddomain.$lo loadmsgcat.$lo localealias.$lo lock.$lo log.$lo: $(srcdir)/lock.h
localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/xsize.c $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
# A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS. # A bison-2.1 generated plural.c includes <libintl.h> if ENABLE_NLS.
PLURAL_DEPS_yes = libintl.h PLURAL_DEPS_yes = libintl.h
@ -619,7 +622,7 @@ clean: mostlyclean
distclean: clean distclean: clean
rm -f Makefile ID TAGS rm -f Makefile ID TAGS
if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \ if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
rm -f ChangeLog.inst $(DISTFILES.normal); \ rm -f $(DISTFILES.normal); \
else \ else \
: ; \ : ; \
fi fi
@ -629,7 +632,7 @@ maintainer-clean: distclean
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
# GNU gettext needs not contain the file `VERSION' but contains some # GNU gettext needs not contain the file 'VERSION' but contains some
# other files which should not be distributed in other packages. # other files which should not be distributed in other packages.
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: Makefile dist distdir: Makefile
@ -642,7 +645,7 @@ dist distdir: Makefile
additional="$(DISTFILES.normal)"; \ additional="$(DISTFILES.normal)"; \
fi; \ fi; \
$(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ for file in $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \ cp -p $$dir/$$file $(distdir) || test $$file = Makefile.in || exit 1; \
done; \ done; \

View File

@ -1 +1 @@
GNU gettext library from gettext-0.18.1 GNU gettext library from gettext-0.19.3

View File

@ -2,20 +2,18 @@
Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008 Free Software Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008 Free Software
Foundation, Inc. Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -3,20 +3,18 @@
# #
# Copyright (C) 2000-2004, 2006-2010 Free Software Foundation, Inc. # Copyright (C) 2000-2004, 2006-2010 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify
# under the terms of the GNU Library General Public License as published # it under the terms of the GNU Lesser General Public License as published by
# by the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2.1 of the License, or
# any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Library General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Library General Public # You should have received a copy of the GNU Lesser General Public License
# License along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# #
# The table consists of lines of the form # The table consists of lines of the form
# ALIAS CANONICAL # ALIAS CANONICAL
@ -31,6 +29,8 @@
# The current list of GNU canonical charset names is as follows. # The current list of GNU canonical charset names is as follows.
# #
# name MIME? used by which systems # name MIME? used by which systems
# (darwin = Mac OS X, woe32 = native Windows)
#
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin # ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin # ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin # ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin

View File

@ -1,20 +1,18 @@
/* Implementation of the dcgettext(3) function. /* Implementation of the dcgettext(3) function.
Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Implementation of the internal dcigettext function. /* Implementation of the internal dcigettext function.
Copyright (C) 1995-1999, 2000-2009 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2010, 2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <string.h> to provide a prototype for mempcpy(). /* Tell glibc's <string.h> to provide a prototype for mempcpy().
This must come before <config.h> because <config.h> may include This must come before <config.h> because <config.h> may include
@ -374,7 +372,7 @@ static const char *get_output_charset (struct binding *domainbinding)
#endif #endif
/* For those loosing systems which don't have `alloca' we have to add /* For those losing systems which don't have `alloca' we have to add
some additional code emulating it. */ some additional code emulating it. */
#ifdef HAVE_ALLOCA #ifdef HAVE_ALLOCA
/* Nothing has to be done. */ /* Nothing has to be done. */
@ -745,6 +743,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
msgid1, 1, &retlen); msgid1, 1, &retlen);
#endif #endif
/* Resource problems are not fatal, instead we return no
translation. */
if (__builtin_expect (retval == (char *) -1, 0))
goto return_untranslated;
if (retval != NULL) if (retval != NULL)
{ {
domain = domain->successor[cnt]; domain = domain->successor[cnt];
@ -1105,6 +1108,11 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
_nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
# endif # endif
/* Resource problems are fatal. If we continue onwards we will
only attempt to calloc a new conv_tab and fail later. */
if (__builtin_expect (nullentry == (char *) -1, 0))
return (char *) -1;
if (nullentry != NULL) if (nullentry != NULL)
{ {
const char *charsetstr; const char *charsetstr;
@ -1153,7 +1161,8 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
# if HAVE_ICONV # if HAVE_ICONV
/* When using GNU libc >= 2.2 or GNU libiconv >= 1.5, /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
we want to use transliteration. */ we want to use transliteration. */
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \ # if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
&& !defined __UCLIBC__) \
|| _LIBICONV_VERSION >= 0x0105 || _LIBICONV_VERSION >= 0x0105
if (strchr (outcharset, '/') == NULL) if (strchr (outcharset, '/') == NULL)
{ {
@ -1329,7 +1338,7 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
freemem_size); freemem_size);
# ifdef _LIBC # ifdef _LIBC
if (newmem != NULL) if (newmem != NULL)
transmem_list = transmem_list->next; transmem_list = newmem;
else else
{ {
struct transmem_list *old = transmem_list; struct transmem_list *old = transmem_list;
@ -1344,6 +1353,16 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
malloc_count = 1; malloc_count = 1;
freemem_size = INITIAL_BLOCK_SIZE; freemem_size = INITIAL_BLOCK_SIZE;
newmem = (transmem_block_t *) malloc (freemem_size); newmem = (transmem_block_t *) malloc (freemem_size);
# ifdef _LIBC
if (newmem != NULL)
{
/* Add the block to the list of blocks we have to free
at some point. */
newmem->next = transmem_list;
transmem_list = newmem;
}
/* Fall through and return -1. */
# endif
} }
if (__builtin_expect (newmem == NULL, 0)) if (__builtin_expect (newmem == NULL, 0))
{ {
@ -1354,11 +1373,6 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
} }
# ifdef _LIBC # ifdef _LIBC
/* Add the block to the list of blocks we have to free
at some point. */
newmem->next = transmem_list;
transmem_list = newmem;
freemem = (unsigned char *) newmem->data; freemem = (unsigned char *) newmem->data;
freemem_size -= offsetof (struct transmem_list, data); freemem_size -= offsetof (struct transmem_list, data);
# else # else

View File

@ -1,20 +1,18 @@
/* Implementation of the dcngettext(3) function. /* Implementation of the dcngettext(3) function.
Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Implementation of the dgettext(3) function. /* Implementation of the dgettext(3) function.
Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Implementation of the dngettext(3) function. /* Implementation of the dngettext(3) function.
Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc. Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Plural expression evaluation. /* Plural expression evaluation.
Copyright (C) 2000-2003, 2007 Free Software Foundation, Inc. Copyright (C) 2000-2003, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef STATIC #ifndef STATIC
#define STATIC static #define STATIC static

View File

@ -1,20 +1,18 @@
/* Copyright (C) 1995-1998, 2000-2001, 2003, 2005, 2007 Free Software Foundation, Inc. /* Copyright (C) 1995-1998, 2000-2001, 2003, 2005, 2007 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -2,20 +2,18 @@
Copyright (C) 1995-1999, 2000-2001, 2003-2007 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2001, 2003-2007 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.org>, 1995. Written by Ulrich Drepper <drepper@gnu.org>, 1995.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Implementation of gettext(3) function. /* Implementation of gettext(3) function.
Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -2,20 +2,18 @@
Copyright (C) 1995-1999, 2000-2007, 2009-2010 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2007, 2009-2010 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995. Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _GETTEXTP_H #ifndef _GETTEXTP_H
#define _GETTEXTP_H #define _GETTEXTP_H

View File

@ -1,20 +1,18 @@
/* Description of GNU message catalog format: general file layout. /* Description of GNU message catalog format: general file layout.
Copyright (C) 1995, 1997, 2000-2002, 2004, 2006 Free Software Foundation, Inc. Copyright (C) 1995, 1997, 2000-2002, 2004, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _GETTEXT_H #ifndef _GETTEXT_H
#define _GETTEXT_H 1 #define _GETTEXT_H 1

View File

@ -13,9 +13,8 @@
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free License along with the GNU C Library; if not, see
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, <http://www.gnu.org/licenses/>. */
Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Description of GNU message catalog format: string hashing function. /* Description of GNU message catalog format: string hashing function.
Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc. Copyright (C) 1995, 1997-1998, 2000-2003, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* @@ end of prolog @@ */ /* @@ end of prolog @@ */

View File

@ -1,21 +1,19 @@
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
Library. Library.
Copyright (C) 1995, 2000-2003, 2005 Software Foundation, Inc. Copyright (C) 1995, 2000-2003, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -2,23 +2,25 @@
Copyright (C) 2006 Free Software Foundation, Inc. Copyright (C) 2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006. Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* IMP(x) is a symbol that contains the address of x. */ /* IMP(x) is a symbol that contains the address of x. */
#define IMP(x) _imp__##x #if USER_LABEL_PREFIX_UNDERSCORE
# define IMP(x) _imp__##x
#else
# define IMP(x) __imp_##x
#endif
/* Ensure that the variable x is exported from the library, and that a /* Ensure that the variable x is exported from the library, and that a
pseudo-variable IMP(x) is available. */ pseudo-variable IMP(x) is available. */

View File

@ -1,20 +1,18 @@
/* Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc. /* Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <string.h> to provide a prototype for stpcpy(). /* Tell glibc's <string.h> to provide a prototype for stpcpy().
This must come before <config.h> because <config.h> may include This must come before <config.h> because <config.h> may include

View File

@ -1,20 +1,18 @@
/* Determine the user's language preferences. /* Determine the user's language preferences.
Copyright (C) 2004-2007 Free Software Foundation, Inc. Copyright (C) 2004-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>. /* Written by Bruno Haible <bruno@clisp.org>.
Win32 code originally by Michele Cicciotti <hackbunny@reactos.com>. */ Win32 code originally by Michele Cicciotti <hackbunny@reactos.com>. */

View File

@ -1,20 +1,18 @@
/* Message catalogs for internationalization. /* Message catalogs for internationalization.
Copyright (C) 1995-1997, 2000-2010 Free Software Foundation, Inc. Copyright (C) 1995-1997, 2000-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LIBINTL_H #ifndef _LIBINTL_H
#define _LIBINTL_H 1 #define _LIBINTL_H 1
@ -56,7 +54,7 @@ extern "C" {
/* Version number: (major<<16) + (minor<<8) + subminor */ /* Version number: (major<<16) + (minor<<8) + subminor */
#define LIBINTL_VERSION 0x001201 #define LIBINTL_VERSION 0x001303
extern int libintl_version; extern int libintl_version;
@ -178,7 +176,7 @@ extern char *dcgettext (const char *__domainname, const char *__msgid,
#endif #endif
/* Similar to `gettext' but select the plural form corresponding to the /* Similar to 'gettext' but select the plural form corresponding to the
number N. */ number N. */
#ifdef _INTL_REDIRECT_INLINE #ifdef _INTL_REDIRECT_INLINE
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2, extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
@ -199,7 +197,7 @@ extern char *ngettext (const char *__msgid1, const char *__msgid2,
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2); _INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
#endif #endif
/* Similar to `dgettext' but select the plural form corresponding to the /* Similar to 'dgettext' but select the plural form corresponding to the
number N. */ number N. */
#ifdef _INTL_REDIRECT_INLINE #ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1, extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
@ -221,7 +219,7 @@ extern char *dngettext (const char *__domainname,
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3); _INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif #endif
/* Similar to `dcgettext' but select the plural form corresponding to the /* Similar to 'dcgettext' but select the plural form corresponding to the
number N. */ number N. */
#ifdef _INTL_REDIRECT_INLINE #ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcngettext (const char *__domainname, extern char *libintl_dcngettext (const char *__domainname,
@ -431,9 +429,11 @@ extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
/* Support for the locale chosen by the user. */ /* Support for the locale chosen by the user. */
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ #if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
#ifndef GNULIB_defined_setlocale /* don't override gnulib */
#undef setlocale #undef setlocale
#define setlocale libintl_setlocale #define setlocale libintl_setlocale
extern char *setlocale (int, const char *); extern char *setlocale (int, const char *);
#endif
#if @HAVE_NEWLOCALE@ #if @HAVE_NEWLOCALE@

View File

@ -19,7 +19,7 @@ BEGIN
BEGIN BEGIN
BLOCK "04090000" /* Lang = US English, Charset = ASCII */ BLOCK "04090000" /* Lang = US English, Charset = ASCII */
BEGIN BEGIN
VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0" VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>.\0"
VALUE "CompanyName", "Free Software Foundation\0" VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista/7 and Windows 95/98/ME\0" VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista/7 and Windows 95/98/ME\0"
VALUE "FileVersion", PACKAGE_VERSION_STRING "\0" VALUE "FileVersion", PACKAGE_VERSION_STRING "\0"

View File

@ -2,20 +2,18 @@
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LOADINFO_H #ifndef _LOADINFO_H
#define _LOADINFO_H 1 #define _LOADINFO_H 1

View File

@ -1,20 +1,18 @@
/* Load needed message catalogs. /* Load needed message catalogs.
Copyright (C) 1995-1999, 2000-2008 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2008, 2010 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <string.h> to provide a prototype for mempcpy(). /* Tell glibc's <string.h> to provide a prototype for mempcpy().
This must come before <config.h> because <config.h> may include This must come before <config.h> because <config.h> may include
@ -27,6 +25,7 @@
# include <config.h> # include <config.h>
#endif #endif
#include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -101,6 +100,10 @@ char *alloca ();
# include "lock.h" # include "lock.h"
#endif #endif
#ifdef _LIBC
# define PRI_MACROS_BROKEN 0
#endif
/* Provide fallback values for macros that ought to be defined in <inttypes.h>. /* Provide fallback values for macros that ought to be defined in <inttypes.h>.
Note that our fallback values need not be literal strings, because we don't Note that our fallback values need not be literal strings, because we don't
use them with preprocessor string concatenation. */ use them with preprocessor string concatenation. */
@ -760,10 +763,12 @@ get_sysdep_segment_value (const char *name)
/* Test for a glibc specific printf() format directive flag. */ /* Test for a glibc specific printf() format directive flag. */
if (name[0] == 'I' && name[1] == '\0') if (name[0] == 'I' && name[1] == '\0')
{ {
#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) #if defined _LIBC \
|| ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) \
&& !defined __UCLIBC__)
/* The 'I' flag, in numeric format directives, replaces ASCII digits /* The 'I' flag, in numeric format directives, replaces ASCII digits
with the 'outdigits' defined in the LC_CTYPE locale facet. This is with the 'outdigits' defined in the LC_CTYPE locale facet. This is
used for Farsi (Persian) and maybe Arabic. */ used for Farsi (Persian), some Indic languages, and maybe Arabic. */
return "I"; return "I";
#else #else
return ""; return "";
@ -780,7 +785,7 @@ internal_function
_nl_load_domain (struct loaded_l10nfile *domain_file, _nl_load_domain (struct loaded_l10nfile *domain_file,
struct binding *domainbinding) struct binding *domainbinding)
{ {
__libc_lock_define_initialized_recursive (static, lock) __libc_lock_define_initialized_recursive (static, lock);
int fd = -1; int fd = -1;
size_t size; size_t size;
#ifdef _LIBC #ifdef _LIBC
@ -847,13 +852,15 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
MAP_PRIVATE, fd, 0); MAP_PRIVATE, fd, 0);
if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) if (__builtin_expect (data != MAP_FAILED, 1))
{ {
/* mmap() call was successful. */ /* mmap() call was successful. */
close (fd); close (fd);
fd = -1; fd = -1;
use_mmap = 1; use_mmap = 1;
} }
assert (MAP_FAILED == (void *) -1);
#endif #endif
/* If the data is not yet available (i.e. mmap'ed) we try to load /* If the data is not yet available (i.e. mmap'ed) we try to load
@ -1258,7 +1265,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
default: default:
/* This is an invalid revision. */ /* This is an invalid revision. */
invalid: invalid:
/* This is an invalid .mo file. */ /* This is an invalid .mo file or we ran out of resources. */
free (domain->malloced); free (domain->malloced);
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
if (use_mmap) if (use_mmap)
@ -1274,7 +1281,11 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
/* No caches of converted translations so far. */ /* No caches of converted translations so far. */
domain->conversions = NULL; domain->conversions = NULL;
domain->nconversions = 0; domain->nconversions = 0;
#ifdef _LIBC
__libc_rwlock_init (domain->conversions_lock);
#else
gl_rwlock_init (domain->conversions_lock); gl_rwlock_init (domain->conversions_lock);
#endif
/* Get the header entry and look for a plural specification. */ /* Get the header entry and look for a plural specification. */
#ifdef IN_LIBGLOCALE #ifdef IN_LIBGLOCALE
@ -1283,6 +1294,13 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
#else #else
nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen);
#endif #endif
if (__builtin_expect (nullentry == (char *) -1, 0))
{
#ifdef _LIBC
__libc_rwlock_fini (domain->conversions_lock);
#endif
goto invalid;
}
EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals); EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
out: out:
@ -1310,7 +1328,7 @@ _nl_unload_domain (struct loaded_domain *domain)
{ {
struct converted_domain *convd = &domain->conversions[i]; struct converted_domain *convd = &domain->conversions[i];
free (convd->encoding); free ((char *) convd->encoding);
if (convd->conv_tab != NULL && convd->conv_tab != (char **) -1) if (convd->conv_tab != NULL && convd->conv_tab != (char **) -1)
free (convd->conv_tab); free (convd->conv_tab);
if (convd->conv != (__gconv_t) -1) if (convd->conv != (__gconv_t) -1)

View File

@ -1,21 +1,19 @@
/* Determine a canonical name for the current locale's character encoding. /* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000-2006, 2008-2010 Free Software Foundation, Inc. Copyright (C) 2000-2006, 2008-2014 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>. */ /* Written by Bruno Haible <bruno@clisp.org>. */
@ -31,11 +29,12 @@
#include <stdlib.h> #include <stdlib.h>
#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET #if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */ # define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
#endif #endif
#if defined _WIN32 || defined __WIN32__ #if defined _WIN32 || defined __WIN32__
# define WIN32_NATIVE # define WINDOWS_NATIVE
# include <locale.h>
#endif #endif
#if defined __EMX__ #if defined __EMX__
@ -45,7 +44,7 @@
# endif # endif
#endif #endif
#if !defined WIN32_NATIVE #if !defined WINDOWS_NATIVE
# include <unistd.h> # include <unistd.h>
# if HAVE_LANGINFO_CODESET # if HAVE_LANGINFO_CODESET
# include <langinfo.h> # include <langinfo.h>
@ -58,7 +57,7 @@
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
# endif # endif
#elif defined WIN32_NATIVE #elif defined WINDOWS_NATIVE
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
#endif #endif
@ -67,6 +66,11 @@
# include <os2.h> # include <os2.h>
#endif #endif
/* For MB_CUR_MAX_L */
#if defined DARWIN7
# include <xlocale.h>
#endif
#if ENABLE_RELOCATABLE #if ENABLE_RELOCATABLE
# include "relocatable.h" # include "relocatable.h"
#else #else
@ -84,7 +88,7 @@
#endif #endif
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Win32, Cygwin, OS/2, DOS */ /* Native Windows, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\') # define ISSLASH(C) ((C) == '/' || (C) == '\\')
#endif #endif
@ -124,7 +128,7 @@ get_charset_aliases (void)
cp = charset_aliases; cp = charset_aliases;
if (cp == NULL) if (cp == NULL)
{ {
#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) #if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__)
const char *dir; const char *dir;
const char *base = "charset.alias"; const char *base = "charset.alias";
char *file_name; char *file_name;
@ -229,7 +233,6 @@ get_charset_aliases (void)
{ {
/* Out of memory. */ /* Out of memory. */
res_size = 0; res_size = 0;
if (old_res_ptr != NULL)
free (old_res_ptr); free (old_res_ptr);
break; break;
} }
@ -310,7 +313,7 @@ get_charset_aliases (void)
"DECKOREAN" "\0" "EUC-KR" "\0"; "DECKOREAN" "\0" "EUC-KR" "\0";
# endif # endif
# if defined WIN32_NATIVE || defined __CYGWIN__ # if defined WINDOWS_NATIVE || defined __CYGWIN__
/* To avoid the troubles of installing a separate file in the same /* To avoid the troubles of installing a separate file in the same
directory as the DLL and of retrieving the DLL's directory at directory as the DLL and of retrieving the DLL's directory at
runtime, simply inline the aliases here. */ runtime, simply inline the aliases here. */
@ -362,7 +365,7 @@ locale_charset (void)
const char *codeset; const char *codeset;
const char *aliases; const char *aliases;
#if !(defined WIN32_NATIVE || defined OS2) #if !(defined WINDOWS_NATIVE || defined OS2)
# if HAVE_LANGINFO_CODESET # if HAVE_LANGINFO_CODESET
@ -409,10 +412,10 @@ locale_charset (void)
} }
} }
/* Woe32 has a function returning the locale's codepage as a number: /* The Windows API has a function returning the locale's codepage as a
GetACP(). This encoding is used by Cygwin, unless the user has set number: GetACP(). This encoding is used by Cygwin, unless the user
the environment variable CYGWIN=codepage:oem (which very few people has set the environment variable CYGWIN=codepage:oem (which very few
do). people do).
Output directed to console windows needs to be converted (to Output directed to console windows needs to be converted (to
GetOEMCP() if the console is using a raster font, or to GetOEMCP() if the console is using a raster font, or to
GetConsoleOutputCP() if it is using a TrueType font). Cygwin does GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
@ -455,18 +458,38 @@ locale_charset (void)
# endif # endif
#elif defined WIN32_NATIVE #elif defined WINDOWS_NATIVE
static char buf[2 + 10 + 1]; static char buf[2 + 10 + 1];
/* Woe32 has a function returning the locale's codepage as a number: /* The Windows API has a function returning the locale's codepage as
GetACP(). a number, but the value doesn't change according to what the
'setlocale' call specified. So we use it as a last resort, in
case the string returned by 'setlocale' doesn't specify the
codepage. */
char *current_locale = setlocale (LC_ALL, NULL);
char *pdot;
/* If they set different locales for different categories,
'setlocale' will return a semi-colon separated list of locale
values. To make sure we use the correct one, we choose LC_CTYPE. */
if (strchr (current_locale, ';'))
current_locale = setlocale (LC_CTYPE, NULL);
pdot = strrchr (current_locale, '.');
if (pdot)
sprintf (buf, "CP%s", pdot + 1);
else
{
/* The Windows API has a function returning the locale's codepage as a
number: GetACP().
When the output goes to a console window, it needs to be provided in When the output goes to a console window, it needs to be provided in
GetOEMCP() encoding if the console is using a raster font, or in GetOEMCP() encoding if the console is using a raster font, or in
GetConsoleOutputCP() encoding if it is using a TrueType font. GetConsoleOutputCP() encoding if it is using a TrueType font.
But in GUI programs and for output sent to files and pipes, GetACP() But in GUI programs and for output sent to files and pipes, GetACP()
encoding is the best bet. */ encoding is the best bet. */
sprintf (buf, "CP%u", GetACP ()); sprintf (buf, "CP%u", GetACP ());
}
codeset = buf; codeset = buf;
#elif defined OS2 #elif defined OS2
@ -545,5 +568,12 @@ locale_charset (void)
if (codeset[0] == '\0') if (codeset[0] == '\0')
codeset = "ASCII"; codeset = "ASCII";
#ifdef DARWIN7
/* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
(the default codeset) does not work when MB_CUR_MAX is 1. */
if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
codeset = "ASCII";
#endif
return codeset; return codeset;
} }

View File

@ -2,20 +2,18 @@
Copyright (C) 2000-2003 Free Software Foundation, Inc. Copyright (C) 2000-2003 Free Software Foundation, Inc.
This file is part of the GNU CHARSET Library. This file is part of the GNU CHARSET Library.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _LOCALCHARSET_H #ifndef _LOCALCHARSET_H
#define _LOCALCHARSET_H #define _LOCALCHARSET_H

View File

@ -1,20 +1,18 @@
# Locale name alias data base. # Locale name alias data base.
# Copyright (C) 1996-2001,2003,2007 Free Software Foundation, Inc. # Copyright (C) 1996-2001,2003,2007 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify
# under the terms of the GNU Library General Public License as published # it under the terms of the GNU Lesser General Public License as published by
# by the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2.1 of the License, or
# any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Library General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Library General Public # You should have received a copy of the GNU Lesser General Public License
# License along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# The format of this file is the same as for the corresponding file of # The format of this file is the same as for the corresponding file of
# the X Window System, which normally can be found in # the X Window System, which normally can be found in
@ -29,7 +27,7 @@
# Packages using this file: # Packages using this file:
bokmal nb_NO.ISO-8859-1 bokmal nb_NO.ISO-8859-1
bokmål nb_NO.ISO-8859-1 bokm<EFBFBD>l nb_NO.ISO-8859-1
catalan ca_ES.ISO-8859-1 catalan ca_ES.ISO-8859-1
croatian hr_HR.ISO-8859-2 croatian hr_HR.ISO-8859-2
czech cs_CZ.ISO-8859-2 czech cs_CZ.ISO-8859-2
@ -40,7 +38,7 @@ dutch nl_NL.ISO-8859-1
eesti et_EE.ISO-8859-1 eesti et_EE.ISO-8859-1
estonian et_EE.ISO-8859-1 estonian et_EE.ISO-8859-1
finnish fi_FI.ISO-8859-1 finnish fi_FI.ISO-8859-1
français fr_FR.ISO-8859-1 fran<EFBFBD>ais fr_FR.ISO-8859-1
french fr_FR.ISO-8859-1 french fr_FR.ISO-8859-1
galego gl_ES.ISO-8859-1 galego gl_ES.ISO-8859-1
galician gl_ES.ISO-8859-1 galician gl_ES.ISO-8859-1

View File

@ -1,20 +1,18 @@
/* Handle aliases for locale names. /* Handle aliases for locale names.
Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc. Copyright (C) 1995-1999, 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <string.h> to provide a prototype for mempcpy(). /* Tell glibc's <string.h> to provide a prototype for mempcpy().
This must come before <config.h> because <config.h> may include This must come before <config.h> because <config.h> may include

View File

@ -1,24 +1,22 @@
/* Determine name of the currently selected locale. /* Determine name of the currently selected locale.
Copyright (C) 1995-1999, 2000-2010 Free Software Foundation, Inc. Copyright (C) 1995-2014 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */ /* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */
/* Win32 code written by Tor Lillqvist <tml@iki.fi>. */ /* Native Windows code written by Tor Lillqvist <tml@iki.fi>. */
/* MacOS X code written by Bruno Haible <bruno@clisp.org>. */ /* Mac OS X code written by Bruno Haible <bruno@clisp.org>. */
#include <config.h> #include <config.h>
@ -36,7 +34,7 @@
#include <string.h> #include <string.h>
#if HAVE_USELOCALE #if HAVE_USELOCALE
/* MacOS X 10.5 defines the locale_t type in <xlocale.h>. */ /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>. */
# if defined __APPLE__ && defined __MACH__ # if defined __APPLE__ && defined __MACH__
# include <xlocale.h> # include <xlocale.h>
# endif # endif
@ -56,12 +54,16 @@
#endif #endif
#if defined _WIN32 || defined __WIN32__ #if defined _WIN32 || defined __WIN32__
# define WIN32_NATIVE # define WINDOWS_NATIVE
# if !defined IN_LIBINTL
# include "glthread/lock.h"
# endif
#endif #endif
#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */ #if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
# include <winnls.h>
/* List of language codes, sorted by value: /* List of language codes, sorted by value:
0x01 LANG_ARABIC 0x01 LANG_ARABIC
0x02 LANG_BULGARIAN 0x02 LANG_BULGARIAN
@ -1126,15 +1128,18 @@
# ifndef LOCALE_SNAME # ifndef LOCALE_SNAME
# define LOCALE_SNAME 0x5c # define LOCALE_SNAME 0x5c
# endif # endif
# ifndef LOCALE_NAME_MAX_LENGTH
# define LOCALE_NAME_MAX_LENGTH 85
# endif
#endif #endif
#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
/* MacOS X 10.2 or newer */ /* Mac OS X 10.2 or newer */
/* Canonicalize a MacOS X locale name to a Unix locale name. /* Canonicalize a Mac OS X locale name to a Unix locale name.
NAME is a sufficiently large buffer. NAME is a sufficiently large buffer.
On input, it contains the MacOS X locale name. On input, it contains the Mac OS X locale name.
On output, it contains the Unix locale name. */ On output, it contains the Unix locale name. */
# if !defined IN_LIBINTL # if !defined IN_LIBINTL
static static
@ -1147,9 +1152,9 @@ gl_locale_name_canonicalize (char *name)
http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */ http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */
/* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and
ISO 3166) names. Prior to MacOS X 10.3, there is no API for doing this. ISO 3166) names. Prior to Mac OS X 10.3, there is no API for doing this.
Therefore we do it ourselves, using a table based on the results of the Therefore we do it ourselves, using a table based on the results of the
MacOS X 10.3.8 function Mac OS X 10.3.8 function
CFLocaleCreateCanonicalLocaleIdentifierFromString(). */ CFLocaleCreateCanonicalLocaleIdentifierFromString(). */
typedef struct { const char legacy[21+1]; const char unixy[5+1]; } typedef struct { const char legacy[21+1]; const char unixy[5+1]; }
legacy_entry; legacy_entry;
@ -1292,26 +1297,26 @@ gl_locale_name_canonicalize (char *name)
typedef struct { const char langtag[7+1]; const char unixy[12+1]; } typedef struct { const char langtag[7+1]; const char unixy[12+1]; }
langtag_entry; langtag_entry;
static const langtag_entry langtag_table[] = { static const langtag_entry langtag_table[] = {
/* MacOS X has "az-Arab", "az-Cyrl", "az-Latn". /* Mac OS X has "az-Arab", "az-Cyrl", "az-Latn".
The default script for az on Unix is Latin. */ The default script for az on Unix is Latin. */
{ "az-Latn", "az" }, { "az-Latn", "az" },
/* MacOS X has "ga-dots". Does not yet exist on Unix. */ /* Mac OS X has "ga-dots". Does not yet exist on Unix. */
{ "ga-dots", "ga" }, { "ga-dots", "ga" },
/* MacOS X has "kk-Cyrl". Does not yet exist on Unix. */ /* Mac OS X has "kk-Cyrl". Does not yet exist on Unix. */
/* MacOS X has "mn-Cyrl", "mn-Mong". /* Mac OS X has "mn-Cyrl", "mn-Mong".
The default script for mn on Unix is Cyrillic. */ The default script for mn on Unix is Cyrillic. */
{ "mn-Cyrl", "mn" }, { "mn-Cyrl", "mn" },
/* MacOS X has "ms-Arab", "ms-Latn". /* Mac OS X has "ms-Arab", "ms-Latn".
The default script for ms on Unix is Latin. */ The default script for ms on Unix is Latin. */
{ "ms-Latn", "ms" }, { "ms-Latn", "ms" },
/* MacOS X has "tg-Cyrl". /* Mac OS X has "tg-Cyrl".
The default script for tg on Unix is Cyrillic. */ The default script for tg on Unix is Cyrillic. */
{ "tg-Cyrl", "tg" }, { "tg-Cyrl", "tg" },
/* MacOS X has "tk-Cyrl". Does not yet exist on Unix. */ /* Mac OS X has "tk-Cyrl". Does not yet exist on Unix. */
/* MacOS X has "tt-Cyrl". /* Mac OS X has "tt-Cyrl".
The default script for tt on Unix is Cyrillic. */ The default script for tt on Unix is Cyrillic. */
{ "tt-Cyrl", "tt" }, { "tt-Cyrl", "tt" },
/* MacOS X has "zh-Hans", "zh-Hant". /* Mac OS X has "zh-Hans", "zh-Hant".
Country codes are used to distinguish these on Unix. */ Country codes are used to distinguish these on Unix. */
{ "zh-Hans", "zh_CN" }, { "zh-Hans", "zh_CN" },
{ "zh-Hant", "zh_TW" } { "zh-Hant", "zh_TW" }
@ -1407,11 +1412,11 @@ gl_locale_name_canonicalize (char *name)
#endif #endif
#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */ #if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
/* Canonicalize a Win32 native locale name to a Unix locale name. /* Canonicalize a Windows native locale name to a Unix locale name.
NAME is a sufficiently large buffer. NAME is a sufficiently large buffer.
On input, it contains the Win32 locale name. On input, it contains the Windows locale name.
On output, it contains the Unix locale name. */ On output, it contains the Unix locale name. */
# if !defined IN_LIBINTL # if !defined IN_LIBINTL
static static
@ -1467,9 +1472,9 @@ gl_locale_name_from_win32_LANGID (LANGID langid)
} }
/* Internet Explorer has an LCID to RFC3066 name mapping stored in /* Internet Explorer has an LCID to RFC3066 name mapping stored in
HKEY_CLASSES_ROOT\Mime\Database\Rfc1766. But we better don't use that HKEY_CLASSES_ROOT\Mime\Database\Rfc1766. But we better don't use that
since IE's i18n subsystem is known to be inconsistent with the Win32 base since IE's i18n subsystem is known to be inconsistent with the native
(e.g. they have different character conversion facilities that produce Windows base (e.g. they have different character conversion facilities
different results). */ that produce different results). */
/* Use our own table. */ /* Use our own table. */
{ {
int primary, sub; int primary, sub;
@ -2504,10 +2509,82 @@ gl_locale_name_from_win32_LCID (LCID lcid)
return gl_locale_name_from_win32_LANGID (langid); return gl_locale_name_from_win32_LANGID (langid);
} }
# ifdef WINDOWS_NATIVE
/* Two variables to interface between get_lcid and the EnumLocales
callback function below. */
static LCID found_lcid;
static char lname[LC_MAX * (LOCALE_NAME_MAX_LENGTH + 1) + 1];
/* Callback function for EnumLocales. */
static BOOL CALLBACK
enum_locales_fn (LPTSTR locale_num_str)
{
char *endp;
char locval[2 * LOCALE_NAME_MAX_LENGTH + 1 + 1];
LCID try_lcid = strtoul (locale_num_str, &endp, 16);
if (GetLocaleInfo (try_lcid, LOCALE_SENGLANGUAGE,
locval, LOCALE_NAME_MAX_LENGTH))
{
strcat (locval, "_");
if (GetLocaleInfo (try_lcid, LOCALE_SENGCOUNTRY,
locval + strlen (locval), LOCALE_NAME_MAX_LENGTH))
{
size_t locval_len = strlen (locval);
if (strncmp (locval, lname, locval_len) == 0
&& (lname[locval_len] == '.'
|| lname[locval_len] == '\0'))
{
found_lcid = try_lcid;
return FALSE;
}
}
}
return TRUE;
}
/* This lock protects the get_lcid against multiple simultaneous calls. */
gl_lock_define_initialized(static, get_lcid_lock)
/* Return the Locale ID (LCID) number given the locale's name, a
string, in LOCALE_NAME. This works by enumerating all the locales
supported by the system, until we find one whose name matches
LOCALE_NAME. */
static LCID
get_lcid (const char *locale_name)
{
/* A simple cache. */
static LCID last_lcid;
static char last_locale[1000];
/* Lock while looking for an LCID, to protect access to static
variables: last_lcid, last_locale, found_lcid, and lname. */
gl_lock_lock (get_lcid_lock);
if (last_lcid > 0 && strcmp (locale_name, last_locale) == 0)
{
gl_lock_unlock (get_lcid_lock);
return last_lcid;
}
strncpy (lname, locale_name, sizeof (lname) - 1);
lname[sizeof (lname) - 1] = '\0';
found_lcid = 0;
EnumSystemLocales (enum_locales_fn, LCID_SUPPORTED);
if (found_lcid > 0)
{
last_lcid = found_lcid;
strcpy (last_locale, locale_name);
}
gl_lock_unlock (get_lcid_lock);
return found_lcid;
}
# endif
#endif #endif
#if HAVE_USELOCALE /* glibc or MacOS X */ #if HAVE_USELOCALE /* glibc or Mac OS X */
/* Simple hash set of strings. We don't want to drag in lots of hash table /* Simple hash set of strings. We don't want to drag in lots of hash table
code here. */ code here. */
@ -2517,7 +2594,7 @@ gl_locale_name_from_win32_LCID (LCID lcid)
/* A hash function for NUL-terminated char* strings using /* A hash function for NUL-terminated char* strings using
the method described by Bruno Haible. the method described by Bruno Haible.
See http://www.haible.de/bruno/hashfunc.html. */ See http://www.haible.de/bruno/hashfunc.html. */
static size_t static size_t _GL_ATTRIBUTE_PURE
string_hash (const void *x) string_hash (const void *x)
{ {
const char *s = (const char *) x; const char *s = (const char *) x;
@ -2607,7 +2684,7 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
locale_t thread_locale = uselocale (NULL); locale_t thread_locale = uselocale (NULL);
if (thread_locale != LC_GLOBAL_LOCALE) if (thread_locale != LC_GLOBAL_LOCALE)
{ {
# if __GLIBC__ >= 2 && !defined(__UCLIBC__) # if __GLIBC__ >= 2 && !defined __UCLIBC__
/* Work around an incorrect definition of the _NL_LOCALE_NAME macro in /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
glibc < 2.12. glibc < 2.12.
See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
@ -2618,133 +2695,34 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
nl_langinfo (_NL_LOCALE_NAME (category)). */ nl_langinfo (_NL_LOCALE_NAME (category)). */
name = thread_locale->__names[category]; name = thread_locale->__names[category];
return name; return name;
# endif # elif defined __FreeBSD__ || (defined __APPLE__ && defined __MACH__)
# if defined __APPLE__ && defined __MACH__ /* MacOS X */ /* FreeBSD, Mac OS X */
/* The locale name is found deep in an undocumented data structure. int mask;
Since it's stored in a buffer of size 32 and newlocale() rejects
locale names of length > 31, we can assume that it is NUL terminated
in this buffer. But we need to make a copy of the locale name, of
indefinite extent. */
struct _xlocale_part1_v0 /* used in MacOS X 10.5 */
{
int32_t __refcount;
void (*__free_extra)(void *);
__darwin_mbstate_t __mbs[10];
int64_t __magic;
};
struct _xlocale_part1_v1 /* used in MacOS X >= 10.6.0 */
{
int32_t __refcount;
void (*__free_extra)(void *);
__darwin_mbstate_t __mbs[10];
/*pthread_lock_t*/ int __lock;
int64_t __magic;
};
struct _xlocale_part2
{
int64_t __magic;
unsigned char __collate_load_error;
unsigned char __collate_substitute_nontrivial;
unsigned char _messages_using_locale;
unsigned char _monetary_using_locale;
unsigned char _numeric_using_locale;
unsigned char _time_using_locale;
unsigned char __mlocale_changed;
unsigned char __nlocale_changed;
unsigned char __numeric_fp_cvt;
struct __xlocale_st_collate *__lc_collate;
struct __xlocale_st_runelocale *__lc_ctype;
struct __xlocale_st_messages *__lc_messages;
struct __xlocale_st_monetary *__lc_monetary;
struct __xlocale_st_numeric *__lc_numeric;
struct _xlocale *__lc_numeric_loc;
struct __xlocale_st_time *__lc_time;
/* more */
};
struct __xlocale_st_collate
{
int32_t __refcount;
void (*__free_extra)(void *);
char __encoding[32];
/* more */
};
struct __xlocale_st_runelocale
{
int32_t __refcount;
void (*__free_extra)(void *);
char __ctype_encoding[32];
/* more */
};
struct __xlocale_st_messages
{
int32_t __refcount;
void (*__free_extra)(void *);
char *_messages_locale_buf;
/* more */
};
struct __xlocale_st_monetary
{
int32_t __refcount;
void (*__free_extra)(void *);
char *_monetary_locale_buf;
/* more */
};
struct __xlocale_st_numeric {
int32_t __refcount;
void (*__free_extra)(void *);
char *_numeric_locale_buf;
/* more */
};
struct __xlocale_st_time {
int32_t __refcount;
void (*__free_extra)(void *);
char *_time_locale_buf;
/* more */
};
struct _xlocale_part2 *tlp;
if (((struct _xlocale_part1_v0 *) thread_locale)->__magic
== 0x786C6F63616C6530LL)
/* MacOS X 10.5 */
tlp =
(struct _xlocale_part2 *)
&((struct _xlocale_part1_v0 *) thread_locale)->__magic;
else if (((struct _xlocale_part1_v1 *) thread_locale)->__magic
== 0x786C6F63616C6530LL)
/* MacOS X >= 10.6.0 */
tlp =
(struct _xlocale_part2 *)
&((struct _xlocale_part1_v1 *) thread_locale)->__magic;
else
/* Unsupported version of MacOS X: The internals of 'struct _xlocale'
have changed again. */
return "";
switch (category) switch (category)
{ {
case LC_CTYPE: case LC_CTYPE:
return tlp->__lc_ctype->__ctype_encoding; mask = LC_CTYPE_MASK;
break;
case LC_NUMERIC: case LC_NUMERIC:
return tlp->_numeric_using_locale mask = LC_NUMERIC_MASK;
? tlp->__lc_numeric->_numeric_locale_buf break;
: "C";
case LC_TIME: case LC_TIME:
return tlp->_time_using_locale mask = LC_TIME_MASK;
? tlp->__lc_time->_time_locale_buf break;
: "C";
case LC_COLLATE: case LC_COLLATE:
return !tlp->__collate_load_error mask = LC_COLLATE_MASK;
? tlp->__lc_collate->__encoding break;
: "C";
case LC_MONETARY: case LC_MONETARY:
return tlp->_monetary_using_locale mask = LC_MONETARY_MASK;
? tlp->__lc_monetary->_monetary_locale_buf break;
: "C";
case LC_MESSAGES: case LC_MESSAGES:
return tlp->_messages_using_locale mask = LC_MESSAGES_MASK;
? tlp->__lc_messages->_messages_locale_buf break;
: "C";
default: /* We shouldn't get here. */ default: /* We shouldn't get here. */
return ""; return "";
} }
return querylocale (mask, thread_locale);
# endif # endif
} }
} }
@ -2761,6 +2739,27 @@ gl_locale_name_thread (int category, const char *categoryname)
const char *name = gl_locale_name_thread_unsafe (category, categoryname); const char *name = gl_locale_name_thread_unsafe (category, categoryname);
if (name != NULL) if (name != NULL)
return struniq (name); return struniq (name);
#elif defined WINDOWS_NATIVE
if (LC_MIN <= category && category <= LC_MAX)
{
char *locname = setlocale (category, NULL);
LCID lcid = 0;
/* If CATEGORY is LC_ALL, the result might be a semi-colon
separated list of locales. We need only one, so we take the
one corresponding to LC_CTYPE, as the most important for
character translations. */
if (strchr (locname, ';'))
locname = setlocale (LC_CTYPE, NULL);
/* Convert locale name to LCID. We don't want to use
LocaleNameToLCID because (a) it is only available since Vista,
and (b) it doesn't accept locale names returned by 'setlocale'. */
lcid = get_lcid (locname);
if (lcid > 0)
return gl_locale_name_from_win32_LCID (lcid);
}
#endif #endif
return NULL; return NULL;
} }
@ -2771,8 +2770,7 @@ gl_locale_name_thread (int category, const char *categoryname)
However it does not specify the exact format. Neither do SUSV2 and However it does not specify the exact format. Neither do SUSV2 and
ISO C 99. So we can use this feature only on selected systems (e.g. ISO C 99. So we can use this feature only on selected systems (e.g.
those using GNU C Library). */ those using GNU C Library). */
#if defined _LIBC || (defined __GLIBC__ && __GLIBC__ >= 2 \ #if defined _LIBC || ((defined __GLIBC__ && __GLIBC__ >= 2) && !defined __UCLIBC__)
&& (!defined __UCLIBC__ || defined __UCLIBC_HAS_LOCALE__))
# define HAVE_LOCALE_NULL # define HAVE_LOCALE_NULL
#endif #endif
@ -2787,8 +2785,8 @@ gl_locale_name_posix (int category, const char *categoryname)
/* On other systems we ignore what setlocale reports and instead look at the /* On other systems we ignore what setlocale reports and instead look at the
environment variables directly. This is necessary environment variables directly. This is necessary
1. on systems which have a facility for customizing the default locale 1. on systems which have a facility for customizing the default locale
(MacOS X, native Windows, Cygwin) and where the system's setlocale() (Mac OS X, native Windows, Cygwin) and where the system's setlocale()
function ignores this default locale (MacOS X, Cygwin), in two cases: function ignores this default locale (Mac OS X, Cygwin), in two cases:
a. when the user missed to use the setlocale() override from libintl a. when the user missed to use the setlocale() override from libintl
(for example by not including <libintl.h>), (for example by not including <libintl.h>),
b. when setlocale supports only the "C" locale, such as on Cygwin b. when setlocale supports only the "C" locale, such as on Cygwin
@ -2823,7 +2821,7 @@ gl_locale_name_environ (int category, const char *categoryname)
if (retval != NULL && retval[0] != '\0') if (retval != NULL && retval[0] != '\0')
{ {
#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
/* MacOS X 10.2 or newer. /* Mac OS X 10.2 or newer.
Ignore invalid LANG value set by the Terminal application. */ Ignore invalid LANG value set by the Terminal application. */
if (strcmp (retval, "UTF-8") != 0) if (strcmp (retval, "UTF-8") != 0)
#endif #endif
@ -2850,10 +2848,10 @@ gl_locale_name_default (void)
locale, customizing it for each location. POSIX:2001 does not require locale, customizing it for each location. POSIX:2001 does not require
such a facility. such a facility.
The systems with such a facility are MacOS X and Windows: They provide a The systems with such a facility are Mac OS X and Windows: They provide a
GUI that allows the user to choose a locale. GUI that allows the user to choose a locale.
- On MacOS X, by default, none of LC_* or LANG are set. Starting with - On Mac OS X, by default, none of LC_* or LANG are set. Starting with
MacOS X 10.4 or 10.5, LANG is set for processes launched by the Mac OS X 10.4 or 10.5, LANG is set for processes launched by the
'Terminal' application (but sometimes to an incorrect value "UTF-8"). 'Terminal' application (but sometimes to an incorrect value "UTF-8").
When no environment variable is set, setlocale (LC_ALL, "") uses the When no environment variable is set, setlocale (LC_ALL, "") uses the
"C" locale. "C" locale.
@ -2869,7 +2867,7 @@ gl_locale_name_default (void)
"C.UTF-8" locale, which operates in the same way as the "C" locale. "C.UTF-8" locale, which operates in the same way as the "C" locale.
*/ */
#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WIN32_NATIVE || defined __CYGWIN__) #if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__)
/* The system does not have a way of setting the locale, other than the /* The system does not have a way of setting the locale, other than the
POSIX specified environment variables. We use C as default locale. */ POSIX specified environment variables. We use C as default locale. */
@ -2883,7 +2881,7 @@ gl_locale_name_default (void)
codeset. */ codeset. */
# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
/* MacOS X 10.2 or newer */ /* Mac OS X 10.2 or newer */
{ {
/* Cache the locale name, since CoreFoundation calls are expensive. */ /* Cache the locale name, since CoreFoundation calls are expensive. */
static const char *cached_localename; static const char *cached_localename;
@ -2891,7 +2889,7 @@ gl_locale_name_default (void)
if (cached_localename == NULL) if (cached_localename == NULL)
{ {
char namebuf[256]; char namebuf[256];
# if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */ # if HAVE_CFLOCALECOPYCURRENT /* Mac OS X 10.3 or newer */
CFLocaleRef locale = CFLocaleCopyCurrent (); CFLocaleRef locale = CFLocaleCopyCurrent ();
CFStringRef name = CFLocaleGetIdentifier (locale); CFStringRef name = CFLocaleGetIdentifier (locale);
@ -2902,7 +2900,7 @@ gl_locale_name_default (void)
cached_localename = strdup (namebuf); cached_localename = strdup (namebuf);
} }
CFRelease (locale); CFRelease (locale);
# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */ # elif HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.2 or newer */
CFTypeRef value = CFTypeRef value =
CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), CFPreferencesCopyAppValue (CFSTR ("AppleLocale"),
kCFPreferencesCurrentApplication); kCFPreferencesCurrentApplication);
@ -2924,11 +2922,11 @@ gl_locale_name_default (void)
# endif # endif
# if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */ # if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */
{ {
LCID lcid; LCID lcid;
/* Use native Win32 API locale ID. */ /* Use native Windows API locale ID. */
lcid = GetThreadLocale (); lcid = GetThreadLocale ();
return gl_locale_name_from_win32_LCID (lcid); return gl_locale_name_from_win32_LCID (lcid);

View File

@ -1,20 +1,18 @@
/* Locking in multithreaded situations. /* Locking in multithreaded situations.
Copyright (C) 2005-2008 Free Software Foundation, Inc. Copyright (C) 2005-2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005. /* Written by Bruno Haible <bruno@clisp.org>, 2005.
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
@ -631,7 +629,7 @@ glthread_once_singlethreaded (gl_once_t *once_control)
/* ========================================================================= */ /* ========================================================================= */
#if USE_WIN32_THREADS #if USE_WINDOWS_THREADS
/* -------------------------- gl_lock_t datatype -------------------------- */ /* -------------------------- gl_lock_t datatype -------------------------- */
@ -684,7 +682,7 @@ glthread_lock_destroy_func (gl_lock_t *lock)
/* In this file, the waitqueues are implemented as circular arrays. */ /* In this file, the waitqueues are implemented as circular arrays. */
#define gl_waitqueue_t gl_carray_waitqueue_t #define gl_waitqueue_t gl_carray_waitqueue_t
static inline void static void
gl_waitqueue_init (gl_waitqueue_t *wq) gl_waitqueue_init (gl_waitqueue_t *wq)
{ {
wq->array = NULL; wq->array = NULL;
@ -745,7 +743,7 @@ gl_waitqueue_add (gl_waitqueue_t *wq)
} }
/* Notifies the first thread from a wait queue and dequeues it. */ /* Notifies the first thread from a wait queue and dequeues it. */
static inline void static void
gl_waitqueue_notify_first (gl_waitqueue_t *wq) gl_waitqueue_notify_first (gl_waitqueue_t *wq)
{ {
SetEvent (wq->array[wq->offset + 0]); SetEvent (wq->array[wq->offset + 0]);
@ -756,7 +754,7 @@ gl_waitqueue_notify_first (gl_waitqueue_t *wq)
} }
/* Notifies all threads from a wait queue and dequeues them all. */ /* Notifies all threads from a wait queue and dequeues them all. */
static inline void static void
gl_waitqueue_notify_all (gl_waitqueue_t *wq) gl_waitqueue_notify_all (gl_waitqueue_t *wq)
{ {
unsigned int i; unsigned int i;

View File

@ -1,20 +1,18 @@
/* Locking in multithreaded situations. /* Locking in multithreaded situations.
Copyright (C) 2005-2008 Free Software Foundation, Inc. Copyright (C) 2005-2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005. /* Written by Bruno Haible <bruno@clisp.org>, 2005.
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
@ -615,16 +613,17 @@ extern int glthread_once_singlethreaded (gl_once_t *once_control);
/* ========================================================================= */ /* ========================================================================= */
#if USE_WIN32_THREADS #if USE_WINDOWS_THREADS
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h> # include <windows.h>
# ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
# endif # endif
/* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex, /* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
Semaphore types, because Mutex, Semaphore types, because
- we need only to synchronize inside a single process (address space), - we need only to synchronize inside a single process (address space),
not inter-process locking, not inter-process locking,
- we don't need to support trylock operations. (TryEnterCriticalSection - we don't need to support trylock operations. (TryEnterCriticalSection
@ -710,9 +709,9 @@ extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
/* --------------------- gl_recursive_lock_t datatype --------------------- */ /* --------------------- gl_recursive_lock_t datatype --------------------- */
/* The Win32 documentation says that CRITICAL_SECTION already implements a /* The native Windows documentation says that CRITICAL_SECTION already
recursive lock. But we need not rely on it: It's easy to implement a implements a recursive lock. But we need not rely on it: It's easy to
recursive lock without this assumption. */ implement a recursive lock without this assumption. */
typedef struct typedef struct
{ {
@ -764,7 +763,7 @@ extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (v
/* ========================================================================= */ /* ========================================================================= */
#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS) #if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */ /* Provide dummy implementation if threads are not supported. */

View File

@ -1,20 +1,18 @@
/* Log file output. /* Log file output.
Copyright (C) 2003, 2005, 2009 Free Software Foundation, Inc. Copyright (C) 2003, 2005, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>. */ /* Written by Bruno Haible <bruno@clisp.org>. */

View File

@ -1,20 +1,18 @@
/* Implementation of ngettext(3) function. /* Implementation of ngettext(3) function.
Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc. Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* OS/2 compatibility functions. /* OS/2 compatibility functions.
Copyright (C) 2001-2002 Free Software Foundation, Inc. Copyright (C) 2001-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#define OS2_AWARE #define OS2_AWARE
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H

View File

@ -2,20 +2,18 @@
This file is intended to be included from config.h This file is intended to be included from config.h
Copyright (C) 2001-2002 Free Software Foundation, Inc. Copyright (C) 2001-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* When included from os2compat.h we need all the original definitions */ /* When included from os2compat.h we need all the original definitions */
#ifndef OS2_AWARE #ifndef OS2_AWARE

View File

@ -1,22 +1,20 @@
/* OS dependent parts of libintl. /* OS dependent parts of libintl.
Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#if defined __CYGWIN__ #if defined __CYGWIN__ || defined __MINGW32__
# include "intl-exports.c" # include "intl-exports.c"
#elif defined __EMX__ #elif defined __EMX__
# include "os2compat.c" # include "os2compat.c"

View File

@ -2,20 +2,18 @@
Copyright (C) 2000-2001, 2003, 2005-2007 Free Software Foundation, Inc. Copyright (C) 2000-2001, 2003, 2005-2007 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000. Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -2,20 +2,18 @@
Copyright (C) 2000-2003, 2005-2007 Free Software Foundation, Inc. Copyright (C) 2000-2003, 2005-2007 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000. Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _PLURAL_EXP_H #ifndef _PLURAL_EXP_H
#define _PLURAL_EXP_H #define _PLURAL_EXP_H
@ -109,7 +107,7 @@ struct parse_args
extern void FREE_EXPRESSION (struct expression *exp) extern void FREE_EXPRESSION (struct expression *exp)
internal_function; internal_function;
extern int PLURAL_PARSE (void *arg); extern int PLURAL_PARSE (struct parse_args *arg);
extern struct expression GERMANIC_PLURAL attribute_hidden; extern struct expression GERMANIC_PLURAL attribute_hidden;
extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
const struct expression **pluralp, const struct expression **pluralp,

File diff suppressed because it is too large Load Diff

View File

@ -3,20 +3,18 @@
Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc. Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000. Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us /* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us
to put this declaration at the beginning of the file. The declaration in to put this declaration at the beginning of the file. The declaration in
@ -42,10 +40,10 @@
# define __gettextparse PLURAL_PARSE # define __gettextparse PLURAL_PARSE
#endif #endif
#define YYLEX_PARAM &((struct parse_args *) arg)->cp
#define YYPARSE_PARAM arg
%} %}
%pure_parser %parse-param {struct parse_args *arg}
%lex-param {struct parse_args *arg}
%define api.pure full
%expect 7 %expect 7
%union { %union {
@ -56,8 +54,8 @@
%{ %{
/* Prototypes for local functions. */ /* Prototypes for local functions. */
static int yylex (YYSTYPE *lval, const char **pexp); static int yylex (YYSTYPE *lval, struct parse_args *arg);
static void yyerror (const char *str); static void yyerror (struct parse_args *arg, const char *str);
/* Allocation of expressions. */ /* Allocation of expressions. */
@ -155,7 +153,7 @@ start: exp
{ {
if ($1 == NULL) if ($1 == NULL)
YYABORT; YYABORT;
((struct parse_args *) arg)->res = $1; arg->res = $1;
} }
; ;
@ -236,16 +234,16 @@ FREE_EXPRESSION (struct expression *exp)
static int static int
yylex (YYSTYPE *lval, const char **pexp) yylex (YYSTYPE *lval, struct parse_args *arg)
{ {
const char *exp = *pexp; const char *exp = arg->cp;
int result; int result;
while (1) while (1)
{ {
if (exp[0] == '\0') if (exp[0] == '\0')
{ {
*pexp = exp; arg->cp = exp;
return YYEOF; return YYEOF;
} }
@ -372,14 +370,14 @@ yylex (YYSTYPE *lval, const char **pexp)
break; break;
} }
*pexp = exp; arg->cp = exp;
return result; return result;
} }
static void static void
yyerror (const char *str) yyerror (struct parse_args *arg, const char *str)
{ {
/* Do nothing. We don't print error messages here. */ /* Do nothing. We don't print error messages here. */
} }

View File

@ -1,20 +1,18 @@
/* Decomposed printf argument list. /* Decomposed printf argument list.
Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc. Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* This file can be parametrized with the following macros: /* This file can be parametrized with the following macros:
ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.

View File

@ -1,20 +1,18 @@
/* Decomposed printf argument list. /* Decomposed printf argument list.
Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc. Copyright (C) 1999, 2002-2003, 2006-2007, 2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _PRINTF_ARGS_H #ifndef _PRINTF_ARGS_H
#define _PRINTF_ARGS_H #define _PRINTF_ARGS_H
@ -136,10 +134,14 @@ typedef struct
} }
argument; argument;
/* Number of directly allocated arguments (no malloc() needed). */
#define N_DIRECT_ALLOC_ARGUMENTS 7
typedef struct typedef struct
{ {
size_t count; size_t count;
argument *arg; argument *arg;
argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
} }
arguments; arguments;

View File

@ -1,20 +1,18 @@
/* Formatted output to strings. /* Formatted output to strings.
Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc. Copyright (C) 1999-2000, 2002-2003, 2006-2008, 2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* This file can be parametrized with the following macros: /* This file can be parametrized with the following macros:
CHAR_T The element type of the format string. CHAR_T The element type of the format string.
@ -64,6 +62,9 @@
/* malloc(), realloc(), free(). */ /* malloc(), realloc(), free(). */
#include <stdlib.h> #include <stdlib.h>
/* memcpy(). */
#include <string.h>
/* errno. */ /* errno. */
#include <errno.h> #include <errno.h>
@ -89,15 +90,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
size_t max_precision_length = 0; size_t max_precision_length = 0;
d->count = 0; d->count = 0;
d_allocated = 1; d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE)); d->dir = d->direct_alloc_dir;
if (d->dir == NULL)
/* Out of memory. */
goto out_of_memory_1;
a->count = 0; a->count = 0;
a_allocated = 0; a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
a->arg = NULL; a->arg = a->direct_alloc_arg;
#define REGISTER_ARG(_index_,_type_) \ #define REGISTER_ARG(_index_,_type_) \
{ \ { \
@ -114,12 +112,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
if (size_overflow_p (memory_size)) \ if (size_overflow_p (memory_size)) \
/* Overflow, would lead to out of memory. */ \ /* Overflow, would lead to out of memory. */ \
goto out_of_memory; \ goto out_of_memory; \
memory = (argument *) (a->arg \ memory = (argument *) (a->arg != a->direct_alloc_arg \
? realloc (a->arg, memory_size) \ ? realloc (a->arg, memory_size) \
: malloc (memory_size)); \ : malloc (memory_size)); \
if (memory == NULL) \ if (memory == NULL) \
/* Out of memory. */ \ /* Out of memory. */ \
goto out_of_memory; \ goto out_of_memory; \
if (a->arg == a->direct_alloc_arg) \
memcpy (memory, a->arg, a->count * sizeof (argument)); \
a->arg = memory; \ a->arg = memory; \
} \ } \
while (a->count <= n) \ while (a->count <= n) \
@ -207,6 +207,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
dp->flags |= FLAG_ZERO; dp->flags |= FLAG_ZERO;
cp++; cp++;
} }
#if __GLIBC__ >= 2 && !defined __UCLIBC__
else if (*cp == 'I')
{
dp->flags |= FLAG_LOCALIZED;
cp++;
}
#endif
else else
break; break;
} }
@ -582,10 +589,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
if (size_overflow_p (memory_size)) if (size_overflow_p (memory_size))
/* Overflow, would lead to out of memory. */ /* Overflow, would lead to out of memory. */
goto out_of_memory; goto out_of_memory;
memory = (DIRECTIVE *) realloc (d->dir, memory_size); memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
? realloc (d->dir, memory_size)
: malloc (memory_size));
if (memory == NULL) if (memory == NULL)
/* Out of memory. */ /* Out of memory. */
goto out_of_memory; goto out_of_memory;
if (d->dir == d->direct_alloc_dir)
memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
d->dir = memory; d->dir = memory;
} }
} }
@ -604,19 +615,18 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
return 0; return 0;
error: error:
if (a->arg) if (a->arg != a->direct_alloc_arg)
free (a->arg); free (a->arg);
if (d->dir) if (d->dir != d->direct_alloc_dir)
free (d->dir); free (d->dir);
errno = EINVAL; errno = EINVAL;
return -1; return -1;
out_of_memory: out_of_memory:
if (a->arg) if (a->arg != a->direct_alloc_arg)
free (a->arg); free (a->arg);
if (d->dir) if (d->dir != d->direct_alloc_dir)
free (d->dir); free (d->dir);
out_of_memory_1:
errno = ENOMEM; errno = ENOMEM;
return -1; return -1;
} }

View File

@ -1,24 +1,26 @@
/* Parse printf format string. /* Parse printf format string.
Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _PRINTF_PARSE_H #ifndef _PRINTF_PARSE_H
#define _PRINTF_PARSE_H #define _PRINTF_PARSE_H
#if HAVE_FEATURES_H
# include <features.h> /* for __GLIBC__, __UCLIBC__ */
#endif
#include "printf-args.h" #include "printf-args.h"
@ -29,10 +31,16 @@
#define FLAG_SPACE 8 /* space flag */ #define FLAG_SPACE 8 /* space flag */
#define FLAG_ALT 16 /* # flag */ #define FLAG_ALT 16 /* # flag */
#define FLAG_ZERO 32 #define FLAG_ZERO 32
#if __GLIBC__ >= 2 && !defined __UCLIBC__
# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
#endif
/* arg_index value indicating that no argument is consumed. */ /* arg_index value indicating that no argument is consumed. */
#define ARG_NONE (~(size_t)0) #define ARG_NONE (~(size_t)0)
/* Number of directly allocated directives (no malloc() needed). */
#define N_DIRECT_ALLOC_DIRECTIVES 7
/* A parsed directive. */ /* A parsed directive. */
typedef struct typedef struct
{ {
@ -57,6 +65,7 @@ typedef struct
char_directive *dir; char_directive *dir;
size_t max_width_length; size_t max_width_length;
size_t max_precision_length; size_t max_precision_length;
char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
} }
char_directives; char_directives;

View File

@ -1,21 +1,19 @@
/* Formatted output to strings, using POSIX/XSI format strings with positions. /* Formatted output to strings, using POSIX/XSI format strings with positions.
Copyright (C) 2003, 2006-2007, 2009 Free Software Foundation, Inc. Copyright (C) 2003, 2006-2007, 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
@ -70,7 +68,7 @@ char *alloca ();
#define STATIC static #define STATIC static
/* This needs to be consistent with libgnuintl.h.in. */ /* This needs to be consistent with libgnuintl.in.h. */
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__ #if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
/* Don't break __attribute__((format(printf,M,N))). /* Don't break __attribute__((format(printf,M,N))).
This redefinition is only possible because the libc in NetBSD, Cygwin, This redefinition is only possible because the libc in NetBSD, Cygwin,
@ -193,8 +191,13 @@ libintl_sprintf (char *resultbuf, const char *format, ...)
#if HAVE_SNPRINTF #if HAVE_SNPRINTF
# if HAVE_DECL__SNPRINTF # if HAVE_DECL__SNPRINTF
/* Windows. */ /* Windows. The mingw function vsnprintf() has fewer bugs than the MSVCRT
function _vsnprintf(), so prefer that. */
# if defined __MINGW32__
# define system_vsnprintf vsnprintf
# else
# define system_vsnprintf _vsnprintf # define system_vsnprintf _vsnprintf
# endif
# else # else
/* Unix. */ /* Unix. */
# define system_vsnprintf vsnprintf # define system_vsnprintf vsnprintf
@ -210,6 +213,8 @@ libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list a
{ {
size_t maxlength = length; size_t maxlength = length;
char *result = libintl_vasnprintf (resultbuf, &length, format, args); char *result = libintl_vasnprintf (resultbuf, &length, format, args);
if (result == NULL)
return -1;
if (result != resultbuf) if (result != resultbuf)
{ {
if (maxlength > 0) if (maxlength > 0)
@ -304,7 +309,8 @@ libintl_asprintf (char **resultp, const char *format, ...)
#endif #endif
# if HAVE_DECL__SNWPRINTF # if HAVE_DECL__SNWPRINTF
/* Windows. */ /* Windows. The function vswprintf() has a different signature than
on Unix; we use the function _vsnwprintf() instead. */
# define system_vswprintf _vsnwprintf # define system_vswprintf _vsnwprintf
# else # else
/* Unix. */ /* Unix. */
@ -384,6 +390,8 @@ libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_
{ {
size_t maxlength = length; size_t maxlength = length;
wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args); wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
if (result == NULL)
return -1;
if (result != resultbuf) if (result != resultbuf)
{ {
if (maxlength > 0) if (maxlength > 0)

View File

@ -2,20 +2,18 @@
# #
# Copyright (C) 2000 Free Software Foundation, Inc. # Copyright (C) 2000 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify
# under the terms of the GNU Library General Public License as published # it under the terms of the GNU Lesser General Public License as published by
# by the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2.1 of the License, or
# any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Library General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Library General Public # You should have received a copy of the GNU Lesser General Public License
# License along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# #
# Written by Bruno Haible <haible@clisp.cons.org>. # Written by Bruno Haible <haible@clisp.cons.org>.
# #

View File

@ -2,20 +2,18 @@
# #
# Copyright (C) 2000 Free Software Foundation, Inc. # Copyright (C) 2000 Free Software Foundation, Inc.
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software: you can redistribute it and/or modify
# under the terms of the GNU Library General Public License as published # it under the terms of the GNU Lesser General Public License as published by
# by the Free Software Foundation; either version 2, or (at your option) # the Free Software Foundation; either version 2.1 of the License, or
# any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Library General Public License for more details. # GNU Lesser General Public License for more details.
# #
# You should have received a copy of the GNU Library General Public # You should have received a copy of the GNU Lesser General Public License
# License along with this program; if not, write to the Free Software # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# #
# Written by Bruno Haible <haible@clisp.cons.org>. # Written by Bruno Haible <haible@clisp.cons.org>.
# #

View File

@ -1,21 +1,19 @@
/* Provide relocatable packages. /* Provide relocatable packages.
Copyright (C) 2003-2006, 2008-2009 Free Software Foundation, Inc. Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tell glibc's <stdio.h> to provide a prototype for getline(). /* Tell glibc's <stdio.h> to provide a prototype for getline().
@ -25,6 +23,7 @@
# define _GNU_SOURCE 1 # define _GNU_SOURCE 1
#endif #endif
#define _GL_USE_STDLIB_ALLOC 1
#include <config.h> #include <config.h>
/* Specification. */ /* Specification. */
@ -43,7 +42,7 @@
# include "xalloc.h" # include "xalloc.h"
#endif #endif
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
#endif #endif
@ -70,8 +69,8 @@
ISSLASH(C) tests whether C is a directory separator character. ISSLASH(C) tests whether C is a directory separator character.
IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
*/ */
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ #if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
/* Win32, Cygwin, OS/2, DOS */ /* Native Windows, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\') # define ISSLASH(C) ((C) == '/' || (C) == '\\')
# define HAS_DEVICE(P) \ # define HAS_DEVICE(P) \
((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
@ -86,6 +85,19 @@
# define FILE_SYSTEM_PREFIX_LEN(P) 0 # define FILE_SYSTEM_PREFIX_LEN(P) 0
#endif #endif
/* Whether to enable the more costly support for relocatable libraries.
It allows libraries to be have been installed with a different original
prefix than the program. But it is quite costly, especially on Cygwin
platforms, see below. Therefore we enable it by default only on native
Windows platforms. */
#ifndef ENABLE_COSTLY_RELOCATABLE
# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
# define ENABLE_COSTLY_RELOCATABLE 1
# else
# define ENABLE_COSTLY_RELOCATABLE 0
# endif
#endif
/* Original installation prefix. */ /* Original installation prefix. */
static char *orig_prefix; static char *orig_prefix;
static size_t orig_prefix_len; static size_t orig_prefix_len;
@ -155,7 +167,7 @@ set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
#endif #endif
} }
#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR) #if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
/* Convenience function: /* Convenience function:
Computes the current installation prefix, based on the original Computes the current installation prefix, based on the original
@ -237,7 +249,7 @@ compute_curr_prefix (const char *orig_installprefix,
often case-insensitive. It's better to accept the comparison often case-insensitive. It's better to accept the comparison
if the difference is only in case, rather than to fail. */ if the difference is only in case, rather than to fail. */
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Win32, Cygwin, OS/2, DOS - case insignificant file system */ /* Native Windows, Cygwin, OS/2, DOS - case insignificant file system */
if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
!= (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
break; break;
@ -285,12 +297,17 @@ compute_curr_prefix (const char *orig_installprefix,
#endif /* !IN_LIBRARY || PIC */ #endif /* !IN_LIBRARY || PIC */
#if defined PIC && defined INSTALLDIR #if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
/* Full pathname of shared library, or NULL. */ /* Full pathname of shared library, or NULL. */
static char *shared_library_fullname; static char *shared_library_fullname;
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
/* Native Windows only.
On Cygwin, it is better to use the Cygwin provided /proc interface, than
to use native Windows API and cygwin_conv_to_posix_path, because it
supports longer file names
(see <http://cygwin.com/ml/cygwin/2011-01/msg00410.html>). */
/* Determine the full pathname of the shared library when it is loaded. */ /* Determine the full pathname of the shared library when it is loaded. */
@ -312,37 +329,23 @@ DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
/* Shouldn't happen. */ /* Shouldn't happen. */
return FALSE; return FALSE;
{
#if defined __CYGWIN__
/* On Cygwin, we need to convert paths coming from Win32 system calls
to the Unix-like slashified notation. */
static char location_as_posix_path[2 * MAX_PATH];
/* There's no error return defined for cygwin_conv_to_posix_path.
See cygwin-api/func-cygwin-conv-to-posix-path.html.
Does it overflow the buffer of expected size MAX_PATH or does it
truncate the path? I don't know. Let's catch both. */
cygwin_conv_to_posix_path (location, location_as_posix_path);
location_as_posix_path[MAX_PATH - 1] = '\0';
if (strlen (location_as_posix_path) >= MAX_PATH - 1)
/* A sign of buffer overflow or path truncation. */
return FALSE;
shared_library_fullname = strdup (location_as_posix_path);
#else
shared_library_fullname = strdup (location); shared_library_fullname = strdup (location);
#endif
}
} }
return TRUE; return TRUE;
} }
#else /* Unix except Cygwin */ #else /* Unix */
static void static void
find_shared_library_fullname () find_shared_library_fullname ()
{ {
#if defined __linux__ && __GLIBC__ >= 2 #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
/* Linux has /proc/self/maps. glibc 2 has the getline() function. */ /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
function.
Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
Cygwin 1.7. */
FILE *fp; FILE *fp;
/* Open the current process' maps file. It describes one VMA per line. */ /* Open the current process' maps file. It describes one VMA per line. */
@ -387,15 +390,15 @@ find_shared_library_fullname ()
#endif #endif
} }
#endif /* (WIN32 or Cygwin) / (Unix except Cygwin) */ #endif /* Native Windows / Unix */
/* Return the full pathname of the current shared library. /* Return the full pathname of the current shared library.
Return NULL if unknown. Return NULL if unknown.
Guaranteed to work only on Linux, Cygwin and Woe32. */ Guaranteed to work only on Linux, Cygwin, and native Windows. */
static char * static char *
get_shared_library_fullname () get_shared_library_fullname ()
{ {
#if !(defined _WIN32 || defined __WIN32__ || defined __CYGWIN__) #if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
static bool tried_find_shared_library_fullname; static bool tried_find_shared_library_fullname;
if (!tried_find_shared_library_fullname) if (!tried_find_shared_library_fullname)
{ {
@ -415,7 +418,7 @@ get_shared_library_fullname ()
const char * const char *
relocate (const char *pathname) relocate (const char *pathname)
{ {
#if defined PIC && defined INSTALLDIR #if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
static int initialized; static int initialized;
/* Initialization code for a shared library. */ /* Initialization code for a shared library. */

View File

@ -2,20 +2,18 @@
Copyright (C) 2003, 2005, 2008 Free Software Foundation, Inc. Copyright (C) 2003, 2005, 2008 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003. Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _RELOCATABLE_H #ifndef _RELOCATABLE_H
#define _RELOCATABLE_H #define _RELOCATABLE_H

View File

@ -2,20 +2,18 @@
Copyright (C) 2009 Free Software Foundation, Inc. Copyright (C) 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009. Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
@ -856,6 +854,14 @@ libintl_setlocale (int category, const char *locale)
if (setlocale_unixlike (LC_ALL, base_name) == NULL) if (setlocale_unixlike (LC_ALL, base_name) == NULL)
goto fail; goto fail;
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* On native Windows, setlocale(LC_ALL,...) may succeed but set the
LC_CTYPE category to an invalid value ("C") when it does not
support the specified encoding. Report a failure instead. */
if (strchr (base_name, '.') != NULL
&& strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
goto fail;
# endif
for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++) for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
{ {
@ -878,6 +884,7 @@ libintl_setlocale (int category, const char *locale)
} }
/* All steps were successful. */ /* All steps were successful. */
++_nl_msg_cat_cntr;
free (saved_locale); free (saved_locale);
return setlocale (LC_ALL, NULL); return setlocale (LC_ALL, NULL);
@ -889,16 +896,64 @@ libintl_setlocale (int category, const char *locale)
} }
else else
{ {
char *result;
const char *name = const char *name =
gl_locale_name_environ (category, category_to_name (category)); gl_locale_name_environ (category, category_to_name (category));
if (name == NULL) if (name == NULL)
name = gl_locale_name_default (); name = gl_locale_name_default ();
return setlocale_single (category, name); result = setlocale_single (category, name);
if (result != NULL)
++_nl_msg_cat_cntr;
return result;
} }
} }
else else
return setlocale_single (category, locale); {
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL)
{
char *saved_locale;
/* Back up the old locale. */
saved_locale = setlocale (LC_ALL, NULL);
if (saved_locale == NULL)
return NULL;
saved_locale = strdup (saved_locale);
if (saved_locale == NULL)
return NULL;
if (setlocale_unixlike (LC_ALL, locale) == NULL)
{
free (saved_locale);
return NULL;
}
/* On native Windows, setlocale(LC_ALL,...) may succeed but set the
LC_CTYPE category to an invalid value ("C") when it does not
support the specified encoding. Report a failure instead. */
if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
{
if (saved_locale[0] != '\0') /* don't risk an endless recursion */
setlocale (LC_ALL, saved_locale);
free (saved_locale);
return NULL;
}
/* It was really successful. */
++_nl_msg_cat_cntr;
free (saved_locale);
return setlocale (LC_ALL, NULL);
}
else
# endif
{
char *result = setlocale_single (category, locale);
if (result != NULL)
++_nl_msg_cat_cntr;
return result;
}
}
} }
# if HAVE_NEWLOCALE # if HAVE_NEWLOCALE

View File

@ -1,20 +1,18 @@
/* Implementation of the textdomain(3) function. /* Implementation of the textdomain(3) function.
Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc. Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,20 +1,18 @@
/* Multithreading primitives. /* Multithreading primitives.
Copyright (C) 2005-2009 Free Software Foundation, Inc. Copyright (C) 2005-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005. */ /* Written by Bruno Haible <bruno@clisp.org>, 2005. */

View File

@ -4,20 +4,18 @@
NOTE: The canonical source of this file is maintained with the GNU C NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@gnu.org. Library. Bugs can be reported to bug-glibc@gnu.org.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Tree search for red/black trees. /* Tree search for red/black trees.
The algorithm for adding nodes is taken from one of the many "Algorithms" The algorithm for adding nodes is taken from one of the many "Algorithms"

View File

@ -1,20 +1,18 @@
/* Binary tree data structure. /* Binary tree data structure.
Copyright (C) 2006 Free Software Foundation, Inc. Copyright (C) 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _TSEARCH_H #ifndef _TSEARCH_H
#define _TSEARCH_H #define _TSEARCH_H

View File

@ -1,20 +1,18 @@
/* vsprintf with automatic memory allocation. /* vsprintf with automatic memory allocation.
Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc. Copyright (C) 1999, 2002-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* This file can be parametrized with the following macros: /* This file can be parametrized with the following macros:
VASNPRINTF The name of the function being defined. VASNPRINTF The name of the function being defined.
@ -89,6 +87,8 @@
/* Checked size_t computations. */ /* Checked size_t computations. */
#include "xsize.h" #include "xsize.h"
#include "verify.h"
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
# include <math.h> # include <math.h>
# include "float+.h" # include "float+.h"
@ -275,10 +275,10 @@ decimal_point_char (void)
{ {
const char *point; const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is /* Determine it in a multithread-safe way. We know nl_langinfo is
multithread-safe on glibc systems and MacOS X systems, but is not required multithread-safe on glibc systems and Mac OS X systems, but is not required
to be multithread-safe by POSIX. sprintf(), however, is multithread-safe. to be multithread-safe by POSIX. sprintf(), however, is multithread-safe.
localeconv() is rarely multithread-safe. */ localeconv() is rarely multithread-safe. */
# if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__)) # if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
point = nl_langinfo (RADIXCHAR); point = nl_langinfo (RADIXCHAR);
# elif 1 # elif 1
char pointbuf[5]; char pointbuf[5];
@ -323,11 +323,11 @@ is_infinite_or_zerol (long double x)
typedef unsigned int mp_limb_t; typedef unsigned int mp_limb_t;
# define GMP_LIMB_BITS 32 # define GMP_LIMB_BITS 32
typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1]; verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
typedef unsigned long long mp_twolimb_t; typedef unsigned long long mp_twolimb_t;
# define GMP_TWOLIMB_BITS 64 # define GMP_TWOLIMB_BITS 64
typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1]; verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
/* Representation of a bignum >= 0. */ /* Representation of a bignum >= 0. */
typedef struct typedef struct
@ -552,6 +552,33 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
size_t s; size_t s;
{ {
mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
/* Determine s = GMP_LIMB_BITS - integer_length (msd).
Code copied from gnulib's integer_length.c. */
# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
s = __builtin_clz (msd);
# else
# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
if (GMP_LIMB_BITS <= DBL_MANT_BIT)
{
/* Use 'double' operations.
Assumes an IEEE 754 'double' implementation. */
# define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
# define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1)
# define NWORDS \
((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
union { double value; unsigned int word[NWORDS]; } m;
/* Use a single integer to floating-point conversion. */
m.value = msd;
s = GMP_LIMB_BITS
- (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK)
- DBL_EXP_BIAS);
}
else
# undef NWORDS
# endif
{
s = 31; s = 31;
if (msd >= 0x10000) if (msd >= 0x10000)
{ {
@ -579,6 +606,8 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
s -= 1; s -= 1;
} }
} }
# endif
}
/* 0 <= s < GMP_LIMB_BITS. /* 0 <= s < GMP_LIMB_BITS.
Copy b, shifting it left by s bits. */ Copy b, shifting it left by s bits. */
if (s > 0) if (s > 0)
@ -884,9 +913,9 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
y = frexpl (x, &exp); y = frexpl (x, &exp);
if (!(y >= 0.0L && y < 1.0L)) if (!(y >= 0.0L && y < 1.0L))
abort (); abort ();
/* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
latter is an integer. */ latter is an integer. */
/* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs. /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs.
I'm not sure whether it's safe to cast a 'long double' value between I'm not sure whether it's safe to cast a 'long double' value between
2^31 and 2^32 to 'unsigned int', therefore play safe and cast only 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
'long double' values between 0 and 2^16 (to 'unsigned int' or 'int', 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
@ -934,11 +963,11 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
abort (); abort ();
m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
} }
#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess # if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
precision. */ precision. */
if (!(y == 0.0L)) if (!(y == 0.0L))
abort (); abort ();
#endif # endif
/* Normalise. */ /* Normalise. */
while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
m.nlimbs--; m.nlimbs--;
@ -972,9 +1001,9 @@ decode_double (double x, int *ep, mpn_t *mp)
y = frexp (x, &exp); y = frexp (x, &exp);
if (!(y >= 0.0 && y < 1.0)) if (!(y >= 0.0 && y < 1.0))
abort (); abort ();
/* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the
latter is an integer. */ latter is an integer. */
/* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs. /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs.
I'm not sure whether it's safe to cast a 'double' value between I'm not sure whether it's safe to cast a 'double' value between
2^31 and 2^32 to 'unsigned int', therefore play safe and cast only 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
'double' values between 0 and 2^16 (to 'unsigned int' or 'int', 'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
@ -1501,7 +1530,7 @@ is_borderline (const char *digits, size_t precision)
/* Returns the number of TCHAR_T units needed as temporary space for the result /* Returns the number of TCHAR_T units needed as temporary space for the result
of sprintf or SNPRINTF of a single conversion directive. */ of sprintf or SNPRINTF of a single conversion directive. */
static inline size_t static size_t
MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion, MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
arg_type type, int flags, size_t width, int has_precision, arg_type type, int flags, size_t width, int has_precision,
size_t precision, int pad_ourselves) size_t precision, int pad_ourselves)
@ -1752,8 +1781,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
return NULL; return NULL;
#define CLEANUP() \ #define CLEANUP() \
if (d.dir != d.direct_alloc_dir) \
free (d.dir); \ free (d.dir); \
if (a.arg) \ if (a.arg != a.direct_alloc_arg) \
free (a.arg); free (a.arg);
if (PRINTF_FETCHARGS (args, &a) < 0) if (PRINTF_FETCHARGS (args, &a) < 0)
@ -1927,15 +1957,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
abort (); abort ();
arg = a.arg[dp->width_arg_index].a.a_int; arg = a.arg[dp->width_arg_index].a.a_int;
width = arg;
if (arg < 0) if (arg < 0)
{ {
/* "A negative field width is taken as a '-' flag /* "A negative field width is taken as a '-' flag
followed by a positive field width." */ followed by a positive field width." */
flags |= FLAG_LEFT; flags |= FLAG_LEFT;
width = (unsigned int) (-arg); width = -width;
} }
else
width = arg;
} }
else else
{ {
@ -2043,8 +2072,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0; characters = 0;
} }
if (has_width && width > characters if (characters < width && !(dp->flags & FLAG_LEFT))
&& !(dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2097,8 +2125,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
} }
# endif # endif
if (has_width && width > characters if (characters < width && (dp->flags & FLAG_LEFT))
&& (dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2171,8 +2198,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0; characters = 0;
} }
if (has_width && width > characters if (characters < width && !(dp->flags & FLAG_LEFT))
&& !(dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2225,8 +2251,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
} }
# endif # endif
if (has_width && width > characters if (characters < width && (dp->flags & FLAG_LEFT))
&& (dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2299,8 +2324,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0; characters = 0;
} }
if (has_width && width > characters if (characters < width && !(dp->flags & FLAG_LEFT))
&& !(dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2353,8 +2377,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
} }
# endif # endif
if (has_width && width > characters if (characters < width && (dp->flags & FLAG_LEFT))
&& (dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2405,15 +2428,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
abort (); abort ();
arg = a.arg[dp->width_arg_index].a.a_int; arg = a.arg[dp->width_arg_index].a.a_int;
width = arg;
if (arg < 0) if (arg < 0)
{ {
/* "A negative field width is taken as a '-' flag /* "A negative field width is taken as a '-' flag
followed by a positive field width." */ followed by a positive field width." */
flags |= FLAG_LEFT; flags |= FLAG_LEFT;
width = (unsigned int) (-arg); width = -width;
} }
else
width = arg;
} }
else else
{ {
@ -2543,8 +2565,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
characters = 0; characters = 0;
} }
if (has_width && width > characters if (characters < width && !(dp->flags & FLAG_LEFT))
&& !(dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2605,8 +2626,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
} }
} }
if (has_width && width > characters if (characters < width && (dp->flags & FLAG_LEFT))
&& (dp->flags & FLAG_LEFT))
{ {
size_t n = width - characters; size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2622,7 +2642,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t characters; size_t characters;
# if !DCHAR_IS_TCHAR # if !DCHAR_IS_TCHAR
/* This code assumes that TCHAR_T is 'char'. */ /* This code assumes that TCHAR_T is 'char'. */
typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1]; verify (sizeof (TCHAR_T) == 1);
TCHAR_T *tmpsrc; TCHAR_T *tmpsrc;
DCHAR_T *tmpdst; DCHAR_T *tmpdst;
size_t tmpdst_len; size_t tmpdst_len;
@ -2783,7 +2803,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (has_width) if (has_width)
{ {
# if ENABLE_UNISTDIO # if ENABLE_UNISTDIO
/* Outside POSIX, it's preferrable to compare the width /* Outside POSIX, it's preferable to compare the width
against the number of _characters_ of the converted against the number of _characters_ of the converted
value. */ value. */
w = DCHAR_MBSNLEN (result + length, characters); w = DCHAR_MBSNLEN (result + length, characters);
@ -2797,8 +2817,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* w doesn't matter. */ /* w doesn't matter. */
w = 0; w = 0;
if (has_width && width > w if (w < width && !(dp->flags & FLAG_LEFT))
&& !(dp->flags & FLAG_LEFT))
{ {
size_t n = width - w; size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2881,8 +2900,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += tmpdst_len; length += tmpdst_len;
# endif # endif
if (has_width && width > w if (w < width && (dp->flags & FLAG_LEFT))
&& (dp->flags & FLAG_LEFT))
{ {
size_t n = width - w; size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n)); ENSURE_ALLOCATION (xsum (length, n));
@ -2909,17 +2927,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{ {
arg_type type = a.arg[dp->arg_index].type; arg_type type = a.arg[dp->arg_index].type;
int flags = dp->flags; int flags = dp->flags;
int has_width;
size_t width; size_t width;
int has_precision; int has_precision;
size_t precision; size_t precision;
size_t tmp_length; size_t tmp_length;
size_t count;
DCHAR_T tmpbuf[700]; DCHAR_T tmpbuf[700];
DCHAR_T *tmp; DCHAR_T *tmp;
DCHAR_T *pad_ptr; DCHAR_T *pad_ptr;
DCHAR_T *p; DCHAR_T *p;
has_width = 0;
width = 0; width = 0;
if (dp->width_start != dp->width_end) if (dp->width_start != dp->width_end)
{ {
@ -2930,15 +2947,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
abort (); abort ();
arg = a.arg[dp->width_arg_index].a.a_int; arg = a.arg[dp->width_arg_index].a.a_int;
width = arg;
if (arg < 0) if (arg < 0)
{ {
/* "A negative field width is taken as a '-' flag /* "A negative field width is taken as a '-' flag
followed by a positive field width." */ followed by a positive field width." */
flags |= FLAG_LEFT; flags |= FLAG_LEFT;
width = (unsigned int) (-arg); width = -width;
} }
else
width = arg;
} }
else else
{ {
@ -2948,7 +2964,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0'); width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end); while (digitp != dp->width_end);
} }
has_width = 1;
} }
has_precision = 0; has_precision = 0;
@ -3324,11 +3339,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
abort (); abort ();
# endif # endif
} }
/* The generated string now extends from tmp to p, with the /* The generated string now extends from tmp to p, with the
zero padding insertion point being at pad_ptr. */ zero padding insertion point being at pad_ptr. */
if (has_width && p - tmp < width) count = p - tmp;
if (count < width)
{ {
size_t pad = width - (p - tmp); size_t pad = width - count;
DCHAR_T *end = p + pad; DCHAR_T *end = p + pad;
if (flags & FLAG_LEFT) if (flags & FLAG_LEFT)
@ -3361,8 +3379,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
p = end; p = end;
} }
{ count = p - tmp;
size_t count = p - tmp;
if (count >= tmp_length) if (count >= tmp_length)
/* tmp_length was incorrectly calculated - fix the /* tmp_length was incorrectly calculated - fix the
@ -3383,7 +3400,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
free (tmp); free (tmp);
length += count; length += count;
} }
}
#endif #endif
#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL #if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
else if ((dp->conversion == 'f' || dp->conversion == 'F' else if ((dp->conversion == 'f' || dp->conversion == 'F'
@ -3416,8 +3432,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
arg_type type = a.arg[dp->arg_index].type; arg_type type = a.arg[dp->arg_index].type;
# endif # endif
int flags = dp->flags; int flags = dp->flags;
int has_width;
size_t width; size_t width;
size_t count;
int has_precision; int has_precision;
size_t precision; size_t precision;
size_t tmp_length; size_t tmp_length;
@ -3426,7 +3442,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
DCHAR_T *pad_ptr; DCHAR_T *pad_ptr;
DCHAR_T *p; DCHAR_T *p;
has_width = 0;
width = 0; width = 0;
if (dp->width_start != dp->width_end) if (dp->width_start != dp->width_end)
{ {
@ -3437,15 +3452,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
abort (); abort ();
arg = a.arg[dp->width_arg_index].a.a_int; arg = a.arg[dp->width_arg_index].a.a_int;
width = arg;
if (arg < 0) if (arg < 0)
{ {
/* "A negative field width is taken as a '-' flag /* "A negative field width is taken as a '-' flag
followed by a positive field width." */ followed by a positive field width." */
flags |= FLAG_LEFT; flags |= FLAG_LEFT;
width = (unsigned int) (-arg); width = -width;
} }
else
width = arg;
} }
else else
{ {
@ -3455,7 +3469,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0'); width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end); while (digitp != dp->width_end);
} }
has_width = 1;
} }
has_precision = 0; has_precision = 0;
@ -3895,9 +3908,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
digits without trailing zeroes. */ digits without trailing zeroes. */
if (exponent >= 0) if (exponent >= 0)
{ {
size_t count = exponent + 1; size_t ecount = exponent + 1;
/* Note: count <= precision = ndigits. */ /* Note: count <= precision = ndigits. */
for (; count > 0; count--) for (; ecount > 0; ecount--)
*p++ = digits[--ndigits]; *p++ = digits[--ndigits];
if ((flags & FLAG_ALT) || ndigits > nzeroes) if ((flags & FLAG_ALT) || ndigits > nzeroes)
{ {
@ -3911,10 +3924,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
} }
else else
{ {
size_t count = -exponent - 1; size_t ecount = -exponent - 1;
*p++ = '0'; *p++ = '0';
*p++ = decimal_point_char (); *p++ = decimal_point_char ();
for (; count > 0; count--) for (; ecount > 0; ecount--)
*p++ = '0'; *p++ = '0';
while (ndigits > nzeroes) while (ndigits > nzeroes)
{ {
@ -4365,9 +4378,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
digits without trailing zeroes. */ digits without trailing zeroes. */
if (exponent >= 0) if (exponent >= 0)
{ {
size_t count = exponent + 1; size_t ecount = exponent + 1;
/* Note: count <= precision = ndigits. */ /* Note: ecount <= precision = ndigits. */
for (; count > 0; count--) for (; ecount > 0; ecount--)
*p++ = digits[--ndigits]; *p++ = digits[--ndigits];
if ((flags & FLAG_ALT) || ndigits > nzeroes) if ((flags & FLAG_ALT) || ndigits > nzeroes)
{ {
@ -4381,10 +4394,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
} }
else else
{ {
size_t count = -exponent - 1; size_t ecount = -exponent - 1;
*p++ = '0'; *p++ = '0';
*p++ = decimal_point_char (); *p++ = decimal_point_char ();
for (; count > 0; count--) for (; ecount > 0; ecount--)
*p++ = '0'; *p++ = '0';
while (ndigits > nzeroes) while (ndigits > nzeroes)
{ {
@ -4512,9 +4525,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* The generated string now extends from tmp to p, with the /* The generated string now extends from tmp to p, with the
zero padding insertion point being at pad_ptr. */ zero padding insertion point being at pad_ptr. */
if (has_width && p - tmp < width) count = p - tmp;
if (count < width)
{ {
size_t pad = width - (p - tmp); size_t pad = width - count;
DCHAR_T *end = p + pad; DCHAR_T *end = p + pad;
if (flags & FLAG_LEFT) if (flags & FLAG_LEFT)
@ -4547,8 +4562,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
p = end; p = end;
} }
{ count = p - tmp;
size_t count = p - tmp;
if (count >= tmp_length) if (count >= tmp_length)
/* tmp_length was incorrectly calculated - fix the /* tmp_length was incorrectly calculated - fix the
@ -4569,14 +4583,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
free (tmp); free (tmp);
length += count; length += count;
} }
}
#endif #endif
else else
{ {
arg_type type = a.arg[dp->arg_index].type; arg_type type = a.arg[dp->arg_index].type;
int flags = dp->flags; int flags = dp->flags;
#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int has_width; int has_width;
#endif
#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
size_t width; size_t width;
#endif #endif
#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION #if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
@ -4598,14 +4613,17 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
TCHAR_T *fbp; TCHAR_T *fbp;
unsigned int prefix_count; unsigned int prefix_count;
int prefixes[2] IF_LINT (= { 0 }); int prefixes[2] IF_LINT (= { 0 });
int orig_errno;
#if !USE_SNPRINTF #if !USE_SNPRINTF
size_t tmp_length; size_t tmp_length;
TCHAR_T tmpbuf[700]; TCHAR_T tmpbuf[700];
TCHAR_T *tmp; TCHAR_T *tmp;
#endif #endif
#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 0; has_width = 0;
#endif
#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
width = 0; width = 0;
if (dp->width_start != dp->width_end) if (dp->width_start != dp->width_end)
{ {
@ -4616,15 +4634,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
abort (); abort ();
arg = a.arg[dp->width_arg_index].a.a_int; arg = a.arg[dp->width_arg_index].a.a_int;
width = arg;
if (arg < 0) if (arg < 0)
{ {
/* "A negative field width is taken as a '-' flag /* "A negative field width is taken as a '-' flag
followed by a positive field width." */ followed by a positive field width." */
flags |= FLAG_LEFT; flags |= FLAG_LEFT;
width = (unsigned int) (-arg); width = -width;
} }
else
width = arg;
} }
else else
{ {
@ -4634,7 +4651,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
width = xsum (xtimes (width, 10), *digitp++ - '0'); width = xsum (xtimes (width, 10), *digitp++ - '0');
while (digitp != dp->width_end); while (digitp != dp->width_end);
} }
#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 1; has_width = 1;
#endif
} }
#endif #endif
@ -4752,6 +4771,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
*fbp++ = ' '; *fbp++ = ' ';
if (flags & FLAG_ALT) if (flags & FLAG_ALT)
*fbp++ = '#'; *fbp++ = '#';
#if __GLIBC__ >= 2 && !defined __UCLIBC__
if (flags & FLAG_LOCALIZED)
*fbp++ = 'I';
#endif
if (!pad_ourselves) if (!pad_ourselves)
{ {
if (flags & FLAG_ZERO) if (flags & FLAG_ZERO)
@ -4835,20 +4858,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif #endif
*fbp = dp->conversion; *fbp = dp->conversion;
#if USE_SNPRINTF #if USE_SNPRINTF
# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) # if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
fbp[1] = '%'; fbp[1] = '%';
fbp[2] = 'n'; fbp[2] = 'n';
fbp[3] = '\0'; fbp[3] = '\0';
# else # else
/* On glibc2 systems from glibc >= 2.3 - probably also older /* On glibc2 systems from glibc >= 2.3 - probably also older
ones - we know that snprintf's returns value conforms to ones - we know that snprintf's return value conforms to
ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes. ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
gl_SNPRINTF_TRUNCATION_C99 pass.
Therefore we can avoid using %n in this situation. Therefore we can avoid using %n in this situation.
On glibc2 systems from 2004-10-18 or newer, the use of %n On glibc2 systems from 2004-10-18 or newer, the use of %n
in format strings in writable memory may crash the program in format strings in writable memory may crash the program
(if compiled with _FORTIFY_SOURCE=2), so we should avoid it (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
in this situation. */ in this situation. */
/* On native Win32 systems (such as mingw), we can avoid using /* On native Windows systems (such as mingw), we can avoid using
%n because: %n because:
- Although the gl_SNPRINTF_TRUNCATION_C99 test fails, - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
snprintf does not write more than the specified number snprintf does not write more than the specified number
@ -4857,7 +4881,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
- Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
allows us to recognize the case of an insufficient allows us to recognize the case of an insufficient
buffer size: it returns -1 in this case. buffer size: it returns -1 in this case.
On native Win32 systems (such as mingw) where the OS is On native Windows systems (such as mingw) where the OS is
Windows Vista, the use of %n in format strings by default Windows Vista, the use of %n in format strings by default
crashes the program. See crashes the program. See
<http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
@ -4901,6 +4925,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
*(TCHAR_T *) (result + length) = '\0'; *(TCHAR_T *) (result + length) = '\0';
#endif #endif
orig_errno = errno;
for (;;) for (;;)
{ {
int count = -1; int count = -1;
@ -5115,7 +5141,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t tmp_length = size_t tmp_length =
MAX_ROOM_NEEDED (&a, dp->arg_index, MAX_ROOM_NEEDED (&a, dp->arg_index,
dp->conversion, type, flags, dp->conversion, type, flags,
width, has_precision, width,
has_precision,
precision, pad_ourselves); precision, pad_ourselves);
if (maxlen < tmp_length) if (maxlen < tmp_length)
@ -5285,8 +5312,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
DCHAR_T *tmpdst; DCHAR_T *tmpdst;
size_t tmpdst_len; size_t tmpdst_len;
/* This code assumes that TCHAR_T is 'char'. */ /* This code assumes that TCHAR_T is 'char'. */
typedef int TCHAR_T_verify verify (sizeof (TCHAR_T) == 1);
[2 * (sizeof (TCHAR_T) == 1) - 1];
# if USE_SNPRINTF # if USE_SNPRINTF
tmpsrc = (TCHAR_T *) (result + length); tmpsrc = (TCHAR_T *) (result + length);
# else # else
@ -5379,7 +5405,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{ {
size_t w; size_t w;
# if ENABLE_UNISTDIO # if ENABLE_UNISTDIO
/* Outside POSIX, it's preferrable to compare the width /* Outside POSIX, it's preferable to compare the width
against the number of _characters_ of the converted against the number of _characters_ of the converted
value. */ value. */
w = DCHAR_MBSNLEN (result + length, count); w = DCHAR_MBSNLEN (result + length, count);
@ -5499,6 +5525,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += count; length += count;
break; break;
} }
errno = orig_errno;
#undef pad_ourselves #undef pad_ourselves
#undef prec_ourselves #undef prec_ourselves
} }

View File

@ -1,20 +1,18 @@
/* vsprintf with automatic memory allocation. /* vsprintf with automatic memory allocation.
Copyright (C) 2002-2004 Free Software Foundation, Inc. Copyright (C) 2002-2004, 2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _VASNPRINTF_H #ifndef _VASNPRINTF_H
#define _VASNPRINTF_H #define _VASNPRINTF_H
@ -30,7 +28,7 @@
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */ # define __attribute__(Spec) /* empty */
# endif # endif
/* The __-protected variants of `format' and `printf' attributes /* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format # define __format__ format

View File

@ -1,20 +1,18 @@
/* vswprintf with automatic memory allocation. /* vswprintf with automatic memory allocation.
Copyright (C) 2002-2003 Free Software Foundation, Inc. Copyright (C) 2002-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _VASNWPRINTF_H #ifndef _VASNWPRINTF_H
#define _VASNWPRINTF_H #define _VASNWPRINTF_H

279
intl/verify.h Normal file
View File

@ -0,0 +1,279 @@
/* Compile-time assert-like macros.
Copyright (C) 2005-2006, 2009-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
#ifndef _GL_VERIFY_H
#define _GL_VERIFY_H
/* 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 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'
down we could also use it with other compilers, but since this
affects only the quality of diagnostics, why bother? */
#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
&& (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
&& !defined __cplusplus)
# define _GL_HAVE__STATIC_ASSERT 1
#endif
/* The condition (99 < __GNUC__) is temporary, until we know about the
first G++ release that supports static_assert. */
#if (99 < __GNUC__) && defined __cplusplus
# define _GL_HAVE_STATIC_ASSERT 1
#endif
/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
system headers, defines a conflicting _Static_assert that is no
better than ours; override it. */
#ifndef _GL_HAVE_STATIC_ASSERT
# include <stddef.h>
# undef _Static_assert
#endif
/* Each of these macros verifies that its argument R is nonzero. To
be portable, R should be an integer constant expression. Unlike
assert (R), there is no run-time overhead.
If _Static_assert works, verify (R) uses it directly. Similarly,
_GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct
that is an operand of sizeof.
The code below uses several ideas for C++ compilers, and for C
compilers that do not support _Static_assert:
* The first step is ((R) ? 1 : -1). Given an expression R, of
integral or boolean or floating-point type, this yields an
expression of integral type, whose value is later verified to be
constant and nonnegative.
* Next this expression W is wrapped in a type
struct _gl_verify_type {
unsigned int _gl_verify_error_if_negative: W;
}.
If W is negative, this yields a compile-time error. No compiler can
deal with a bit-field of negative size.
One might think that an array size check would have the same
effect, that is, that the type struct { unsigned int dummy[W]; }
would work as well. However, inside a function, some compilers
(such as C++ compilers and GNU C) allow local parameters and
variables inside array size expressions. With these compilers,
an array size check would not properly diagnose this misuse of
the verify macro:
void function (int n) { verify (n < 0); }
* For the verify macro, the struct _gl_verify_type will need to
somehow be embedded into a declaration. To be portable, this
declaration must declare an object, a constant, a function, or a
typedef name. If the declared entity uses the type directly,
such as in
struct dummy {...};
typedef struct {...} dummy;
extern struct {...} *dummy;
extern void dummy (struct {...} *);
extern struct {...} *dummy (void);
two uses of the verify macro would yield colliding declarations
if the entity names are not disambiguated. A workaround is to
attach the current line number to the entity name:
#define _GL_CONCAT0(x, y) x##y
#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
extern struct {...} * _GL_CONCAT (dummy, __LINE__);
But this has the problem that two invocations of verify from
within the same macro would collide, since the __LINE__ value
would be the same for both invocations. (The GCC __COUNTER__
macro solves this problem, but is not portable.)
A solution is to use the sizeof operator. It yields a number,
getting rid of the identity of the type. Declarations like
extern int dummy [sizeof (struct {...})];
extern void dummy (int [sizeof (struct {...})]);
extern int (*dummy (void)) [sizeof (struct {...})];
can be repeated.
* Should the implementation use a named struct or an unnamed struct?
Which of the following alternatives can be used?
extern int dummy [sizeof (struct {...})];
extern int dummy [sizeof (struct _gl_verify_type {...})];
extern void dummy (int [sizeof (struct {...})]);
extern void dummy (int [sizeof (struct _gl_verify_type {...})]);
extern int (*dummy (void)) [sizeof (struct {...})];
extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})];
In the second and sixth case, the struct type is exported to the
outer scope; two such declarations therefore collide. GCC warns
about the first, third, and fourth cases. So the only remaining
possibility is the fifth case:
extern int (*dummy (void)) [sizeof (struct {...})];
* GCC warns about duplicate declarations of the dummy function if
-Wredundant-decls is used. GCC 4.3 and later have a builtin
__COUNTER__ macro that can let us generate unique identifiers for
each dummy function, to suppress this warning.
* This implementation exploits the fact that older versions of GCC,
which do not support _Static_assert, also do not warn about the
last declaration mentioned above.
* GCC warns if -Wnested-externs is enabled and verify() is used
within a function body; but inside a function, you can always
arrange to use verify_expr() instead.
* In C++, any struct definition inside sizeof is invalid.
Use a template type to work around the problem. */
/* Concatenate two preprocessor tokens. */
#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
#define _GL_CONCAT0(x, y) x##y
/* _GL_COUNTER is an integer, preferably one that changes each time we
use it. Use __COUNTER__ if it works, falling back on __LINE__
otherwise. __LINE__ isn't perfect, but it's better than a
constant. */
#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
# define _GL_COUNTER __COUNTER__
#else
# define _GL_COUNTER __LINE__
#endif
/* Generate a symbol with the given prefix, making it unique if
possible. */
#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
/* Verify requirement R at compile-time, as an integer constant expression
that returns 1. If R is false, fail at compile-time, preferably
with a diagnostic that includes the string-literal DIAGNOSTIC. */
#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
(!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
#ifdef __cplusplus
# if !GNULIB_defined_struct__gl_verify_type
template <int w>
struct _gl_verify_type {
unsigned int _gl_verify_error_if_negative: w;
};
# define GNULIB_defined_struct__gl_verify_type 1
# endif
# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
_gl_verify_type<(R) ? 1 : -1>
#elif defined _GL_HAVE__STATIC_ASSERT
# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
struct { \
_Static_assert (R, DIAGNOSTIC); \
int _gl_dummy; \
}
#else
# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
#endif
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. If R is false, fail at compile-time, preferably
with a diagnostic that includes the string-literal DIAGNOSTIC.
Unfortunately, unlike C11, this implementation must appear as an
ordinary declaration, and cannot appear inside struct { ... }. */
#ifdef _GL_HAVE__STATIC_ASSERT
# define _GL_VERIFY _Static_assert
#else
# define _GL_VERIFY(R, DIAGNOSTIC) \
extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
[_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
#endif
/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
#ifdef _GL_STATIC_ASSERT_H
# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
# endif
# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
# define static_assert _Static_assert /* C11 requires this #define. */
# endif
#endif
/* @assert.h omit start@ */
/* Each of these macros verifies that its argument R is nonzero. To
be portable, R should be an integer constant expression. Unlike
assert (R), there is no run-time overhead.
There are two macros, since no single macro can be used in all
contexts in C. verify_true (R) is for scalar contexts, including
integer constant expression contexts. verify (R) is for declaration
contexts, e.g., the top level. */
/* Verify requirement R at compile-time, as an integer constant expression.
Return 1. This is equivalent to verify_expr (R, 1).
verify_true is obsolescent; please use verify_expr instead. */
#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
/* Verify requirement R at compile-time. Return the value of the
expression E. */
#define verify_expr(R, E) \
(_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. */
#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
/* Assume that R always holds. This lets the compiler optimize
accordingly. R should not have side-effects; it may or may not be
evaluated. Behavior is undefined if R is false. */
#if (__has_builtin (__builtin_unreachable) \
|| 4 < __GNUC__ + (5 <= __GNUC_MINOR__))
# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
#elif 1200 <= _MSC_VER
# define assume(R) __assume (R)
#elif (defined lint \
&& (__has_builtin (__builtin_trap) \
|| 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
/* Doing it this way helps various packages when configured with
--enable-gcc-warnings, which compiles with -Dlint. It's nicer
when 'assume' silences warnings even with older GCCs. */
# define assume(R) ((R) ? (void) 0 : __builtin_trap ())
#else
# define assume(R) ((void) (0 && (R)))
#endif
/* @assert.h omit end@ */
#endif

View File

@ -1,20 +1,18 @@
/* libintl library version. /* libintl library version.
Copyright (C) 2005 Free Software Foundation, Inc. Copyright (C) 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>

View File

@ -1,24 +1,26 @@
/* Parse printf format string. /* Parse printf format string.
Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software: you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _WPRINTF_PARSE_H #ifndef _WPRINTF_PARSE_H
#define _WPRINTF_PARSE_H #define _WPRINTF_PARSE_H
#if HAVE_FEATURES_H
# include <features.h> /* for __GLIBC__, __UCLIBC__ */
#endif
#include "printf-args.h" #include "printf-args.h"
@ -29,10 +31,16 @@
#define FLAG_SPACE 8 /* space flag */ #define FLAG_SPACE 8 /* space flag */
#define FLAG_ALT 16 /* # flag */ #define FLAG_ALT 16 /* # flag */
#define FLAG_ZERO 32 #define FLAG_ZERO 32
#if __GLIBC__ >= 2 && !defined __UCLIBC__
# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
#endif
/* arg_index value indicating that no argument is consumed. */ /* arg_index value indicating that no argument is consumed. */
#define ARG_NONE (~(size_t)0) #define ARG_NONE (~(size_t)0)
/* Number of directly allocated directives (no malloc() needed). */
#define N_DIRECT_ALLOC_DIRECTIVES 7
/* A parsed directive. */ /* A parsed directive. */
typedef struct typedef struct
{ {
@ -45,7 +53,7 @@ typedef struct
const wchar_t* precision_start; const wchar_t* precision_start;
const wchar_t* precision_end; const wchar_t* precision_end;
size_t precision_arg_index; size_t precision_arg_index;
wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */ wchar_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
size_t arg_index; size_t arg_index;
} }
wchar_t_directive; wchar_t_directive;
@ -57,6 +65,7 @@ typedef struct
wchar_t_directive *dir; wchar_t_directive *dir;
size_t max_width_length; size_t max_width_length;
size_t max_precision_length; size_t max_precision_length;
wchar_t_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
} }
wchar_t_directives; wchar_t_directives;

3
intl/xsize.c Normal file
View File

@ -0,0 +1,3 @@
#include <config.h>
#define XSIZE_INLINE _GL_EXTERN_INLINE
#include "xsize.h"

View File

@ -1,21 +1,19 @@
/* xsize.h -- Checked size_t computations. /* xsize.h -- Checked size_t computations.
Copyright (C) 2003, 2008 Free Software Foundation, Inc. Copyright (C) 2003, 2008-2014 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify
under the terms of the GNU Library General Public License as published it under the terms of the GNU Lesser General Public License as published by
by the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2.1, or (at your option)
any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Library General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public You should have received a copy of the GNU Lesser General Public License
License along with this program; if not, write to the Free Software along with this program; if not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifndef _XSIZE_H #ifndef _XSIZE_H
#define _XSIZE_H #define _XSIZE_H
@ -29,6 +27,14 @@
# include <stdint.h> # include <stdint.h>
#endif #endif
#ifndef _GL_INLINE_HEADER_BEGIN
#error "Please include config.h first."
#endif
_GL_INLINE_HEADER_BEGIN
#ifndef XSIZE_INLINE
# define XSIZE_INLINE _GL_INLINE
#endif
/* The size of memory objects is often computed through expressions of /* The size of memory objects is often computed through expressions of
type size_t. Example: type size_t. Example:
void* p = malloc (header_size + n * element_size). void* p = malloc (header_size + n * element_size).
@ -50,7 +56,7 @@
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
/* Sum of two sizes, with overflow check. */ /* Sum of two sizes, with overflow check. */
static inline size_t XSIZE_INLINE size_t
#if __GNUC__ >= 3 #if __GNUC__ >= 3
__attribute__ ((__pure__)) __attribute__ ((__pure__))
#endif #endif
@ -61,7 +67,7 @@ xsum (size_t size1, size_t size2)
} }
/* Sum of three sizes, with overflow check. */ /* Sum of three sizes, with overflow check. */
static inline size_t XSIZE_INLINE size_t
#if __GNUC__ >= 3 #if __GNUC__ >= 3
__attribute__ ((__pure__)) __attribute__ ((__pure__))
#endif #endif
@ -71,7 +77,7 @@ xsum3 (size_t size1, size_t size2, size_t size3)
} }
/* Sum of four sizes, with overflow check. */ /* Sum of four sizes, with overflow check. */
static inline size_t XSIZE_INLINE size_t
#if __GNUC__ >= 3 #if __GNUC__ >= 3
__attribute__ ((__pure__)) __attribute__ ((__pure__))
#endif #endif
@ -81,7 +87,7 @@ xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
} }
/* Maximum of two sizes, with overflow check. */ /* Maximum of two sizes, with overflow check. */
static inline size_t XSIZE_INLINE size_t
#if __GNUC__ >= 3 #if __GNUC__ >= 3
__attribute__ ((__pure__)) __attribute__ ((__pure__))
#endif #endif
@ -94,7 +100,7 @@ xmax (size_t size1, size_t size2)
/* Multiplication of a count with an element size, with overflow check. /* Multiplication of a count with an element size, with overflow check.
The count must be >= 0 and the element size must be > 0. The count must be >= 0 and the element size must be > 0.
This is a macro, not an inline function, so that it works correctly even This is a macro, not a function, so that it works correctly even
when N is of a wider type and N > SIZE_MAX. */ when N is of a wider type and N > SIZE_MAX. */
#define xtimes(N, ELSIZE) \ #define xtimes(N, ELSIZE) \
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
@ -106,4 +112,6 @@ xmax (size_t size1, size_t size2)
#define size_in_bounds_p(SIZE) \ #define size_in_bounds_p(SIZE) \
((SIZE) != SIZE_MAX) ((SIZE) != SIZE_MAX)
_GL_INLINE_HEADER_END
#endif /* _XSIZE_H */ #endif /* _XSIZE_H */

View File

@ -1,5 +1,5 @@
# codeset.m4 serial 4 (gettext-0.18) # codeset.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -9,8 +9,10 @@ dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET], AC_DEFUN([AM_LANGINFO_CODESET],
[ [
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
[AC_TRY_LINK([#include <langinfo.h>], [AC_LINK_IFELSE(
[char* cs = nl_langinfo(CODESET); return !cs;], [AC_LANG_PROGRAM(
[[#include <langinfo.h>]],
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
[am_cv_langinfo_codeset=yes], [am_cv_langinfo_codeset=yes],
[am_cv_langinfo_codeset=no]) [am_cv_langinfo_codeset=no])
]) ])

View File

@ -1,5 +1,5 @@
# fcntl-o.m4 serial 1 # fcntl-o.m4 serial 4
dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -12,13 +12,26 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_FCNTL_O_FLAGS], AC_DEFUN([gl_FCNTL_O_FLAGS],
[ [
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW. dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
dnl AC_GNU_SOURCE.
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
[AC_REQUIRE([AC_GNU_SOURCE])])
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_FUNCS_ONCE([symlink])
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
[AC_RUN_IFELSE( [AC_RUN_IFELSE(
[AC_LANG_PROGRAM( [AC_LANG_PROGRAM(
[[#include <sys/types.h> [[#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #if HAVE_UNISTD_H
# include <unistd.h>
#else /* on Windows with MSVC */
# include <io.h>
# include <stdlib.h>
# defined sleep(n) _sleep ((n) * 1000)
#endif
#include <fcntl.h> #include <fcntl.h>
#ifndef O_NOATIME #ifndef O_NOATIME
#define O_NOATIME 0 #define O_NOATIME 0
@ -33,34 +46,74 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
}; };
]], ]],
[[ [[
int status = !constants; int result = !constants;
#if HAVE_SYMLINK
{ {
static char const sym[] = "conftest.sym"; static char const sym[] = "conftest.sym";
if (symlink (".", sym) != 0 if (symlink ("/dev/null", sym) != 0)
|| close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0) result |= 2;
status |= 32; else
{
int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
if (fd >= 0)
{
close (fd);
result |= 4;
}
}
if (unlink (sym) != 0 || symlink (".", sym) != 0)
result |= 2;
else
{
int fd = open (sym, O_RDONLY | O_NOFOLLOW);
if (fd >= 0)
{
close (fd);
result |= 4;
}
}
unlink (sym); unlink (sym);
} }
#endif
{ {
static char const file[] = "confdefs.h"; static char const file[] = "confdefs.h";
int fd = open (file, O_RDONLY | O_NOATIME); int fd = open (file, O_RDONLY | O_NOATIME);
if (fd < 0)
result |= 8;
else
{
struct stat st0;
if (fstat (fd, &st0) != 0)
result |= 16;
else
{
char c; char c;
struct stat st0, st1; sleep (1);
if (fd < 0 if (read (fd, &c, 1) != 1)
|| fstat (fd, &st0) != 0 result |= 24;
|| sleep (1) != 0 else
|| read (fd, &c, 1) != 1 {
|| close (fd) != 0 if (close (fd) != 0)
|| stat (file, &st1) != 0 result |= 32;
|| st0.st_atime != st1.st_atime) else
status |= 64; {
struct stat st1;
if (stat (file, &st1) != 0)
result |= 40;
else
if (st0.st_atime != st1.st_atime)
result |= 64;
} }
return status;]])], }
}
}
}
return result;]])],
[gl_cv_header_working_fcntl_h=yes], [gl_cv_header_working_fcntl_h=yes],
[case $? in #( [case $? in #(
32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
*) gl_cv_header_working_fcntl_h='no';; *) gl_cv_header_working_fcntl_h='no';;
esac], esac],
[gl_cv_header_working_fcntl_h=cross-compiling])]) [gl_cv_header_working_fcntl_h=cross-compiling])])

View File

@ -1,5 +1,5 @@
# gettext.m4 serial 63 (gettext-0.18) # gettext.m4 serial 66 (gettext-0.18.2)
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -35,7 +35,7 @@ dnl will be ignored. If NEEDSYMBOL is specified and is
dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl 'need-formatstring-macros', then GNU gettext implementations that don't
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
dnl INTLDIR is used to find the intl libraries. If empty, dnl INTLDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used. dnl the value '$(top_builddir)/intl/' is used.
dnl dnl
dnl The result of the configuration is one of three cases: dnl The result of the configuration is one of three cases:
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
@ -97,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
]) ])
dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
gt_INTL_MACOSX gt_INTL_MACOSX
dnl Set USE_NLS. dnl Set USE_NLS.
@ -157,12 +157,18 @@ changequote([,])dnl
fi fi
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
[AC_TRY_LINK([#include <libintl.h> [AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
$gt_revision_test_code $gt_revision_test_code
extern int _nl_msg_cat_cntr; extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;], extern int *_nl_domain_bindings;
[bindtextdomain ("", ""); ]],
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [[
bindtextdomain ("", "");
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
]])],
[eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=yes"],
[eval "$gt_func_gnugettext_libc=no"])]) [eval "$gt_func_gnugettext_libc=no"])])
@ -183,31 +189,43 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b
gt_save_LIBS="$LIBS" gt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBINTL" LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv. dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h> AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
$gt_revision_test_code $gt_revision_test_code
extern int _nl_msg_cat_cntr; extern int _nl_msg_cat_cntr;
extern extern
#ifdef __cplusplus #ifdef __cplusplus
"C" "C"
#endif #endif
const char *_nl_expand_alias (const char *);], const char *_nl_expand_alias (const char *);
[bindtextdomain ("", ""); ]],
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [[
bindtextdomain ("", "");
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
]])],
[eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=yes"],
[eval "$gt_func_gnugettext_libintl=no"]) [eval "$gt_func_gnugettext_libintl=no"])
dnl Now see whether libintl exists and depends on libiconv. dnl Now see whether libintl exists and depends on libiconv.
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV" LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h> AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <libintl.h>
$gt_revision_test_code $gt_revision_test_code
extern int _nl_msg_cat_cntr; extern int _nl_msg_cat_cntr;
extern extern
#ifdef __cplusplus #ifdef __cplusplus
"C" "C"
#endif #endif
const char *_nl_expand_alias (const char *);], const char *_nl_expand_alias (const char *);
[bindtextdomain ("", ""); ]],
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [[
bindtextdomain ("", "");
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
]])],
[LIBINTL="$LIBINTL $LIBICONV" [LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV"
eval "$gt_func_gnugettext_libintl=yes" eval "$gt_func_gnugettext_libintl=yes"

View File

@ -1,5 +1,6 @@
# glibc2.m4 serial 2 # glibc2.m4 serial 3
dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -15,7 +16,7 @@ AC_DEFUN([gt_GLIBC2],
[ [
#include <features.h> #include <features.h>
#ifdef __GNU_LIBRARY__ #ifdef __GNU_LIBRARY__
#if (__GLIBC__ >= 2) #if (__GLIBC__ >= 2) && !defined __UCLIBC__
Lucky GNU user Lucky GNU user
#endif #endif
#endif #endif

View File

@ -1,23 +1,27 @@
# glibc21.m4 serial 4 # glibc21.m4 serial 5
dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
# Test for the GNU C Library, version 2.1 or newer. # Test for the GNU C Library, version 2.1 or newer, or uClibc.
# From Bruno Haible. # From Bruno Haible.
AC_DEFUN([gl_GLIBC21], AC_DEFUN([gl_GLIBC21],
[ [
AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer], AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
[ac_cv_gnu_library_2_1], [ac_cv_gnu_library_2_1],
[AC_EGREP_CPP([Lucky GNU user], [AC_EGREP_CPP([Lucky],
[ [
#include <features.h> #include <features.h>
#ifdef __GNU_LIBRARY__ #ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user Lucky GNU user
#endif #endif
#endif
#ifdef __UCLIBC__
Lucky user
#endif #endif
], ],
[ac_cv_gnu_library_2_1=yes], [ac_cv_gnu_library_2_1=yes],

View File

@ -1,5 +1,5 @@
# iconv.m4 serial 11 (gettext-0.18.1) # iconv.m4 serial 18 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -30,27 +30,35 @@ AC_DEFUN([AM_ICONV_LINK],
dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use dnl because if the user has installed libiconv and not disabled its use
dnl via --without-libiconv-prefix, he wants to use it. The first dnl via --without-libiconv-prefix, he wants to use it. The first
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
am_save_CPPFLAGS="$CPPFLAGS" am_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h> AC_LINK_IFELSE(
#include <iconv.h>], [AC_LANG_PROGRAM(
[iconv_t cd = iconv_open("",""); [[
#include <stdlib.h>
#include <iconv.h>
]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL); iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);], iconv_close(cd);]])],
[am_cv_func_iconv=yes]) [am_cv_func_iconv=yes])
if test "$am_cv_func_iconv" != yes; then if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS" am_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV" LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <stdlib.h> AC_LINK_IFELSE(
#include <iconv.h>], [AC_LANG_PROGRAM(
[iconv_t cd = iconv_open("",""); [[
#include <stdlib.h>
#include <iconv.h>
]],
[[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL); iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);], iconv_close(cd);]])],
[am_cv_lib_iconv=yes] [am_cv_lib_iconv=yes]
[am_cv_func_iconv=yes]) [am_cv_func_iconv=yes])
LIBS="$am_save_LIBS" LIBS="$am_save_LIBS"
@ -58,16 +66,19 @@ AC_DEFUN([AM_ICONV_LINK],
]) ])
if test "$am_cv_func_iconv" = yes; then if test "$am_cv_func_iconv" = yes; then
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
dnl Solaris 10.
am_save_LIBS="$LIBS" am_save_LIBS="$LIBS"
if test $am_cv_lib_iconv = yes; then if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV" LIBS="$LIBS $LIBICONV"
fi fi
AC_TRY_RUN([ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <iconv.h> #include <iconv.h>
#include <string.h> #include <string.h>
int main () int main ()
{ {
int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */ returns. */
{ {
@ -84,7 +95,8 @@ int main ()
(char **) &inptr, &inbytesleft, (char **) &inptr, &inbytesleft,
&outptr, &outbytesleft); &outptr, &outbytesleft);
if (res == 0) if (res == 0)
return 1; result |= 1;
iconv_close (cd_utf8_to_88591);
} }
} }
/* Test against Solaris 10 bug: Failures are not distinguishable from /* Test against Solaris 10 bug: Failures are not distinguishable from
@ -103,7 +115,27 @@ int main ()
(char **) &inptr, &inbytesleft, (char **) &inptr, &inbytesleft,
&outptr, &outbytesleft); &outptr, &outbytesleft);
if (res == 0) if (res == 0)
return 1; result |= 2;
iconv_close (cd_ascii_to_88591);
}
}
/* Test against AIX 6.1..7.1 bug: Buffer overrun. */
{
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
static const char input[] = "\304";
static char buf[2] = { (char)0xDE, (char)0xAD };
const char *inptr = input;
size_t inbytesleft = 1;
char *outptr = buf;
size_t outbytesleft = 1;
size_t res = iconv (cd_88591_to_utf8,
(char **) &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
result |= 4;
iconv_close (cd_88591_to_utf8);
} }
} }
#if 0 /* This bug could be worked around by the caller. */ #if 0 /* This bug could be worked around by the caller. */
@ -122,7 +154,8 @@ int main ()
(char **) &inptr, &inbytesleft, (char **) &inptr, &inbytesleft,
&outptr, &outbytesleft); &outptr, &outbytesleft);
if ((int)res > 0) if ((int)res > 0)
return 1; result |= 8;
iconv_close (cd_88591_to_utf8);
} }
} }
#endif #endif
@ -136,13 +169,19 @@ int main ()
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
/* Try HP-UX names. */ /* Try HP-UX names. */
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
return 1; result |= 16;
return 0; return result;
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], }]])],
[case "$host_os" in [am_cv_func_iconv_works=yes],
[am_cv_func_iconv_works=no],
[
changequote(,)dnl
case "$host_os" in
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
*) am_cv_func_iconv_works="guessing yes" ;; *) am_cv_func_iconv_works="guessing yes" ;;
esac]) esac
changequote([,])dnl
])
LIBS="$am_save_LIBS" LIBS="$am_save_LIBS"
]) ])
case "$am_cv_func_iconv_works" in case "$am_cv_func_iconv_works" in
@ -181,34 +220,49 @@ dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings. dnl warnings.
m4_define([gl_iconv_AC_DEFUN], m4_define([gl_iconv_AC_DEFUN],
m4_version_prereq([2.64], m4_version_prereq([2.64],
[[AC_DEFUN_ONCE(
[$1], [$2])]],
[m4_ifdef([gl_00GNULIB],
[[AC_DEFUN_ONCE( [[AC_DEFUN_ONCE(
[$1], [$2])]], [$1], [$2])]],
[[AC_DEFUN( [[AC_DEFUN(
[$1], [$2])]])) [$1], [$2])]])]))
gl_iconv_AC_DEFUN([AM_ICONV], gl_iconv_AC_DEFUN([AM_ICONV],
[ [
AM_ICONV_LINK AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration]) AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL([am_cv_proto_iconv], [ AC_CACHE_VAL([am_cv_proto_iconv], [
AC_TRY_COMPILE([ AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdlib.h> #include <stdlib.h>
#include <iconv.h> #include <iconv.h>
extern extern
#ifdef __cplusplus #ifdef __cplusplus
"C" "C"
#endif #endif
#if defined(__STDC__) || defined(__cplusplus) #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else #else
size_t iconv(); size_t iconv();
#endif #endif
], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) ]],
[[]])],
[am_cv_proto_iconv_arg1=""],
[am_cv_proto_iconv_arg1="const"])
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([ AC_MSG_RESULT([
$am_cv_proto_iconv]) $am_cv_proto_iconv])
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
[Define as const if the declaration of iconv() needs const.]) [Define as const if the declaration of iconv() needs const.])
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
m4_ifdef([gl_ICONV_H_DEFAULTS],
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
if test -n "$am_cv_proto_iconv_arg1"; then
ICONV_CONST="const"
fi
])
fi fi
]) ])

View File

@ -1,5 +1,5 @@
# intdiv0.m4 serial 3 (gettext-0.18) # intdiv0.m4 serial 6 (gettext-0.18.2)
dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2002, 2007-2008, 2010-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -18,7 +18,7 @@ AC_DEFUN([gt_INTDIV0],
changequote(,)dnl changequote(,)dnl
case "$host_os" in case "$host_os" in
macos* | darwin[6-9]* | darwin[1-9][0-9]*) macos* | darwin[6-9]* | darwin[1-9][0-9]*)
# On MacOS X 10.2 or newer, just assume the same as when cross- # On Mac OS X 10.2 or newer, just assume the same as when cross-
# compiling. If we were to perform the real test, 1 Crash Report # compiling. If we were to perform the real test, 1 Crash Report
# dialog window would pop up. # dialog window would pop up.
case "$host_cpu" in case "$host_cpu" in
@ -29,7 +29,8 @@ changequote(,)dnl
esac esac
changequote([,])dnl changequote([,])dnl
if test -z "$gt_cv_int_divbyzero_sigfpe"; then if test -z "$gt_cv_int_divbyzero_sigfpe"; then
AC_TRY_RUN([ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
@ -59,9 +60,11 @@ int main ()
z = x / y; z = x / y;
nan = y / y; nan = y / y;
exit (1); exit (2);
} }
], [gt_cv_int_divbyzero_sigfpe=yes], [gt_cv_int_divbyzero_sigfpe=no], ]])],
[gt_cv_int_divbyzero_sigfpe=yes],
[gt_cv_int_divbyzero_sigfpe=no],
[ [
# Guess based on the CPU. # Guess based on the CPU.
changequote(,)dnl changequote(,)dnl

View File

@ -1,5 +1,5 @@
# intl.m4 serial 17 (gettext-0.18) - updated by wk 2015-01-19 # intl.m4 serial 27 (gettext-0.19)
dnl Copyright (C) 1995-2009 Free Software Foundation, Inc. dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -17,7 +17,7 @@ dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
AC_PREREQ([2.52]) AC_PREREQ([2.60])
dnl Checks for all prerequisites of the intl subdirectory, dnl Checks for all prerequisites of the intl subdirectory,
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@ -42,6 +42,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gl_XSIZE])dnl
AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
AC_REQUIRE([gt_INTL_MACOSX])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl
AC_REQUIRE([gl_EXTERN_INLINE])dnl
AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
dnl Support for automake's --enable-silent-rules. dnl Support for automake's --enable-silent-rules.
case "$enable_silent_rules" in case "$enable_silent_rules" in
@ -55,21 +57,19 @@ AC_DEFUN([AM_INTL_SUBDIR],
[AC_DEFINE([ptrdiff_t], [long], [AC_DEFINE([ptrdiff_t], [long],
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
]) ])
AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \ AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter). dnl is defined as a weak alias of snprintf; we prefer to use the latter).
gt_CHECK_DECL(_snprintf, [#include <stdio.h>]) AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
dnl Use the *_unlocked functions only if they are declared. dnl Use the *_unlocked functions only if they are declared.
dnl (because some of them were defined without being declared in Solaris dnl (because some of them were defined without being declared in Solaris
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl on Solaris 2.5.1 to run on Solaris 2.6).
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
case $gt_cv_func_printf_posix in case $gt_cv_func_printf_posix in
*yes) HAVE_POSIX_PRINTF=1 ;; *yes) HAVE_POSIX_PRINTF=1 ;;
@ -220,9 +220,10 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl
AC_REQUIRE([gl_LOCK])dnl AC_REQUIRE([gl_LOCK])dnl
AC_TRY_LINK( AC_LINK_IFELSE(
[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }], [AC_LANG_PROGRAM(
[], [[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }]],
[[]])],
[AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
[Define to 1 if the compiler understands __builtin_expect.])]) [Define to 1 if the compiler understands __builtin_expect.])])
@ -235,16 +236,13 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
dnl (because some of them were defined without being declared in Solaris dnl (because some of them were defined without being declared in Solaris
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl on Solaris 2.5.1 to run on Solaris 2.6).
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
AM_ICONV AM_ICONV
dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least dnl because plural.y uses bison specific features. It requires at least
dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl bison-2.7 for %define api.pure.
dnl compile.
dnl bison is only needed for the maintainer (who touches plural.y). But in dnl bison is only needed for the maintainer (who touches plural.y). But in
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
dnl the rule in general Makefile. Now, some people carelessly touch the dnl the rule in general Makefile. Now, some people carelessly touch the
@ -261,7 +259,7 @@ changequote(<<,>>)dnl
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) 2.[7-9]* | [3-9].*)
changequote([,])dnl changequote([,])dnl
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
@ -273,22 +271,28 @@ changequote([,])dnl
fi fi
]) ])
dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from
dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl gnulib-common.m4 as a fallback, if the project isn't using Gnulib.
dnl Check whether a function is declared. AC_DEFUN([gt_GL_ATTRIBUTE], [
AC_DEFUN([gt_CHECK_DECL], m4_ifndef([gl_[]COMMON],
[ AH_VERBATIM([gt_gl_attribute],
AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1], [/* Define as a marker that can be attached to declarations that might not
[AC_TRY_COMPILE([$2], [ be used. This helps to reduce warnings, such as from
#ifndef $1 GCC -Wunused-parameter. */
char *p = (char *) $1; #ifndef _GL_UNUSED
# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
# define _GL_UNUSED __attribute__ ((__unused__))
# else
# define _GL_UNUSED
# endif
#endif #endif
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
if test $ac_cv_have_decl_$1 = yes; then /* The __pure__ attribute was added in gcc 2.96. */
gt_value=1 #ifndef _GL_ATTRIBUTE_PURE
else # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
gt_value=0 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
fi # else
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], # define _GL_ATTRIBUTE_PURE /* empty */
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) # endif
]) #endif
]))])

View File

@ -1,5 +1,5 @@
# intldir.m4 serial 2 (gettext-0.18) # intldir.m4 serial 2 (gettext-0.18)
dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.

View File

@ -1,5 +1,5 @@
# intlmacosx.m4 serial 3 (gettext-0.18) # intlmacosx.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc. dnl Copyright (C) 2004-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -13,35 +13,40 @@ dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License. dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain. dnl They are *not* in the public domain.
dnl Checks for special options needed on MacOS X. dnl Checks for special options needed on Mac OS X.
dnl Defines INTL_MACOSX_LIBS. dnl Defines INTL_MACOSX_LIBS.
AC_DEFUN([gt_INTL_MACOSX], AC_DEFUN([gt_INTL_MACOSX],
[ [
dnl Check for API introduced in MacOS X 10.2. dnl Check for API introduced in Mac OS X 10.2.
AC_CACHE_CHECK([for CFPreferencesCopyAppValue], AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
[gt_cv_func_CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue],
[gt_save_LIBS="$LIBS" [gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], AC_LINK_IFELSE(
[CFPreferencesCopyAppValue(NULL, NULL)], [AC_LANG_PROGRAM(
[[#include <CoreFoundation/CFPreferences.h>]],
[[CFPreferencesCopyAppValue(NULL, NULL)]])],
[gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=yes],
[gt_cv_func_CFPreferencesCopyAppValue=no]) [gt_cv_func_CFPreferencesCopyAppValue=no])
LIBS="$gt_save_LIBS"]) LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi fi
dnl Check for API introduced in MacOS X 10.3. dnl Check for API introduced in Mac OS X 10.3.
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
[gt_save_LIBS="$LIBS" [gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <CoreFoundation/CFLocale.h>]],
[[CFLocaleCopyCurrent();]])],
[gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=yes],
[gt_cv_func_CFLocaleCopyCurrent=no]) [gt_cv_func_CFLocaleCopyCurrent=no])
LIBS="$gt_save_LIBS"]) LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
[Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fi fi
INTL_MACOSX_LIBS= INTL_MACOSX_LIBS=
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then

View File

@ -1,5 +1,5 @@
# intmax.m4 serial 5 (gettext-0.18) # intmax.m4 serial 6 (gettext-0.18.2)
dnl Copyright (C) 2002-2005, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2002-2005, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -13,7 +13,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H])
AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#if HAVE_STDINT_H_WITH_UINTMAX #if HAVE_STDINT_H_WITH_UINTMAX
@ -22,8 +24,9 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
#if HAVE_INTTYPES_H_WITH_UINTMAX #if HAVE_INTTYPES_H_WITH_UINTMAX
#include <inttypes.h> #include <inttypes.h>
#endif #endif
], [intmax_t x = -1; ]],
return !x;], [[intmax_t x = -1;
return !x;]])],
[gt_cv_c_intmax_t=yes], [gt_cv_c_intmax_t=yes],
[gt_cv_c_intmax_t=no])]) [gt_cv_c_intmax_t=no])])
if test $gt_cv_c_intmax_t = yes; then if test $gt_cv_c_intmax_t = yes; then

View File

@ -1,12 +1,12 @@
# inttypes-pri.m4 serial 6 (gettext-0.18) # inttypes-pri.m4 serial 7 (gettext-0.18.2)
dnl Copyright (C) 1997-2002, 2006, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 1997-2002, 2006, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible. dnl From Bruno Haible.
AC_PREREQ([2.52]) AC_PREREQ([2.53])
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
# macros to non-string values. This is the case on AIX 4.3.3. # macros to non-string values. This is the case on AIX 4.3.3.
@ -18,11 +18,17 @@ AC_DEFUN([gt_INTTYPES_PRI],
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
[gt_cv_inttypes_pri_broken], [gt_cv_inttypes_pri_broken],
[ [
AC_TRY_COMPILE([#include <inttypes.h> AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <inttypes.h>
#ifdef PRId32 #ifdef PRId32
char *p = PRId32; char *p = PRId32;
#endif #endif
], [], [gt_cv_inttypes_pri_broken=no], [gt_cv_inttypes_pri_broken=yes]) ]],
[[]])],
[gt_cv_inttypes_pri_broken=no],
[gt_cv_inttypes_pri_broken=yes])
]) ])
fi fi
if test "$gt_cv_inttypes_pri_broken" = yes; then if test "$gt_cv_inttypes_pri_broken" = yes; then

View File

@ -1,5 +1,5 @@
# inttypes_h.m4 serial 9 # inttypes_h.m4 serial 10
dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 1997-2004, 2006, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -12,10 +12,13 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_INTTYPES_H], AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
[ [
AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
[AC_TRY_COMPILE( [AC_COMPILE_IFELSE(
[#include <sys/types.h> [AC_LANG_PROGRAM(
#include <inttypes.h>], [[
[uintmax_t i = (uintmax_t) -1; return !i;], #include <sys/types.h>
#include <inttypes.h>
]],
[[uintmax_t i = (uintmax_t) -1; return !i;]])],
[gl_cv_header_inttypes_h=yes], [gl_cv_header_inttypes_h=yes],
[gl_cv_header_inttypes_h=no])]) [gl_cv_header_inttypes_h=no])])
if test $gl_cv_header_inttypes_h = yes; then if test $gl_cv_header_inttypes_h = yes; then

View File

@ -1,5 +1,5 @@
# lcmessage.m4 serial 6 (gettext-0.18) # lcmessage.m4 serial 7 (gettext-0.18.2)
dnl Copyright (C) 1995-2002, 2004-2005, 2008-2010 Free Software Foundation, dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014 Free Software Foundation,
dnl Inc. dnl Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -22,8 +22,12 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
AC_DEFUN([gt_LC_MESSAGES], AC_DEFUN([gt_LC_MESSAGES],
[ [
AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], [AC_LINK_IFELSE(
[gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])]) [AC_LANG_PROGRAM(
[[#include <locale.h>]],
[[return LC_MESSAGES]])],
[gt_cv_val_LC_MESSAGES=yes],
[gt_cv_val_LC_MESSAGES=no])])
if test $gt_cv_val_LC_MESSAGES = yes; then if test $gt_cv_val_LC_MESSAGES = yes; then
AC_DEFINE([HAVE_LC_MESSAGES], [1], AC_DEFINE([HAVE_LC_MESSAGES], [1],
[Define if your <locale.h> file defines LC_MESSAGES.]) [Define if your <locale.h> file defines LC_MESSAGES.])

View File

@ -1,50 +1,56 @@
# lib-ld.m4 serial 4 (gettext-0.18) # lib-ld.m4 serial 6
dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
dnl Subroutines of libtool.m4, dnl Subroutines of libtool.m4,
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
dnl with libtool.m4. dnl collision with libtool.m4.
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU], AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
[# I'd rather use --version here, but apparently some GNU ld's only accept -v. [# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*) *GNU* | *'with BFD'*)
acl_cv_prog_gnu_ld=yes ;; acl_cv_prog_gnu_ld=yes
;;
*) *)
acl_cv_prog_gnu_ld=no ;; acl_cv_prog_gnu_ld=no
;;
esac]) esac])
with_gnu_ld=$acl_cv_prog_gnu_ld with_gnu_ld=$acl_cv_prog_gnu_ld
]) ])
dnl From libtool-1.4. Sets the variable LD. dnl From libtool-2.4. Sets the variable LD.
AC_DEFUN([AC_LIB_PROG_LD], AC_DEFUN([AC_LIB_PROG_LD],
[AC_ARG_WITH([gnu-ld], [AC_REQUIRE([AC_PROG_CC])dnl
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
[assume the C compiler uses GNU ld [default=no]])],
[test "$withval" = no || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
# Prepare PATH_SEPARATOR. # Prepare PATH_SEPARATOR.
# The user is always right. # The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
echo "exit 0" >>conf$$.sh # contains only /bin. Note that ksh looks also at the FPATH variable,
chmod +x conf$$.sh # so we have to set that as well for the test.
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=: PATH_SEPARATOR=:
fi (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
rm -f conf$$.sh && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|| PATH_SEPARATOR=';'
}
fi fi
ac_prog=ld ac_prog=ld
if test "$GCC" = yes; then if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path. # Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC]) AC_MSG_CHECKING([for ld used by $CC])
case $host in case $host in
*-*-mingw*) *-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw # gcc leaves a trailing carriage return which upsets mingw
@ -54,11 +60,11 @@ if test "$GCC" = yes; then
esac esac
case $ac_prog in case $ac_prog in
# Accept absolute paths. # Accept absolute paths.
[[\\/]* | [A-Za-z]:[\\/]*)] [[\\/]]* | ?:[[\\/]]*)
[re_direlt='/[^/][^/]*/\.\./'] re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the path of ld # Canonicalize the pathname of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done done
test -z "$LD" && LD="$ac_prog" test -z "$LD" && LD="$ac_prog"
@ -79,23 +85,26 @@ else
fi fi
AC_CACHE_VAL([acl_cv_path_LD], AC_CACHE_VAL([acl_cv_path_LD],
[if test -z "$LD"; then [if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do for ac_dir in $PATH; do
IFS="$acl_save_ifs"
test -z "$ac_dir" && ac_dir=. test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog" acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version, # Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v. # but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer. # Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*) *GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break ;; test "$with_gnu_ld" != no && break
;;
*) *)
test "$with_gnu_ld" != yes && break ;; test "$with_gnu_ld" != yes && break
;;
esac esac
fi fi
done done
IFS="$ac_save_ifs" IFS="$acl_save_ifs"
else else
acl_cv_path_LD="$LD" # Let the user override the test with a path. acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi]) fi])

View File

@ -1,5 +1,5 @@
# lib-link.m4 serial 21 (gettext-0.18) # lib-link.m4 serial 26 (gettext-0.18.2)
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. dnl Copyright (C) 2001-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
[ [
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_RPATH])
pushdef([Name],[translit([$1],[./-], [___])]) pushdef([Name],[m4_translit([$1],[./+-], [____])])
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
AC_LIB_LINKFLAGS_BODY([$1], [$2]) AC_LIB_LINKFLAGS_BODY([$1], [$2])
ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@ -58,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[ [
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_RPATH])
pushdef([Name],[translit([$1],[./-], [___])]) pushdef([Name],[m4_translit([$1],[./+-], [____])])
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
dnl accordingly. dnl accordingly.
@ -85,7 +85,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
*" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
*) LIBS="$LIB[]NAME $LIBS" ;; *) LIBS="$LIB[]NAME $LIBS" ;;
esac esac
AC_TRY_LINK([$3], [$4], AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[$3]], [[$4]])],
[ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=yes],
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
LIBS="$ac_save_LIBS" LIBS="$ac_save_LIBS"
@ -115,6 +116,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
dnl Determine the platform dependent parameters needed to use rpath: dnl Determine the platform dependent parameters needed to use rpath:
dnl acl_libext, dnl acl_libext,
dnl acl_shlibext, dnl acl_shlibext,
dnl acl_libname_spec,
dnl acl_library_names_spec,
dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_flag_spec,
dnl acl_hardcode_libdir_separator, dnl acl_hardcode_libdir_separator,
dnl acl_hardcode_direct, dnl acl_hardcode_direct,
@ -157,15 +160,15 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
dnl macro call that searches for libname. dnl macro call that searches for libname.
AC_DEFUN([AC_LIB_FROMPACKAGE], AC_DEFUN([AC_LIB_FROMPACKAGE],
[ [
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
define([acl_frompackage_]NAME, [$2]) define([acl_frompackage_]NAME, [$2])
popdef([NAME]) popdef([NAME])
pushdef([PACK],[$2]) pushdef([PACK],[$2])
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
define([acl_libsinpackage_]PACKUP, define([acl_libsinpackage_]PACKUP,
m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
popdef([PACKUP]) popdef([PACKUP])
popdef([PACK]) popdef([PACK])
]) ])
@ -178,14 +181,14 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY], AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[ [
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
dnl Autoconf >= 2.61 supports dots in --with options. dnl Autoconf >= 2.61 supports dots in --with options.
pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir. dnl By default, look in $includedir and $libdir.
use_additional=yes use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([ AC_LIB_WITH_FINAL_PREFIX([
@ -242,7 +245,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
names_already_handled="$names_already_handled $name" names_already_handled="$names_already_handled $name"
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
dnl or AC_LIB_HAVE_LINKFLAGS call. dnl or AC_LIB_HAVE_LINKFLAGS call.
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
eval value=\"\$HAVE_LIB$uppername\" eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then if test -n "$value"; then
if test "$value" = yes; then if test "$value" = yes; then

View File

@ -1,5 +1,5 @@
# lib-prefix.m4 serial 7 (gettext-0.18) # lib-prefix.m4 serial 7 (gettext-0.18)
dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.

View File

@ -1,5 +1,5 @@
# lock.m4 serial 10 (gettext-0.18) # lock.m4 serial 13 (gettext-0.18.2)
dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -10,7 +10,7 @@ AC_DEFUN([gl_LOCK],
[ [
AC_REQUIRE([gl_THREADLIB]) AC_REQUIRE([gl_THREADLIB])
if test "$gl_threads_api" = posix; then if test "$gl_threads_api" = posix; then
# OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
# pthread_rwlock_* functions. # pthread_rwlock_* functions.
AC_CHECK_TYPE([pthread_rwlock_t], AC_CHECK_TYPE([pthread_rwlock_t],
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
@ -18,20 +18,25 @@ AC_DEFUN([gl_LOCK],
[], [],
[#include <pthread.h>]) [#include <pthread.h>])
# glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
AC_TRY_COMPILE([#include <pthread.h>], AC_COMPILE_IFELSE([
[#if __FreeBSD__ == 4 AC_LANG_PROGRAM(
[[#include <pthread.h>]],
[[
#if __FreeBSD__ == 4
error "No, in FreeBSD 4.0 recursive mutexes actually don't work." error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
&& __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
#else #else
int x = (int)PTHREAD_MUTEX_RECURSIVE; int x = (int)PTHREAD_MUTEX_RECURSIVE;
return !x; return !x;
#endif], #endif
]])],
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
[Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
fi fi
gl_PREREQ_LOCK gl_PREREQ_LOCK
]) ])
# Prerequisites of lib/lock.c. # Prerequisites of lib/glthread/lock.c.
AC_DEFUN([gl_PREREQ_LOCK], [ AC_DEFUN([gl_PREREQ_LOCK], [:])
AC_REQUIRE([AC_C_INLINE])
])

View File

@ -1,5 +1,5 @@
# longlong.m4 serial 14 # longlong.m4 serial 17
dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc. dnl Copyright (C) 1999-2007, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert. dnl From Paul Eggert.
# Define HAVE_LONG_LONG_INT if 'long long int' works. # Define HAVE_LONG_LONG_INT if 'long long int' works.
# This fixes a bug in Autoconf 2.61, but can be removed once we # This fixes a bug in Autoconf 2.61, and can be faster
# assume 2.62 everywhere. # than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'long long int' exists but is only 32 bits large # Note: If the type 'long long int' exists but is only 32 bits large
# (as on some very old compilers), HAVE_LONG_LONG_INT will not be # (as on some very old compilers), HAVE_LONG_LONG_INT will not be
@ -16,11 +16,14 @@ dnl From Paul Eggert.
AC_DEFUN([AC_TYPE_LONG_LONG_INT], AC_DEFUN([AC_TYPE_LONG_LONG_INT],
[ [
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
[AC_LINK_IFELSE( [ac_cv_type_long_long_int=yes
[_AC_TYPE_LONG_LONG_SNIPPET], if test "x${ac_cv_prog_cc_c99-no}" = xno; then
[dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
dnl If cross compiling, assume the bug isn't important, since if test $ac_cv_type_long_long_int = yes; then
dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
dnl If cross compiling, assume the bug is not important, since
dnl nobody cross compiles for this platform as far as we know. dnl nobody cross compiles for this platform as far as we know.
AC_RUN_IFELSE( AC_RUN_IFELSE(
[AC_LANG_PROGRAM( [AC_LANG_PROGRAM(
@ -41,19 +44,20 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
break; break;
} }
return 0;]])], return 0;]])],
[ac_cv_type_long_long_int=yes], [],
[ac_cv_type_long_long_int=no], [ac_cv_type_long_long_int=no],
[ac_cv_type_long_long_int=yes])], [:])
[ac_cv_type_long_long_int=no])]) fi
fi])
if test $ac_cv_type_long_long_int = yes; then if test $ac_cv_type_long_long_int = yes; then
AC_DEFINE([HAVE_LONG_LONG_INT], [1], 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 fi
]) ])
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
# This fixes a bug in Autoconf 2.61, but can be removed once we # This fixes a bug in Autoconf 2.61, and can be faster
# assume 2.62 everywhere. # than what's in Autoconf 2.62 through 2.68.
# Note: If the type 'unsigned long long int' exists but is only 32 bits # Note: If the type 'unsigned long long int' exists but is only 32 bits
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
@ -64,13 +68,16 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
[ [
AC_CACHE_CHECK([for unsigned long long int], AC_CACHE_CHECK([for unsigned long long int],
[ac_cv_type_unsigned_long_long_int], [ac_cv_type_unsigned_long_long_int],
[AC_LINK_IFELSE( [ac_cv_type_unsigned_long_long_int=yes
if test "x${ac_cv_prog_cc_c99-no}" = xno; then
AC_LINK_IFELSE(
[_AC_TYPE_LONG_LONG_SNIPPET], [_AC_TYPE_LONG_LONG_SNIPPET],
[ac_cv_type_unsigned_long_long_int=yes], [],
[ac_cv_type_unsigned_long_long_int=no])]) [ac_cv_type_unsigned_long_long_int=no])
fi])
if test $ac_cv_type_unsigned_long_long_int = yes; then if test $ac_cv_type_unsigned_long_long_int = yes; then
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], 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 fi
]) ])

View File

@ -1,5 +1,5 @@
# nls.m4 serial 5 (gettext-0.18) # nls.m4 serial 5 (gettext-0.18)
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation,
dnl Inc. dnl Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,

View File

@ -1,5 +1,5 @@
# po.m4 serial 17 (gettext-0.18) updated by wk 2015-01-19 # po.m4 serial 22 (gettext-0.19)
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -17,7 +17,7 @@ dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
AC_PREREQ([2.50]) AC_PREREQ([2.60])
dnl Checks for all prerequisites of the po subdirectory. dnl Checks for all prerequisites of the po subdirectory.
AC_DEFUN([AM_PO_SUBDIRS], AC_DEFUN([AM_PO_SUBDIRS],
@ -25,11 +25,12 @@ AC_DEFUN([AM_PO_SUBDIRS],
AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl
AC_REQUIRE([AC_PROG_SED])dnl
AC_REQUIRE([AM_NLS])dnl AC_REQUIRE([AM_NLS])dnl
dnl Release version of the gettext macros. This is used to ensure that dnl Release version of the gettext macros. This is used to ensure that
dnl the gettext macros and po/Makefile.in.in are in sync. dnl the gettext macros and po/Makefile.in.in are in sync.
AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
dnl Perform the following tests also if --disable-nls has been given, dnl Perform the following tests also if --disable-nls has been given,
dnl because they are needed for "make dist" to work. dnl because they are needed for "make dist" to work.
@ -102,7 +103,7 @@ changequote([,])dnl
case "$ac_file" in */Makefile.in) case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir. # Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir. # In autoconf-2.50 it is called $srcdir.
@ -118,7 +119,8 @@ changequote([,])dnl
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES" rm -f "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" gt_tab=`printf '\t'`
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
POMAKEFILEDEPS="POTFILES.in" POMAKEFILEDEPS="POTFILES.in"
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
# on $ac_dir but don't depend on user-specified configuration # on $ac_dir but don't depend on user-specified configuration
@ -129,12 +131,12 @@ changequote([,])dnl
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
fi fi
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
# Hide the ALL_LINGUAS assigment from automake < 1.5. # Hide the ALL_LINGUAS assignment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_' eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
else else
# The set of available languages was given in configure.in. # The set of available languages was given in configure.in.
# Hide the ALL_LINGUAS assigment from automake < 1.5. # Hide the ALL_LINGUAS assignment from automake < 1.5.
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
fi fi
# Compute POFILES # Compute POFILES
@ -226,7 +228,7 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
changequote(,)dnl changequote(,)dnl
# Adjust a relative srcdir. # Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir. # In autoconf-2.50 it is called $srcdir.
@ -254,6 +256,7 @@ EOT
fi fi
# A sed script that extracts the value of VARIABLE from a Makefile. # A sed script that extracts the value of VARIABLE from a Makefile.
tab=`printf '\t'`
sed_x_variable=' sed_x_variable='
# Test if the hold space is empty. # Test if the hold space is empty.
x x
@ -261,9 +264,9 @@ s/P/P/
x x
ta ta
# Yes it was empty. Look if we have the expected variable definition. # Yes it was empty. Look if we have the expected variable definition.
/^[ ]*VARIABLE[ ]*=/{ /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
# Seen the first line of the variable definition. # Seen the first line of the variable definition.
s/^[ ]*VARIABLE[ ]*=// s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
ba ba
} }
bd bd
@ -315,7 +318,7 @@ changequote([,])dnl
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
fi fi
# Hide the ALL_LINGUAS assigment from automake < 1.5. # Hide the ALL_LINGUAS assignment from automake < 1.5.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_' eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
# Compute POFILES # Compute POFILES
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
@ -405,14 +408,15 @@ changequote([,])dnl
fi fi
sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
tab=`printf '\t'`
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
# Add dependencies that cannot be formulated as a simple suffix rule. # Add dependencies that cannot be formulated as a simple suffix rule.
for lang in $ALL_LINGUAS; do for lang in $ALL_LINGUAS; do
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
cat >> "$ac_file.tmp" <<EOF cat >> "$ac_file.tmp" <<EOF
$frobbedlang.msg: $lang.po $frobbedlang.msg: $lang.po
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
EOF EOF
done done
fi fi
@ -422,8 +426,8 @@ EOF
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
cat >> "$ac_file.tmp" <<EOF cat >> "$ac_file.tmp" <<EOF
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
EOF EOF
done done
fi fi

View File

@ -1,5 +1,5 @@
# printf-posix.m4 serial 5 (gettext-0.18) # printf-posix.m4 serial 6 (gettext-0.18.2)
dnl Copyright (C) 2003, 2007, 2009-2010 Free Software Foundation, Inc. dnl Copyright (C) 2003, 2007, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -14,7 +14,8 @@ AC_DEFUN([gt_PRINTF_POSIX],
AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
gt_cv_func_printf_posix, gt_cv_func_printf_posix,
[ [
AC_TRY_RUN([ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
/* The string "%2$d %1$d", with dollar characters protected from the shell's /* The string "%2$d %1$d", with dollar characters protected from the shell's
@ -25,7 +26,9 @@ int main ()
{ {
sprintf (buf, format, 33, 55); sprintf (buf, format, 33, 55);
return (strcmp (buf, "55 33") != 0); return (strcmp (buf, "55 33") != 0);
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, }]])],
[gt_cv_func_printf_posix=yes],
[gt_cv_func_printf_posix=no],
[ [
AC_EGREP_CPP([notposix], [ AC_EGREP_CPP([notposix], [
#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__

View File

@ -1,5 +1,5 @@
# progtest.m4 serial 6 (gettext-0.18) # progtest.m4 serial 7 (gettext-0.18.2)
dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 1996-2003, 2005, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -27,15 +27,14 @@ AC_DEFUN([AM_PATH_PROG_WITH_TEST],
# Prepare PATH_SEPARATOR. # Prepare PATH_SEPARATOR.
# The user is always right. # The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
echo "exit 0" >>conf$$.sh # contains only /bin. Note that ksh looks also at the FPATH variable,
chmod +x conf$$.sh # so we have to set that as well for the test.
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=: PATH_SEPARATOR=:
fi (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
rm -f conf$$.sh && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
|| PATH_SEPARATOR=';'
}
fi fi
# Find out how to test for executable files. Don't use a zero-byte file, # Find out how to test for executable files. Don't use a zero-byte file,

View File

@ -1,5 +1,5 @@
# size_max.m4 serial 9 # size_max.m4 serial 10
dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2003, 2005-2006, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -34,10 +34,14 @@ Found it
if test $fits_in_uint = 1; then if test $fits_in_uint = 1; then
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
AC_TRY_COMPILE([#include <stddef.h> AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stddef.h>
extern size_t foo; extern size_t foo;
extern unsigned long foo; extern unsigned long foo;
], [], [fits_in_uint=0]) ]],
[[]])],
[fits_in_uint=0])
fi fi
dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl We cannot use 'expr' to simplify this expression, because 'expr'
dnl works only with 'long' integers in the host environment, while we dnl works only with 'long' integers in the host environment, while we

View File

@ -1,5 +1,5 @@
# stdint_h.m4 serial 8 # stdint_h.m4 serial 9
dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 1997-2004, 2006, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -12,10 +12,11 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_STDINT_H], AC_DEFUN([gl_AC_HEADER_STDINT_H],
[ [
AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
[AC_TRY_COMPILE( [AC_COMPILE_IFELSE(
[#include <sys/types.h> [AC_LANG_PROGRAM(
#include <stdint.h>], [[#include <sys/types.h>
[uintmax_t i = (uintmax_t) -1; return !i;], #include <stdint.h>]],
[[uintmax_t i = (uintmax_t) -1; return !i;]])],
[gl_cv_header_stdint_h=yes], [gl_cv_header_stdint_h=yes],
[gl_cv_header_stdint_h=no])]) [gl_cv_header_stdint_h=no])])
if test $gl_cv_header_stdint_h = yes; then if test $gl_cv_header_stdint_h = yes; then

View File

@ -1,5 +1,5 @@
# threadlib.m4 serial 5 (gettext-0.18) # threadlib.m4 serial 11 (gettext-0.18.2)
dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -9,15 +9,20 @@ dnl From Bruno Haible.
dnl gl_THREADLIB dnl gl_THREADLIB
dnl ------------ dnl ------------
dnl Tests for a multithreading library to be used. dnl Tests for a multithreading library to be used.
dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
dnl default is 'no', otherwise it is system dependent. In both cases, the user
dnl can change the choice through the options --enable-threads=choice or
dnl --disable-threads.
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
dnl USE_PTH_THREADS, USE_WIN32_THREADS dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
dnl libtool). dnl libtool).
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
dnl programs that really need multithread functionality. The difference dnl programs that really need multithread functionality. The difference
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
dnl multithread-safe programs. dnl multithread-safe programs.
@ -44,10 +49,12 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
[AC_REQUIRE([AC_GNU_SOURCE])]) [AC_REQUIRE([AC_GNU_SOURCE])])
dnl Check for multithreading. dnl Check for multithreading.
m4_divert_text([DEFAULTS], [gl_use_threads_default=]) m4_ifdef([gl_THREADLIB_DEFAULT_NO],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
AC_ARG_ENABLE([threads], AC_ARG_ENABLE([threads],
AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
AC_HELP_STRING([--disable-threads], [build without multithread safety]), AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
[gl_use_threads=$enableval], [gl_use_threads=$enableval],
[if test -n "$gl_use_threads_default"; then [if test -n "$gl_use_threads_default"; then
gl_use_threads="$gl_use_threads_default" gl_use_threads="$gl_use_threads_default"
@ -80,7 +87,7 @@ changequote([,])dnl
# groks <pthread.h>. cc also understands the flag -pthread, but # groks <pthread.h>. cc also understands the flag -pthread, but
# we don't use it because 1. gcc-2.95 doesn't understand -pthread, # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
# 2. putting a flag into CPPFLAGS that has an effect on the linker # 2. putting a flag into CPPFLAGS that has an effect on the linker
# causes the AC_TRY_LINK test below to succeed unexpectedly, # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
# leading to wrong values of LIBTHREAD and LTLIBTHREAD. # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
CPPFLAGS="$CPPFLAGS -D_REENTRANT" CPPFLAGS="$CPPFLAGS -D_REENTRANT"
;; ;;
@ -111,18 +118,25 @@ AC_DEFUN([gl_THREADLIB_BODY],
[gl_cv_have_weak], [gl_cv_have_weak],
[gl_cv_have_weak=no [gl_cv_have_weak=no
dnl First, test whether the compiler accepts it syntactically. dnl First, test whether the compiler accepts it syntactically.
AC_TRY_LINK([extern void xyzzy (); AC_LINK_IFELSE(
#pragma weak xyzzy], [xyzzy();], [gl_cv_have_weak=maybe]) [AC_LANG_PROGRAM(
[[extern void xyzzy ();
#pragma weak xyzzy]],
[[xyzzy();]])],
[gl_cv_have_weak=maybe])
if test $gl_cv_have_weak = maybe; then if test $gl_cv_have_weak = maybe; then
dnl Second, test whether it actually works. On Cygwin 1.7.2, with dnl Second, test whether it actually works. On Cygwin 1.7.2, with
dnl gcc 4.3, symbols declared weak always evaluate to the address 0. dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
AC_TRY_RUN([ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h> #include <stdio.h>
#pragma weak fputs #pragma weak fputs
int main () int main ()
{ {
return (fputs == NULL); return (fputs == NULL);
}], [gl_cv_have_weak=yes], [gl_cv_have_weak=no], }]])],
[gl_cv_have_weak=yes],
[gl_cv_have_weak=no],
[dnl When cross-compiling, assume that only ELF platforms support [dnl When cross-compiling, assume that only ELF platforms support
dnl weak symbols. dnl weak symbols.
AC_EGREP_CPP([Extensible Linking Format], AC_EGREP_CPP([Extensible Linking Format],
@ -148,13 +162,31 @@ int main ()
# Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
# in libc. IRIX 6.5 has the first one in both libc and libpthread, but # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
# the second one only in libpthread, and lock.c needs it. # the second one only in libpthread, and lock.c needs it.
AC_TRY_LINK([#include <pthread.h>], #
[pthread_mutex_lock((pthread_mutex_t*)0); # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
pthread_mutexattr_init((pthread_mutexattr_t*)0);], # needs -pthread for some reason. See:
[gl_have_pthread=yes]) # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
save_LIBS=$LIBS
for gl_pthread in '' '-pthread'; do
LIBS="$LIBS $gl_pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <pthread.h>
pthread_mutex_t m;
pthread_mutexattr_t ma;
]],
[[pthread_mutex_lock (&m);
pthread_mutexattr_init (&ma);]])],
[gl_have_pthread=yes
LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
LIBS=$save_LIBS
test -n "$gl_have_pthread" && break
done
# Test for libpthread by looking for pthread_kill. (Not pthread_self, # Test for libpthread by looking for pthread_kill. (Not pthread_self,
# since it is defined as a macro on OSF/1.) # since it is defined as a macro on OSF/1.)
if test -n "$gl_have_pthread"; then if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
# The program links fine without libpthread. But it may actually # The program links fine without libpthread. But it may actually
# need to link with libpthread in order to create multiple threads. # need to link with libpthread in order to create multiple threads.
AC_CHECK_LIB([pthread], [pthread_kill], AC_CHECK_LIB([pthread], [pthread_kill],
@ -169,7 +201,7 @@ int main ()
[Define if the pthread_in_use() detection is hard.]) [Define if the pthread_in_use() detection is hard.])
esac esac
]) ])
else elif test -z "$gl_have_pthread"; then
# Some library is needed. Try libpthread and libc_r. # Some library is needed. Try libpthread and libc_r.
AC_CHECK_LIB([pthread], [pthread_kill], AC_CHECK_LIB([pthread], [pthread_kill],
[gl_have_pthread=yes [gl_have_pthread=yes
@ -203,9 +235,13 @@ int main ()
gl_have_solaristhread= gl_have_solaristhread=
gl_save_LIBS="$LIBS" gl_save_LIBS="$LIBS"
LIBS="$LIBS -lthread" LIBS="$LIBS -lthread"
AC_TRY_LINK([#include <thread.h> AC_LINK_IFELSE(
#include <synch.h>], [AC_LANG_PROGRAM(
[thr_self();], [[
#include <thread.h>
#include <synch.h>
]],
[[thr_self();]])],
[gl_have_solaristhread=yes]) [gl_have_solaristhread=yes])
LIBS="$gl_save_LIBS" LIBS="$gl_save_LIBS"
if test -n "$gl_have_solaristhread"; then if test -n "$gl_have_solaristhread"; then
@ -230,8 +266,10 @@ int main ()
AC_LIB_LINKFLAGS([pth]) AC_LIB_LINKFLAGS([pth])
gl_have_pth= gl_have_pth=
gl_save_LIBS="$LIBS" gl_save_LIBS="$LIBS"
LIBS="$LIBS -lpth" LIBS="$LIBS $LIBPTH"
AC_TRY_LINK([#include <pth.h>], [pth_self();], [gl_have_pth=yes]) AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
[gl_have_pth=yes])
LIBS="$gl_save_LIBS" LIBS="$gl_save_LIBS"
if test -n "$gl_have_pth"; then if test -n "$gl_have_pth"; then
gl_threads_api=pth gl_threads_api=pth
@ -254,17 +292,19 @@ int main ()
fi fi
fi fi
if test -z "$gl_have_pthread"; then if test -z "$gl_have_pthread"; then
if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then case "$gl_use_threads" in
yes | windows | win32) # The 'win32' is for backward compatibility.
if { case "$host_os" in if { case "$host_os" in
mingw*) true;; mingw*) true;;
*) false;; *) false;;
esac esac
}; then }; then
gl_threads_api=win32 gl_threads_api=windows
AC_DEFINE([USE_WIN32_THREADS], [1], AC_DEFINE([USE_WINDOWS_THREADS], [1],
[Define if the Win32 multithreading API can be used.]) [Define if the native Windows multithreading API can be used.])
fi
fi fi
;;
esac
fi fi
fi fi
AC_MSG_CHECKING([for multithread API to use]) AC_MSG_CHECKING([for multithread API to use])
@ -302,6 +342,8 @@ dnl Linux 2.4/glibc posix -lpthread Y OK
dnl dnl
dnl GNU Hurd/glibc posix dnl GNU Hurd/glibc posix
dnl dnl
dnl Ubuntu 14.04 posix -pthread Y OK
dnl
dnl FreeBSD 5.3 posix -lc_r Y dnl FreeBSD 5.3 posix -lc_r Y
dnl posix -lkse ? Y dnl posix -lkse ? Y
dnl posix -lpthread ? Y dnl posix -lpthread ? Y
@ -317,7 +359,7 @@ dnl NetBSD 1.6 --
dnl dnl
dnl OpenBSD 3.4 posix -lpthread Y OK dnl OpenBSD 3.4 posix -lpthread Y OK
dnl dnl
dnl MacOS X 10.[123] posix -lpthread Y OK dnl Mac OS X 10.[123] posix -lpthread Y OK
dnl dnl
dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
@ -336,7 +378,7 @@ dnl Cygwin posix -lpthread Y OK
dnl dnl
dnl Any of the above pth -lpth 0.0 dnl Any of the above pth -lpth 0.0
dnl dnl
dnl Mingw win32 N OK dnl Mingw windows N OK
dnl dnl
dnl BeOS 5 -- dnl BeOS 5 --
dnl dnl

View File

@ -1,5 +1,5 @@
# uintmax_t.m4 serial 12 # uintmax_t.m4 serial 12
dnl Copyright (C) 1997-2004, 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 1997-2004, 2007-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.

View File

@ -1,5 +1,5 @@
# visibility.m4 serial 3 (gettext-0.18) # visibility.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -12,7 +12,7 @@ dnl __attribute__((__visibility__("hidden"))) and
dnl __attribute__((__visibility__("default"))). dnl __attribute__((__visibility__("default"))).
dnl Does *not* test for __visibility__("protected") - which has tricky dnl Does *not* test for __visibility__("protected") - which has tricky
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
dnl MacOS X. dnl Mac OS X.
dnl Does *not* test for __visibility__("internal") - which has processor dnl Does *not* test for __visibility__("internal") - which has processor
dnl dependent semantics. dnl dependent semantics.
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
@ -33,7 +33,8 @@ AC_DEFUN([gl_VISIBILITY],
AC_CACHE_VAL([gl_cv_cc_vis_werror], [ AC_CACHE_VAL([gl_cv_cc_vis_werror], [
gl_save_CFLAGS="$CFLAGS" gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror" CFLAGS="$CFLAGS -Werror"
AC_TRY_COMPILE([], [], AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_cc_vis_werror=yes], [gl_cv_cc_vis_werror=yes],
[gl_cv_cc_vis_werror=no]) [gl_cv_cc_vis_werror=no])
CFLAGS="$gl_save_CFLAGS"]) CFLAGS="$gl_save_CFLAGS"])
@ -51,13 +52,15 @@ AC_DEFUN([gl_VISIBILITY],
if test $gl_cv_cc_vis_werror = yes; then if test $gl_cv_cc_vis_werror = yes; then
CFLAGS="$CFLAGS -Werror" CFLAGS="$CFLAGS -Werror"
fi fi
AC_TRY_COMPILE( AC_COMPILE_IFELSE(
[extern __attribute__((__visibility__("hidden"))) int hiddenvar; [AC_LANG_PROGRAM(
[[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("default"))) int exportedvar;
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
extern __attribute__((__visibility__("default"))) int exportedfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void);
void dummyfunc (void) {}], void dummyfunc (void) {}
[], ]],
[[]])],
[gl_cv_cc_visibility=yes], [gl_cv_cc_visibility=yes],
[gl_cv_cc_visibility=no]) [gl_cv_cc_visibility=no])
CFLAGS="$gl_save_CFLAGS"]) CFLAGS="$gl_save_CFLAGS"])

View File

@ -1,5 +1,5 @@
# wchar_t.m4 serial 3 (gettext-0.18) # wchar_t.m4 serial 4 (gettext-0.18.2)
dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2002-2003, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -11,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WCHAR_T], AC_DEFUN([gt_TYPE_WCHAR_T],
[ [
AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
[AC_TRY_COMPILE([#include <stddef.h> [AC_COMPILE_IFELSE(
wchar_t foo = (wchar_t)'\0';], , [AC_LANG_PROGRAM(
[gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) [[#include <stddef.h>
wchar_t foo = (wchar_t)'\0';]],
[[]])],
[gt_cv_c_wchar_t=yes],
[gt_cv_c_wchar_t=no])])
if test $gt_cv_c_wchar_t = yes; then if test $gt_cv_c_wchar_t = yes; then
AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
fi fi

View File

@ -1,5 +1,5 @@
# wint_t.m4 serial 4 (gettext-0.18) # wint_t.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -11,7 +11,9 @@ dnl Prerequisite: AC_PROG_CC
AC_DEFUN([gt_TYPE_WINT_T], AC_DEFUN([gt_TYPE_WINT_T],
[ [
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>. <wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <wchar.h> #include <wchar.h>
wint_t foo = (wchar_t)'\0';], , wint_t foo = (wchar_t)'\0';]],
[gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) [[]])],
[gt_cv_c_wint_t=yes],
[gt_cv_c_wint_t=no])])
if test $gt_cv_c_wint_t = yes; then if test $gt_cv_c_wint_t = yes; then
AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
fi fi

View File

@ -1,5 +1,5 @@
# xsize.m4 serial 4 # xsize.m4 serial 5
dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc. dnl Copyright (C) 2003-2004, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved. dnl with or without modifications, as long as this notice is preserved.
@ -8,6 +8,5 @@ AC_DEFUN([gl_XSIZE],
[ [
dnl Prerequisites of lib/xsize.h. dnl Prerequisites of lib/xsize.h.
AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([gl_SIZE_MAX])
AC_REQUIRE([AC_C_INLINE])
AC_CHECK_HEADERS([stdint.h]) AC_CHECK_HEADERS([stdint.h])
]) ])

View File

@ -8,13 +8,14 @@
# Please note that the actual code of GNU gettext is covered by the GNU # Please note that the actual code of GNU gettext is covered by the GNU
# General Public License and is *not* in the public domain. # General Public License and is *not* in the public domain.
# #
# Origin: gettext-0.18 # Origin: gettext-0.19
GETTEXT_MACRO_VERSION = 0.18 GETTEXT_MACRO_VERSION = 0.19
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
VERSION = @VERSION@ VERSION = @VERSION@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
SED = @SED@
SHELL = /bin/sh SHELL = /bin/sh
@SET_MAKE@ @SET_MAKE@
@ -56,8 +57,8 @@ XGETTEXT_ = @XGETTEXT@
XGETTEXT_no = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@
XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT_yes = @XGETTEXT_015@
XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
MSGMERGE = msgmerge --previous MSGMERGE = msgmerge
MSGMERGE_UPDATE = @MSGMERGE@ --previous --update MSGMERGE_UPDATE = @MSGMERGE@ --update
MSGINIT = msginit MSGINIT = msginit
MSGCONV = msgconv MSGCONV = msgconv
MSGFILTER = msgfilter MSGFILTER = msgfilter
@ -76,6 +77,16 @@ POTFILES = \
CATALOGS = @CATALOGS@ CATALOGS = @CATALOGS@
POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
POFILESDEPS_yes = $(POFILESDEPS_)
POFILESDEPS_no =
POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
DISTFILESDEPS_ = update-po
DISTFILESDEPS_yes = $(DISTFILESDEPS_)
DISTFILESDEPS_no =
DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
# Makevars gets inserted here. (Don't remove this line!) # Makevars gets inserted here. (Don't remove this line!)
.SUFFIXES: .SUFFIXES:
@ -96,14 +107,14 @@ CATALOGS = @CATALOGS@
mv t-$@ $@ mv t-$@ $@
all: check-macro-version all-@USE_NLS@ all: all-@USE_NLS@
all-yes: stamp-po all-yes: stamp-po
all-no: all-no:
# Ensure that the gettext macros and this Makefile.in.in are in sync. # Ensure that the gettext macros and this Makefile.in.in are in sync.
check-macro-version: CHECK_MACRO_VERSION = \
@test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
|| { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
exit 1; \ exit 1; \
} }
@ -123,6 +134,7 @@ check-macro-version:
# $(POFILES) has been designed to not touch files that don't need to be # $(POFILES) has been designed to not touch files that don't need to be
# changed. # changed.
stamp-po: $(srcdir)/$(DOMAIN).pot stamp-po: $(srcdir)/$(DOMAIN).pot
@$(CHECK_MACRO_VERSION)
test ! -f $(srcdir)/$(DOMAIN).pot || \ test ! -f $(srcdir)/$(DOMAIN).pot || \
test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
@test ! -f $(srcdir)/$(DOMAIN).pot || { \ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
@ -137,11 +149,29 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
# This target rebuilds $(DOMAIN).pot; it is an expensive operation. # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
# The determination of whether the package xyz is a GNU one is based on the
# heuristic whether some file in the top level directory mentions "GNU xyz".
# If GNU 'find' is available, we avoid grepping through monster files.
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu="$(PACKAGE_GNU)"; \
package_gnu='GNU '; \ test -n "$$package_gnu" || { \
if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
-size -10000000c -exec grep 'GNU @PACKAGE@' \
/dev/null '{}' ';' 2>/dev/null; \
else \ else \
package_gnu=''; \ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
fi; \
} | grep -v 'libtool:' >/dev/null; then \
package_gnu=yes; \
else \
package_gnu=no; \
fi; \
}; \
if test "$$package_gnu" = "yes"; then \
package_prefix='GNU '; \
else \
package_prefix=''; \
fi; \ fi; \
if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
@ -161,7 +191,7 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
--files-from=$(srcdir)/POTFILES.in \ --files-from=$(srcdir)/POTFILES.in \
--copyright-holder='$(COPYRIGHT_HOLDER)' \ --copyright-holder='$(COPYRIGHT_HOLDER)' \
--package-name="$${package_gnu}@PACKAGE@" \ --package-name="$${package_prefix}@PACKAGE@" \
--package-version='@VERSION@' \ --package-version='@VERSION@' \
--msgid-bugs-address="$$msgid_bugs_address" \ --msgid-bugs-address="$$msgid_bugs_address" \
;; \ ;; \
@ -189,9 +219,10 @@ $(srcdir)/$(DOMAIN).pot:
# This target rebuilds a PO file if $(DOMAIN).pot has changed. # This target rebuilds a PO file if $(DOMAIN).pot has changed.
# Note that a PO file is not touched if it doesn't need to be changed. # Note that a PO file is not touched if it doesn't need to be changed.
$(POFILES): $(srcdir)/$(DOMAIN).pot $(POFILES): $(POFILESDEPS)
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
if test -f "$(srcdir)/$${lang}.po"; then \ if test -f "$(srcdir)/$${lang}.po"; then \
test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
cd $(srcdir) \ cd $(srcdir) \
@ -352,7 +383,7 @@ maintainer-clean: distclean
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: dist distdir:
$(MAKE) update-po test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
@$(MAKE) dist2 @$(MAKE) dist2
# This is a separate target because 'update-po' must be executed before. # This is a separate target because 'update-po' must be executed before.
dist2: stamp-po $(DISTFILES) dist2: stamp-po $(DISTFILES)

View File

@ -34,9 +34,49 @@ COPYRIGHT_HOLDER = Free Software Foundation, Inc.
# It can be your email address, or a mailing list address where translators # It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through # can write to without being subscribed, or the URL of a web page through
# which the translators can contact you. # which the translators can contact you.
MSGID_BUGS_ADDRESS = gnupg-i18n@gnupg.org MSGID_BUGS_ADDRESS = translations@gnupg.org
# This is the list of locale categories, beyond LC_MESSAGES, for which the # This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty. # message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES = EXTRA_LOCALE_CATEGORIES =
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS = --previous
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS =
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = yes
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes

View File

@ -1,3 +1,4 @@
# This file, Rules-quot, can be copied and used freely without restrictions.
# Special Makefile rules for English message catalogs with quotation marks. # Special Makefile rules for English message catalogs with quotation marks.
DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
@ -14,13 +15,23 @@ en@boldquot.po-update: en@boldquot.po-update-en
.insert-header.po-update-en: .insert-header.po-update-en:
@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
tmpdir=`pwd`; \ tmpdir=`pwd`; \
echo "$$lang:"; \ echo "$$lang:"; \
ll=`echo $$lang | sed -e 's/@.*//'`; \ ll=`echo $$lang | sed -e 's/@.*//'`; \
LC_ALL=C; export LC_ALL; \ LC_ALL=C; export LC_ALL; \
cd $(srcdir); \ cd $(srcdir); \
if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \
| $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \
{ case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
$(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
;; \
*) \
$(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
;; \
esac } 2>/dev/null > $$tmpdir/$$lang.new.po \
; then \
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
rm -f $$tmpdir/$$lang.new.po; \ rm -f $$tmpdir/$$lang.new.po; \
else \ else \

View File

@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the # Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable. # run time search path of shared libraries in an executable.
# #
# Copyright 1996-2010 Free Software Foundation, Inc. # Copyright 1996-2014 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001 # Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #
@ -25,7 +25,7 @@
# known workaround is to choose shorter directory names for the build # known workaround is to choose shorter directory names for the build
# directory and/or the installation directory. # directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC, # All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib'). # which needs '.lib').
libext=a libext=a
shrext=.so shrext=.so
@ -57,13 +57,6 @@ else
aix*) aix*)
wl='-Wl,' wl='-Wl,'
;; ;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | cygwin* | pw32* | os2* | cegcc*) mingw* | cygwin* | pw32* | os2* | cegcc*)
;; ;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
@ -72,9 +65,7 @@ else
irix5* | irix6* | nonstopux*) irix5* | irix6* | nonstopux*)
wl='-Wl,' wl='-Wl,'
;; ;;
newsos6) linux* | k*bsd*-gnu | kopensolaris*-gnu)
;;
linux* | k*bsd*-gnu)
case $cc_basename in case $cc_basename in
ecc*) ecc*)
wl='-Wl,' wl='-Wl,'
@ -85,17 +76,26 @@ else
lf95*) lf95*)
wl='-Wl,' wl='-Wl,'
;; ;;
pgcc | pgf77 | pgf90) nagfor*)
wl='-Wl,-Wl,,'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,' wl='-Wl,'
;; ;;
ccc*) ccc*)
wl='-Wl,' wl='-Wl,'
;; ;;
xl* | bgxl* | bgf* | mpixl*)
wl='-Wl,'
;;
como) como)
wl='-lopt=' wl='-lopt='
;; ;;
*) *)
case `$CC -V 2>&1 | sed 5q` in case `$CC -V 2>&1 | sed 5q` in
*Sun\ F* | *Sun*Fortran*)
wl=
;;
*Sun\ C*) *Sun\ C*)
wl='-Wl,' wl='-Wl,'
;; ;;
@ -103,14 +103,25 @@ else
;; ;;
esac esac
;; ;;
newsos6)
;;
*nto* | *qnx*)
;;
osf3* | osf4* | osf5*) osf3* | osf4* | osf5*)
wl='-Wl,' wl='-Wl,'
;; ;;
rdos*) rdos*)
;; ;;
solaris*) solaris*)
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
wl='-Qoption ld '
;;
*)
wl='-Wl,' wl='-Wl,'
;; ;;
esac
;;
sunos4*) sunos4*)
wl='-Qoption ld ' wl='-Qoption ld '
;; ;;
@ -171,15 +182,14 @@ if test "$with_gnu_ld" = yes; then
fi fi
;; ;;
amigaos*) amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports ;;
# that the semantics of dynamic libraries on AmigaOS, at least up esac
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;; ;;
beos*) beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
@ -198,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no ld_shlibs=no
fi fi
;; ;;
haiku*)
;;
interix[3-9]*) interix[3-9]*)
hardcode_direct=no hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir' hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;; ;;
gnu* | linux* | k*bsd*-gnu) gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
: :
else else
@ -325,10 +337,14 @@ else
fi fi
;; ;;
amigaos*) amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section ;;
ld_shlibs=no esac
;; ;;
bsdi[45]*) bsdi[45]*)
;; ;;
@ -342,29 +358,16 @@ else
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
hardcode_direct=no hardcode_direct=no
if test "$GCC" = yes ; then if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
: :
else else
case $cc_basename in
xlc*)
;;
*)
ld_shlibs=no ld_shlibs=no
;;
esac
fi fi
;; ;;
dgux*) dgux*)
hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_flag_spec='-L$libdir'
;; ;;
freebsd1*) freebsd2.[01]*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes hardcode_direct=yes
hardcode_minus_L=yes hardcode_minus_L=yes
;; ;;
@ -420,6 +423,8 @@ else
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=: hardcode_libdir_separator=:
;; ;;
*nto* | *qnx*)
;;
openbsd*) openbsd*)
if test -f /usr/libexec/ld.so; then if test -f /usr/libexec/ld.so; then
hardcode_direct=yes hardcode_direct=yes
@ -515,7 +520,12 @@ case "$host_os" in
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
amigaos*) amigaos*)
library_names_spec='$libname.a' case "$host_cpu" in
powerpc*)
library_names_spec='$libname$shrext' ;;
m68k)
library_names_spec='$libname.a' ;;
esac
;; ;;
beos*) beos*)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
@ -534,19 +544,18 @@ case "$host_os" in
dgux*) dgux*)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
freebsd1*) freebsd[23].*)
library_names_spec='$libname$shrext$versuffix'
;; ;;
freebsd* | dragonfly*) freebsd* | dragonfly*)
case "$host_os" in library_names_spec='$libname$shrext'
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;; ;;
gnu*) gnu*)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
haiku*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
case $host_cpu in case $host_cpu in
ia64*) ia64*)
@ -582,7 +591,7 @@ case "$host_os" in
;; ;;
linux*oldld* | linux*aout* | linux*coff*) linux*oldld* | linux*aout* | linux*coff*)
;; ;;
linux* | k*bsd*-gnu) linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
knetbsd*-gnu) knetbsd*-gnu)
@ -594,7 +603,7 @@ case "$host_os" in
newsos6) newsos6)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
nto-qnx*) *nto* | *qnx*)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
openbsd*) openbsd*)
@ -625,6 +634,9 @@ case "$host_os" in
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;
tpf*)
library_names_spec='$libname$shrext'
;;
uts4*) uts4*)
library_names_spec='$libname$shrext' library_names_spec='$libname$shrext'
;; ;;