From: Bruno Haible Date: Sun, 6 Jan 2019 21:55:46 +0000 (+0100) Subject: Assume setlocale function. X-Git-Tag: v0.20~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=899985167101315fc7f159a569bf9e05d7eb51bd;p=thirdparty%2Fgettext.git Assume setlocale function. * gettext-runtime/src/envsubst.c (main): Assume setlocale exists. * gettext-runtime/src/gettext.c (main): Likewise. * gettext-runtime/src/ngettext.c (main): Likewise. * gettext-tools/src/cldr-plurals.c (main): Likewise. * gettext-tools/src/hostname.c (main): Likewise. * gettext-tools/src/msgattrib.c (main): Likewise. * gettext-tools/src/msgcat.c (main): Likewise. * gettext-tools/src/msgcmp.c (main): Likewise. * gettext-tools/src/msgcomm.c (main): Likewise. * gettext-tools/src/msgconv.c (main): Likewise. * gettext-tools/src/msgen.c (main): Likewise. * gettext-tools/src/msgexec.c (main): Likewise. * gettext-tools/src/msgfilter.c (main): Likewise. * gettext-tools/src/msgfmt.c (main): Likewise. * gettext-tools/src/msggrep.c (main): Likewise. * gettext-tools/src/msginit.c (main, canonical_locale_charset, get_title): Likewise. * gettext-tools/src/msgmerge.c (main): Likewise. * gettext-tools/src/msgunfmt.c (main): Likewise. * gettext-tools/src/msguniq.c (main): Likewise. * gettext-tools/src/recode-sr-latin.c (main): Likewise. * gettext-tools/src/urlget.c (main): Likewise. * gettext-tools/src/xgettext.c (main): Likewise. * gettext-tools/tests/testlocale.c (main): Likewise. * gettext-tools/tests/tstgettext.c (main): Likewise. * gettext-tools/tests/tstngettext.c (main): Likewise. * gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Don't test whether setlocale exists. --- diff --git a/gettext-runtime/m4/intl.m4 b/gettext-runtime/m4/intl.m4 index 4a766e631..c3d460b71 100644 --- a/gettext-runtime/m4/intl.m4 +++ b/gettext-runtime/m4/intl.m4 @@ -1,5 +1,5 @@ -# intl.m4 serial 35 (gettext-0.19.9) -dnl Copyright (C) 1995-2014, 2016-2018 Free Software Foundation, Inc. +# intl.m4 serial 36 (gettext-0.19.9) +dnl Copyright (C) 1995-2014, 2016-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -73,7 +73,7 @@ AC_DEFUN([AM_INTL_SUBDIR], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) 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 \ snprintf strnlen uselocale wcslen wcsnlen mbrtowc wcrtomb]) dnl Use the _snprintf function only if it is declared (because on NetBSD it diff --git a/gettext-runtime/src/envsubst.c b/gettext-runtime/src/envsubst.c index 93215b5a0..45a277d19 100644 --- a/gettext-runtime/src/envsubst.c +++ b/gettext-runtime/src/envsubst.c @@ -1,5 +1,5 @@ /* Substitution of environment variables in shell format strings. - Copyright (C) 2003-2007, 2012, 2018 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2012, 2018-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -75,10 +75,8 @@ main (int argc, char *argv[]) /* Set program name for message texts. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-runtime/src/gettext.c b/gettext-runtime/src/gettext.c index f14675f02..1d53f0562 100644 --- a/gettext-runtime/src/gettext.c +++ b/gettext-runtime/src/gettext.c @@ -1,5 +1,5 @@ /* gettext - retrieve text string from message catalog and print it. - Copyright (C) 1995-1997, 2000-2007, 2012, 2015-2018 Free Software + Copyright (C) 1995-1997, 2000-2007, 2012, 2015-2019 Free Software Foundation, Inc. Written by Ulrich Drepper , May 1995. @@ -84,10 +84,8 @@ main (int argc, char *argv[]) /* Set program name for message texts. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-runtime/src/ngettext.c b/gettext-runtime/src/ngettext.c index 59a0126b9..da038a5f4 100644 --- a/gettext-runtime/src/ngettext.c +++ b/gettext-runtime/src/ngettext.c @@ -1,5 +1,5 @@ /* ngettext - retrieve plural form string from message catalog and print it. - Copyright (C) 1995-1997, 2000-2007, 2015-2018 Free Software Foundation, Inc. + Copyright (C) 1995-1997, 2000-2007, 2015-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -79,10 +79,8 @@ main (int argc, char *argv[]) /* Set program name for message texts. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/cldr-plurals.c b/gettext-tools/src/cldr-plurals.c index 10c469ac0..e8228cdb5 100644 --- a/gettext-tools/src/cldr-plurals.c +++ b/gettext-tools/src/cldr-plurals.c @@ -1,5 +1,5 @@ /* Unicode CLDR plural rule parser and converter - Copyright (C) 2015-2018 Free Software Foundation, Inc. + Copyright (C) 2015-2019 Free Software Foundation, Inc. This file was written by Daiki Ueno , 2015. @@ -247,10 +247,8 @@ main (int argc, char **argv) /* Set program name for messages. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/hostname.c b/gettext-tools/src/hostname.c index e74bf3e5f..58bc59323 100644 --- a/gettext-tools/src/hostname.c +++ b/gettext-tools/src/hostname.c @@ -1,5 +1,5 @@ /* Display hostname in various forms. - Copyright (C) 2001-2003, 2006-2007, 2012, 2015-2016, 2018 Free Software + Copyright (C) 2001-2003, 2006-2007, 2012, 2015-2016, 2018-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -129,10 +129,8 @@ main (int argc, char *argv[]) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgattrib.c b/gettext-tools/src/msgattrib.c index ff38dc666..e1400b761 100644 --- a/gettext-tools/src/msgattrib.c +++ b/gettext-tools/src/msgattrib.c @@ -1,5 +1,5 @@ /* Manipulates attributes of messages in translation catalogs. - Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -157,10 +157,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgcat.c b/gettext-tools/src/msgcat.c index f35a4f852..53df1851d 100644 --- a/gettext-tools/src/msgcat.c +++ b/gettext-tools/src/msgcat.c @@ -1,5 +1,5 @@ /* Concatenates several translation catalogs. - Copyright (C) 2001-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -124,10 +124,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgcmp.c b/gettext-tools/src/msgcmp.c index d27807ce2..9ebeac818 100644 --- a/gettext-tools/src/msgcmp.c +++ b/gettext-tools/src/msgcmp.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1998, 2000-2010, 2012, 2015-2018 Free Software + Copyright (C) 1995-1998, 2000-2010, 2012, 2015-2019 Free Software Foundation, Inc. This file was written by Peter Miller @@ -102,10 +102,8 @@ main (int argc, char *argv[]) error_print_progname = maybe_print_progname; gram_max_allowed_errors = UINT_MAX; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgcomm.c b/gettext-tools/src/msgcomm.c index 9f7b0b236..42e0a591f 100644 --- a/gettext-tools/src/msgcomm.c +++ b/gettext-tools/src/msgcomm.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1997-1998, 2000-2007, 2009-2018 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2000-2007, 2009-2019 Free Software Foundation, Inc. This file was written by Peter Miller @@ -123,10 +123,8 @@ main (int argc, char *argv[]) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgconv.c b/gettext-tools/src/msgconv.c index 409b4cb43..cc0e032b5 100644 --- a/gettext-tools/src/msgconv.c +++ b/gettext-tools/src/msgconv.c @@ -1,5 +1,5 @@ /* Converts a translation catalog to a different character encoding. - Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -113,10 +113,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgen.c b/gettext-tools/src/msgen.c index 38190f746..b71209b1d 100644 --- a/gettext-tools/src/msgen.c +++ b/gettext-tools/src/msgen.c @@ -1,5 +1,5 @@ /* Creates an English translation catalog. - Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -111,10 +111,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgexec.c b/gettext-tools/src/msgexec.c index 89ac7e066..5d4693e6c 100644 --- a/gettext-tools/src/msgexec.c +++ b/gettext-tools/src/msgexec.c @@ -1,5 +1,5 @@ /* Pass translations to a subprocess. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -114,10 +114,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgfilter.c b/gettext-tools/src/msgfilter.c index ae64240d8..2514f0b22 100644 --- a/gettext-tools/src/msgfilter.c +++ b/gettext-tools/src/msgfilter.c @@ -1,5 +1,5 @@ /* Edit translations using a subprocess. - Copyright (C) 2001-2010, 2012, 2015-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -146,10 +146,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgfmt.c b/gettext-tools/src/msgfmt.c index d8221952b..2c7bca369 100644 --- a/gettext-tools/src/msgfmt.c +++ b/gettext-tools/src/msgfmt.c @@ -1,5 +1,5 @@ /* Converts Uniforum style .po files to binary .mo files - Copyright (C) 1995-1998, 2000-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 1995-1998, 2000-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. @@ -260,10 +260,8 @@ main (int argc, char *argv[]) error_one_per_line = 1; exit_status = EXIT_SUCCESS; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msggrep.c b/gettext-tools/src/msggrep.c index c040b6724..476ebb73c 100644 --- a/gettext-tools/src/msggrep.c +++ b/gettext-tools/src/msggrep.c @@ -1,5 +1,5 @@ /* Extract some translations of a translation catalog. - Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -164,10 +164,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index f7c12dcc9..7410ef305 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -1,5 +1,5 @@ /* Initializes a new PO file. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -161,10 +161,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); @@ -789,12 +787,10 @@ canonical_locale_charset () xsetenv ("LC_ALL", locale, 1); -#ifdef HAVE_SETLOCALE if (setlocale (LC_ALL, "") == NULL) /* Nonexistent locale. Use anything. */ charset = ""; else -#endif /* Get the locale's charset. */ charset = locale_charset (); @@ -805,9 +801,7 @@ canonical_locale_charset () else unsetenv ("LC_ALL"); -#ifdef HAVE_SETLOCALE setlocale (LC_ALL, ""); -#endif /* Canonicalize it. */ charset = po_charset_canonicalize (charset); @@ -1610,12 +1604,10 @@ get_title () unsetenv ("LANGUAGE"); xsetenv ("OUTPUT_CHARSET", encoding, 1); -#ifdef HAVE_SETLOCALE if (setlocale (LC_ALL, "") == NULL) /* Nonexistent locale. Use the English title. */ result = english; else -#endif { /* Fetch the translation. */ /* TRANSLATORS: "English" needs to be replaced by your language. @@ -1648,9 +1640,7 @@ get_title () else unsetenv ("OUTPUT_CHARSET"); -#ifdef HAVE_SETLOCALE setlocale (LC_ALL, ""); -#endif return result; } diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index 60b51221a..e4803baf4 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1998, 2000-2010, 2012, 2015-2018 Free Software + Copyright (C) 1995-1998, 2000-2010, 2012, 2015-2019 Free Software Foundation, Inc. This file was written by Peter Miller @@ -197,10 +197,8 @@ main (int argc, char **argv) quiet = false; gram_max_allowed_errors = UINT_MAX; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msgunfmt.c b/gettext-tools/src/msgunfmt.c index 565e14bca..7eb4aa3c5 100644 --- a/gettext-tools/src/msgunfmt.c +++ b/gettext-tools/src/msgunfmt.c @@ -1,5 +1,5 @@ /* msgunfmt - converts binary .mo files to Uniforum style .po files - Copyright (C) 1995-1998, 2000-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 1995-1998, 2000-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. @@ -129,10 +129,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/msguniq.c b/gettext-tools/src/msguniq.c index 22f7c83d7..b56d75b4e 100644 --- a/gettext-tools/src/msguniq.c +++ b/gettext-tools/src/msguniq.c @@ -1,5 +1,5 @@ /* Remove, select or merge duplicate translations. - Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2018 Free Software + Copyright (C) 2001-2007, 2009-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -117,10 +117,8 @@ main (int argc, char **argv) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/recode-sr-latin.c b/gettext-tools/src/recode-sr-latin.c index 512204da4..f73b79463 100644 --- a/gettext-tools/src/recode-sr-latin.c +++ b/gettext-tools/src/recode-sr-latin.c @@ -1,5 +1,5 @@ /* Recode Serbian text from Cyrillic to Latin script. - Copyright (C) 2006-2007, 2010, 2012, 2015-2018 Free Software Foundation, + Copyright (C) 2006-2007, 2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2006. @@ -75,10 +75,8 @@ main (int argc, char *argv[]) /* Set program name for message texts. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/urlget.c b/gettext-tools/src/urlget.c index 82d857953..a6c5b25d1 100644 --- a/gettext-tools/src/urlget.c +++ b/gettext-tools/src/urlget.c @@ -1,5 +1,5 @@ /* Get the contents of an URL. - Copyright (C) 2001-2003, 2005-2010, 2012, 2015-2018 Free Software + Copyright (C) 2001-2003, 2005-2010, 2012, 2015-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. @@ -100,10 +100,8 @@ main (int argc, char *argv[]) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 63f7c3f7c..f42d4482f 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -1,5 +1,5 @@ /* Extracts strings from C source file to Uniforum style .po file. - Copyright (C) 1995-1998, 2000-2016, 2018 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2016, 2018-2019 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. This program is free software: you can redistribute it and/or modify @@ -333,10 +333,8 @@ main (int argc, char *argv[]) set_program_name (argv[0]); error_print_progname = maybe_print_progname; -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); diff --git a/gettext-tools/tests/testlocale.c b/gettext-tools/tests/testlocale.c index e001afc86..eca617e78 100644 --- a/gettext-tools/tests/testlocale.c +++ b/gettext-tools/tests/testlocale.c @@ -1,5 +1,5 @@ /* testlocale - test whether the locale given by the environment is installed. - Copyright (C) 2003, 2006, 2015-2016 Free Software Foundation, Inc. + Copyright (C) 2003, 2006, 2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ int main (int argc, char *argv[]) { /* This test must match the one in intl/localename.c. */ -#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL +#if defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL if (setlocale (LC_ALL, "") == NULL) /* Couldn't set locale. */ exit (77); diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c index 4a9e6bdce..cb44c8dbc 100644 --- a/gettext-tools/tests/tstgettext.c +++ b/gettext-tools/tests/tstgettext.c @@ -1,5 +1,5 @@ /* gettext - retrieve text string from message catalog and print it. - Copyright (C) 1995-1997, 2000-2007, 2012, 2015-2018 Free Software + Copyright (C) 1995-1997, 2000-2007, 2012, 2015-2019 Free Software Foundation, Inc. Written by Ulrich Drepper , May 1995. @@ -36,7 +36,6 @@ #include "propername.h" #include "xsetenv.h" -#define HAVE_SETLOCALE 1 /* Make sure we use the included libintl, not the system's one. */ #undef _LIBINTL_H #include "libgnuintl.h" @@ -89,10 +88,8 @@ main (int argc, char *argv[]) /* Set program name for message texts. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); @@ -146,11 +143,9 @@ main (int argc, char *argv[]) usage (EXIT_FAILURE); } -#ifdef HAVE_SETLOCALE if (environ_changed) /* Set locale again via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Version information is requested. */ if (do_version) diff --git a/gettext-tools/tests/tstngettext.c b/gettext-tools/tests/tstngettext.c index 5f68f2aba..cbc249de2 100644 --- a/gettext-tools/tests/tstngettext.c +++ b/gettext-tools/tests/tstngettext.c @@ -1,5 +1,5 @@ /* ngettext - retrieve plural form strings from message catalog and print them. - Copyright (C) 1995-1997, 2000-2007, 2012, 2015-2018 Free Software + Copyright (C) 1995-1997, 2000-2007, 2012, 2015-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -34,7 +34,6 @@ #include "propername.h" #include "xsetenv.h" -#define HAVE_SETLOCALE 1 /* Make sure we use the included libintl, not the system's one. */ #undef _LIBINTL_H #include "libgnuintl.h" @@ -77,10 +76,8 @@ main (int argc, char *argv[]) /* Set program name for message texts. */ set_program_name (argv[0]); -#ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Set the text message domain. */ bindtextdomain (PACKAGE, relocate (LOCALEDIR)); @@ -122,11 +119,9 @@ main (int argc, char *argv[]) usage (EXIT_FAILURE); } -#ifdef HAVE_SETLOCALE if (environ_changed) /* Set locale again via LC_ALL. */ setlocale (LC_ALL, ""); -#endif /* Version information is requested. */ if (do_version) diff --git a/os2/configure.awk b/os2/configure.awk index ccf60e39d..f40e517be 100644 --- a/os2/configure.awk +++ b/os2/configure.awk @@ -21,7 +21,6 @@ BEGIN{ cfg["HAVE_MEMMOVE"] = 1; cfg["HAVE_MEMSET"] = 1; cfg["HAVE_PUTENV"] = 1; - cfg["HAVE_SETLOCALE"] = 1; cfg["HAVE_STRCHR"] = 1; cfg["HAVE_STRCSPN"] = 1; cfg["HAVE_STRDUP"] = 1;