]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Assume ANSI C declaration of 'setlocale'.
authorBruno Haible <bruno@clisp.org>
Sun, 4 Oct 2020 21:40:53 +0000 (23:40 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Sep 2022 12:52:56 +0000 (14:52 +0200)
* 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.

gettext-tools/configure.ac
gettext-tools/m4/Makefile.am
gettext-tools/m4/setlocale.m4 [deleted file]
gettext-tools/tests/format-c-3-prg.c
gettext-tools/tests/format-c-4-prg.c
gettext-tools/tests/plural-1-prg.c
gettext-tools/tests/setlocale.c
gettext-tools/tests/tstgettext.c
gettext-tools/tests/tstngettext.c

index ca6a43496269eaf12fa9426d0e24733bf43f99ab..ce7416e4272d522d334c7bd3b294de039028b0a2 100644 (file)
@@ -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
index 1eabe09df82259e3e96ceee88aee16fc42fb3aad..55683aa81f2e98272a642a13eaea5251e77caa83 100644 (file)
@@ -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 (file)
index 5b8fff0..0000000
+++ /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 <stdlib.h>
-#include <locale.h>
-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.])
-])
index e1ce8ef1b3b80eac990411f0ff74ca1f19a15243..804d468d5b33159e893ac9ae45921ea8ac40f08c 100644 (file)
@@ -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)
index 8f796ff52dad710c52759c3b705ad85f7cf4c480..4dac6af79ad2cfddc822f9cf9d31ec346bebfbe5 100644 (file)
@@ -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)
index 0df74d2403d46d6b615fd3e5c21d077b9294d085..982ea47ba6f92f60ad12100ba05bcfc5c589ab02 100644 (file)
@@ -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
index e69a694561f9fb0b9e801b78ed9ea0f6bb2d5786..e48b38cf2ffaff30a0c28ce6d423adbc85e3960d 100644 (file)
@@ -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;
index a706d9768f25a5cc55ef017211b11ac898e47e20..e473874fc53e0862f36a042adf53475841b553d7 100644 (file)
@@ -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)
index 1ef13bb41a1c7a49e54567d2838a9b1636bf567d..012399a3d34c293970ac675d05e36ae7c109d425 100644 (file)
@@ -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)