summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-08-10 21:34:19 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-08-10 21:34:19 +0200
commit8cde3a9bf2856dcb9a759dec7ecb04a68e712254 (patch)
treef1178ad8455fbe0af2f45df38a106e99646dc226
parent647c71be1b8840cc14130393df7615759ab0f899 (diff)
locales: add patch from OpenWrt
This fixes some build problems on f.e. Fedora hosts, when locales are enabled. Suggested via #buildroot on Freenode.
-rw-r--r--extra/locale/gen_wctype.c109
1 files changed, 55 insertions, 54 deletions
diff --git a/extra/locale/gen_wctype.c b/extra/locale/gen_wctype.c
index b5d7e3911..d5b5c5c28 100644
--- a/extra/locale/gen_wctype.c
+++ b/extra/locale/gen_wctype.c
@@ -227,11 +227,12 @@ int main(int argc, char **argv)
++verbose;
continue;
}
- if (!setlocale(LC_CTYPE, *argv)) {
+ /* setlocale might be just a stub */
+ /* if (!setlocale(LC_CTYPE, *argv)) {
verbose_msg("setlocale(LC_CTYPE,%s) failed! Skipping this locale...\n", *argv);
continue;
}
-
+ */
if (!(totitle = wctrans("totitle"))) {
verbose_msg("no totitle transformation.\n");
}
@@ -306,43 +307,43 @@ int main(int argc, char **argv)
#endif
#if 0
if (c < 256) {
- unsigned int glibc;
-
- glibc = 0;
- if (isalnum(c)) ++glibc; glibc <<= 1;
- if (isalpha(c)) ++glibc; glibc <<= 1;
- if (isblank(c)) ++glibc; glibc <<= 1;
- if (iscntrl(c)) ++glibc; glibc <<= 1;
- if (isdigit(c)) ++glibc; glibc <<= 1;
- if (isgraph(c)) ++glibc; glibc <<= 1;
- if (islower(c)) ++glibc; glibc <<= 1;
- if (isprint(c)) ++glibc; glibc <<= 1;
- if (ispunct(c)) ++glibc; glibc <<= 1;
- if (isspace(c)) ++glibc; glibc <<= 1;
- if (isupper(c)) ++glibc; glibc <<= 1;
- if (isxdigit(c)) ++glibc;
- verbose_msg("%#8x : ctype %#4x\n", c, glibc);
+ unsigned int curr_stdclib;
+
+ curr_stdclib = 0;
+ if (isalnum(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isalpha(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isblank(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iscntrl(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isdigit(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isgraph(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (islower(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isprint(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (ispunct(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isspace(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isupper(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (isxdigit(c)) ++curr_stdclib;
+ verbose_msg("%#8x : ctype %#4x\n", c, curr_stdclib);
}
#endif
#if 1
/* Paranoid checking... */
{
- unsigned int glibc;
+ unsigned int curr_stdclib;
unsigned int mine;
- glibc = 0;
- if (iswalnum(c)) ++glibc; glibc <<= 1;
- if (iswalpha(c)) ++glibc; glibc <<= 1;
- if (iswblank(c)) ++glibc; glibc <<= 1;
- if (iswcntrl(c)) ++glibc; glibc <<= 1;
- if (iswdigit(c)) ++glibc; glibc <<= 1;
- if (iswgraph(c)) ++glibc; glibc <<= 1;
- if (iswlower(c)) ++glibc; glibc <<= 1;
- if (iswprint(c)) ++glibc; glibc <<= 1;
- if (iswpunct(c)) ++glibc; glibc <<= 1;
- if (iswspace(c)) ++glibc; glibc <<= 1;
- if (iswupper(c)) ++glibc; glibc <<= 1;
- if (iswxdigit(c)) ++glibc;
+ curr_stdclib = 0;
+ if (iswalnum(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswalpha(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswblank(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswcntrl(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswdigit(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswgraph(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswlower(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswprint(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswpunct(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswspace(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswupper(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswxdigit(c)) ++curr_stdclib;
mine = 0;
if (mywalnum(d,c)) ++mine; mine <<= 1;
@@ -358,15 +359,15 @@ int main(int argc, char **argv)
if (mywupper(d,c)) ++mine; mine <<= 1;
if (mywxdigit(d,c)) ++mine;
- if (glibc != mine) {
- verbose_msg("%#8x : glibc %#4x != %#4x mine %u\n", c, glibc, mine, d);
+ if (curr_stdclib != mine) {
+ verbose_msg("%#8x : curr_stdclib %#4x != %#4x mine %u\n", c, curr_stdclib, mine, d);
return EXIT_FAILURE;
}
#if 0
if (iswctype(c,is_comb) || iswctype(c,is_comb3)) {
/* if (!iswpunct(c)) { */
verbose_msg("%#8x : %d %d %#4x\n",
- c, iswctype(c,is_comb),iswctype(c,is_comb3), glibc);
+ c, iswctype(c,is_comb),iswctype(c,is_comb3), curr_stdclib);
/* } */
}
#endif
@@ -553,7 +554,7 @@ int main(int argc, char **argv)
for (c = 0; c <= 0x10ffffUL; c++)
#endif
{
- unsigned int glibc;
+ unsigned int curr_stdclib;
unsigned int mine;
unsigned int upper, lower;
@@ -568,19 +569,19 @@ int main(int argc, char **argv)
}
#endif
#endif
- glibc = 0;
- if (iswalnum(c)) ++glibc; glibc <<= 1;
- if (iswalpha(c)) ++glibc; glibc <<= 1;
- if (iswblank(c)) ++glibc; glibc <<= 1;
- if (iswcntrl(c)) ++glibc; glibc <<= 1;
- if (iswdigit(c)) ++glibc; glibc <<= 1;
- if (iswgraph(c)) ++glibc; glibc <<= 1;
- if (iswlower(c)) ++glibc; glibc <<= 1;
- if (iswprint(c)) ++glibc; glibc <<= 1;
- if (iswpunct(c)) ++glibc; glibc <<= 1;
- if (iswspace(c)) ++glibc; glibc <<= 1;
- if (iswupper(c)) ++glibc; glibc <<= 1;
- if (iswxdigit(c)) ++glibc;
+ curr_stdclib = 0;
+ if (iswalnum(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswalpha(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswblank(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswcntrl(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswdigit(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswgraph(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswlower(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswprint(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswpunct(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswspace(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswupper(c)) ++curr_stdclib; curr_stdclib <<= 1;
+ if (iswxdigit(c)) ++curr_stdclib;
{
unsigned int u;
@@ -630,8 +631,8 @@ int main(int argc, char **argv)
if (mywupper(d,c)) ++mine; mine <<= 1;
if (mywxdigit(d,c)) ++mine;
- if (glibc != mine) {
- verbose_msg("%#8x : glibc %#4x != %#4x mine %d\n", c, glibc, mine, d);
+ if (curr_stdclib != mine) {
+ verbose_msg("%#8x : curr_stdclib %#4x != %#4x mine %d\n", c, curr_stdclib, mine, d);
if (c < 0x30000UL) {
verbose_msg("sc=%#x u=%#x n=%#x i0=%#x i1=%#x\n", sc, u, n, i0, i1);
}
@@ -655,17 +656,17 @@ int main(int argc, char **argv)
}
if (towupper(c) != upper) {
- verbose_msg("%#8x : towupper glibc %#4x != %#4x mine\n",
+ verbose_msg("%#8x : towupper curr_stdclib %#4x != %#4x mine\n",
c, towupper(c), upper);
}
if (towlower(c) != lower) {
- verbose_msg("%#8x : towlower glibc %#4x != %#4x mine i0 = %d\n",
+ verbose_msg("%#8x : towlower curr_stdclib %#4x != %#4x mine i0 = %d\n",
c, towlower(c), lower, i0);
}
if (totitle && ((tt = towctrans(c, totitle)) != upper)) {
- verbose_msg("%#8x : totitle glibc %#4lx != %#4x mine i0 = %d\n",
+ verbose_msg("%#8x : totitle curr_stdclib %#4lx != %#4x mine i0 = %d\n",
c, tt, upper, i0);
}
}