From: Bruno Haible Date: Sun, 4 Oct 2020 21:40:53 +0000 (+0200) Subject: build: Assume ANSI C declaration of 'setlocale'. X-Git-Tag: v0.21.1~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ca10c434d52f75cd5cb5cfc15a0f5b24187adca;p=thirdparty%2Fgettext.git build: Assume ANSI C declaration of 'setlocale'. * gettext-tools/tests/setlocale.c (setlocale): Assume SETLOCALE_CONST is 'const'. * gettext-tools/tests/format-c-3-prg.c: Likewise. * gettext-tools/tests/format-c-4-prg.c: Likewise. * gettext-tools/tests/plural-1-prg.c: Likewise. * gettext-tools/tests/tstgettext.c: Likewise. * gettext-tools/tests/tstngettext.c: Likewise. * gettext-tools/configure.ac: Don't invoke gt_SETLOCALE. * gettext-tools/m4/setlocale.m4: Remove file. * gettext-tools/m4/Makefile.am (EXTRA_DIST): Remove it. --- diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index ca6a43496..ce7416e42 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -223,7 +223,6 @@ gl_GLIBC21 dnl Checks for library functions. AC_CHECK_FUNCS([select]) gt_SIGINFO -gt_SETLOCALE AC_C_BIGENDIAN([endianness=1], [endianness=0], [echo "AC-C-BIGENDIAN fails to work on your system." | sed -e 's,-,_,g' 1>&2 diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am index 1eabe09df..55683aa81 100644 --- a/gettext-tools/m4/Makefile.am +++ b/gettext-tools/m4/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools/m4 directory of GNU gettext -## Copyright (C) 2003-2010, 2013, 2017-2019 Free Software Foundation, Inc. +## Copyright (C) 2003-2010, 2013, 2017-2020 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 @@ -44,5 +44,4 @@ EXTRA_DIST = README csharpexec-test.exe \ exported.m4 \ hostname.m4 \ locale-de.m4 \ -setlocale.m4 \ siginfo.m4 diff --git a/gettext-tools/m4/setlocale.m4 b/gettext-tools/m4/setlocale.m4 deleted file mode 100644 index 5b8fff020..000000000 --- a/gettext-tools/m4/setlocale.m4 +++ /dev/null @@ -1,31 +0,0 @@ -# setlocale.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2001-2002, 2006, 2009 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. - -# Check for setlocale declaration. - -AC_DEFUN([gt_SETLOCALE],[ -AC_MSG_CHECKING([for setlocale declaration]) -AC_CACHE_VAL(gt_cv_proto_setlocale, [ -AC_TRY_COMPILE([ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -char *setlocale (int category, char *locale); -#else -char *setlocale(); -#endif -], [], gt_cv_proto_setlocale_arg1="", gt_cv_proto_setlocale_arg1="const") -gt_cv_proto_setlocale="extern char *setlocale (int category, $gt_cv_proto_setlocale_arg1 char *locale);"]) -gt_cv_proto_setlocale=`echo "[$]gt_cv_proto_setlocale" | tr -s ' ' | sed -e 's/( /(/'` -AC_MSG_RESULT([ - $gt_cv_proto_setlocale]) -AC_DEFINE_UNQUOTED(SETLOCALE_CONST,$gt_cv_proto_setlocale_arg1, - [Define as const if the declaration of setlocale() needs const.]) -]) diff --git a/gettext-tools/tests/format-c-3-prg.c b/gettext-tools/tests/format-c-3-prg.c index e1ce8ef1b..804d468d5 100644 --- a/gettext-tools/tests/format-c-3-prg.c +++ b/gettext-tools/tests/format-c-3-prg.c @@ -42,7 +42,7 @@ #undef setlocale #if defined _WIN32 && !defined __CYGWIN__ # define setlocale fake_setlocale -extern char *setlocale (int category, SETLOCALE_CONST char *locale); +extern char *setlocale (int category, const char *locale); #endif #define _(string) gettext (string) diff --git a/gettext-tools/tests/format-c-4-prg.c b/gettext-tools/tests/format-c-4-prg.c index 8f796ff52..4dac6af79 100644 --- a/gettext-tools/tests/format-c-4-prg.c +++ b/gettext-tools/tests/format-c-4-prg.c @@ -42,7 +42,7 @@ #undef setlocale #if defined _WIN32 && !defined __CYGWIN__ # define setlocale fake_setlocale -extern char *setlocale (int category, SETLOCALE_CONST char *locale); +extern char *setlocale (int category, const char *locale); #endif #define _(string) gettext (string) diff --git a/gettext-tools/tests/plural-1-prg.c b/gettext-tools/tests/plural-1-prg.c index 0df74d240..982ea47ba 100644 --- a/gettext-tools/tests/plural-1-prg.c +++ b/gettext-tools/tests/plural-1-prg.c @@ -38,7 +38,7 @@ #undef setlocale #if defined _WIN32 && !defined __CYGWIN__ # define setlocale fake_setlocale -extern char *setlocale (int category, SETLOCALE_CONST char *locale); +extern char *setlocale (int category, const char *locale); #endif int diff --git a/gettext-tools/tests/setlocale.c b/gettext-tools/tests/setlocale.c index e69a69456..e48b38cf2 100644 --- a/gettext-tools/tests/setlocale.c +++ b/gettext-tools/tests/setlocale.c @@ -1,5 +1,5 @@ /* Fake setlocale - platform independent, for testing purposes. - Copyright (C) 2001-2002, 2019 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2019-2020 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 @@ -94,7 +94,7 @@ category_to_name (int category) actually change the behaviour of locale dependent functions. Assumes setenv()/putenv() is not called. */ char * -setlocale (int category, SETLOCALE_CONST char *locale) +setlocale (int category, const char *locale) { static char C_string[] = "C"; static char *current_locale = C_string; diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c index a706d9768..e473874fc 100644 --- a/gettext-tools/tests/tstgettext.c +++ b/gettext-tools/tests/tstgettext.c @@ -45,7 +45,7 @@ #if defined _WIN32 && !defined __CYGWIN__ # undef setlocale # define setlocale fake_setlocale -extern char *setlocale (int category, SETLOCALE_CONST char *locale); +extern char *setlocale (int category, const char *locale); #endif #define _(str) gettext (str) diff --git a/gettext-tools/tests/tstngettext.c b/gettext-tools/tests/tstngettext.c index 1ef13bb41..012399a3d 100644 --- a/gettext-tools/tests/tstngettext.c +++ b/gettext-tools/tests/tstngettext.c @@ -43,7 +43,7 @@ #if defined _WIN32 && !defined __CYGWIN__ # undef setlocale # define setlocale fake_setlocale -extern char *setlocale (int category, SETLOCALE_CONST char *locale); +extern char *setlocale (int category, const char *locale); #endif #define _(str) gettext (str)