diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-12-28 12:13:40 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-12-28 12:13:40 +0100 |
| commit | b0afb8fe0ff1d87165af9df61501197a06240dda (patch) | |
| tree | 274ac6a96c53ef4c19ab4974ce24a06a233128c5 /gl/m4/locale-zh.m4 | |
| parent | 68fc05381ee5fa0aee1413118fbb3d81ca888b09 (diff) | |
| download | monitoring-plugins-b0afb8fe.tar.gz | |
Sync with Gnulib stable-202507 code (a8ac9f9ce5)
Diffstat (limited to 'gl/m4/locale-zh.m4')
| -rw-r--r-- | gl/m4/locale-zh.m4 | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4 index 7f1a10be..6f9374d2 100644 --- a/gl/m4/locale-zh.m4 +++ b/gl/m4/locale-zh.m4 | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | # locale-zh.m4 | 1 | # locale-zh.m4 |
| 2 | # serial 18 | 2 | # serial 20 |
| 3 | dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc. | 3 | dnl Copyright (C) 2003, 2005-2025 Free Software Foundation, Inc. |
| 4 | dnl This file is free software; the Free Software Foundation | 4 | dnl This file is free software; the Free Software Foundation |
| 5 | dnl gives unlimited permission to copy and/or distribute it, | 5 | dnl gives unlimited permission to copy and/or distribute it, |
| 6 | dnl with or without modifications, as long as this notice is preserved. | 6 | dnl with or without modifications, as long as this notice is preserved. |
| 7 | dnl This file is offered as-is, without any warranty. | ||
| 7 | 8 | ||
| 8 | dnl From Bruno Haible. | 9 | dnl From Bruno Haible. |
| 9 | 10 | ||
| @@ -22,6 +23,7 @@ AC_DEFUN_ONCE([gt_LOCALE_ZH_CN], | |||
| 22 | #endif | 23 | #endif |
| 23 | #include <stdlib.h> | 24 | #include <stdlib.h> |
| 24 | #include <string.h> | 25 | #include <string.h> |
| 26 | #include <wchar.h> | ||
| 25 | struct tm t; | 27 | struct tm t; |
| 26 | char buf[16]; | 28 | char buf[16]; |
| 27 | int main () | 29 | int main () |
| @@ -80,6 +82,19 @@ int main () | |||
| 80 | single wide character. This excludes the GB2312 and GBK encodings. */ | 82 | single wide character. This excludes the GB2312 and GBK encodings. */ |
| 81 | if (mblen ("\203\062\332\066", 5) != 4) | 83 | if (mblen ("\203\062\332\066", 5) != 4) |
| 82 | return 1; | 84 | return 1; |
| 85 | /* Check whether mbrtowc accept this character one byte at a time. | ||
| 86 | This excludes NetBSD 10.0. */ | ||
| 87 | if (sizeof (wchar_t) > 2) | ||
| 88 | { | ||
| 89 | wchar_t wc; | ||
| 90 | mbstate_t state; | ||
| 91 | memset (&state, 0, sizeof (state)); | ||
| 92 | if (!(mbrtowc (&wc, "\203", 1, &state) == (size_t)(-2) | ||
| 93 | && mbrtowc (&wc, "\062", 1, &state) == (size_t)(-2) | ||
| 94 | && mbrtowc (&wc, "\332", 1, &state) == (size_t)(-2) | ||
| 95 | && mbrtowc (&wc, "\066", 1, &state) == 1)) | ||
| 96 | return 1; | ||
| 97 | } | ||
| 83 | return 0; | 98 | return 0; |
| 84 | #endif | 99 | #endif |
| 85 | } | 100 | } |
| @@ -87,10 +102,11 @@ int main () | |||
| 87 | if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then | 102 | if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then |
| 88 | case "$host_os" in | 103 | case "$host_os" in |
| 89 | # Handle native Windows specially, because there setlocale() interprets | 104 | # Handle native Windows specially, because there setlocale() interprets |
| 90 | # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", | 105 | # "ar" or "ara" as "Arabic" or "Arabic_Saudi Arabia.1256", |
| 106 | # "en" or "eng" as "English" or "English_United States.1252", | ||
| 91 | # "fr" or "fra" as "French" or "French_France.1252", | 107 | # "fr" or "fra" as "French" or "French_France.1252", |
| 92 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", | 108 | # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", |
| 93 | # "ja" as "Japanese" or "Japanese_Japan.932", | 109 | # "ja" or "jpn" as "Japanese" or "Japanese_Japan.932", |
| 94 | # and similar. | 110 | # and similar. |
| 95 | mingw* | windows*) | 111 | mingw* | windows*) |
| 96 | # Test for the hypothetical native Windows locale name. | 112 | # Test for the hypothetical native Windows locale name. |
