mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
* scripts/abilist.awk: Grok function descriptor symbols.
* intl/tst-gettext.c (main): Check return values from setlocale. Add necessary unsetenv's to make LANG=existing-locale check work. * intl/tst-gettext.sh: Use mkdir -p. Copy test files unconditionally, so aborted prior runs don't confuse things. * locale/localeinfo.h (struct locale_data: union locale_data_value): Use uintptr_t instead of unsigned int for `word' member. (_NL_CURRENT_WORD): Cast to uint32_t. * posix/bug-regex5.c (main): Use union to extract _NL_COLLATE_NRULES value.
This commit is contained in:
17
ChangeLog
17
ChangeLog
@@ -1,3 +1,20 @@
|
|||||||
|
2002-11-20 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* scripts/abilist.awk: Grok function descriptor symbols.
|
||||||
|
|
||||||
|
* intl/tst-gettext.c (main): Check return values from setlocale.
|
||||||
|
Add necessary unsetenv's to make LANG=existing-locale check work.
|
||||||
|
|
||||||
|
* intl/tst-gettext.sh: Use mkdir -p. Copy test files unconditionally,
|
||||||
|
so aborted prior runs don't confuse things.
|
||||||
|
|
||||||
|
* locale/localeinfo.h (struct locale_data: union locale_data_value):
|
||||||
|
Use uintptr_t instead of unsigned int for `word' member.
|
||||||
|
(_NL_CURRENT_WORD): Cast to uint32_t.
|
||||||
|
|
||||||
|
* posix/bug-regex5.c (main): Use union to extract _NL_COLLATE_NRULES
|
||||||
|
value.
|
||||||
|
|
||||||
2002-11-20 Ulrich Drepper <drepper@redhat.com>
|
2002-11-20 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* elf/tls-macros.h: Add IA-64 definitions.
|
* elf/tls-macros.h: Add IA-64 definitions.
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <error.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
const struct
|
const struct
|
||||||
@@ -52,6 +54,15 @@ static int positive_dcgettext_test (const char *domain, int category);
|
|||||||
static int negative_dcgettext_test (const char *domain, int category);
|
static int negative_dcgettext_test (const char *domain, int category);
|
||||||
|
|
||||||
|
|
||||||
|
#define check_setlocale(cat, name) do { \
|
||||||
|
if (setlocale (cat, name) == NULL) \
|
||||||
|
{ \
|
||||||
|
printf ("%s:%u: setlocale (%s, \"%s\"): %m\n", \
|
||||||
|
__FILE__, __LINE__, #cat, name); \
|
||||||
|
result = 1; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -76,8 +87,8 @@ main (int argc, char *argv[])
|
|||||||
setenv ("LC_MESSAGES", "non-existing-locale", 1);
|
setenv ("LC_MESSAGES", "non-existing-locale", 1);
|
||||||
setenv ("LC_CTYPE", "non-existing-locale", 1);
|
setenv ("LC_CTYPE", "non-existing-locale", 1);
|
||||||
setenv ("LANG", "non-existing-locale", 1);
|
setenv ("LANG", "non-existing-locale", 1);
|
||||||
setlocale (LC_CTYPE, "de_DE.ISO-8859-1");
|
check_setlocale (LC_CTYPE, "de_DE.ISO-8859-1");
|
||||||
setlocale (LC_MESSAGES, "de_DE.ISO-8859-1");
|
check_setlocale (LC_MESSAGES, "de_DE.ISO-8859-1");
|
||||||
unsetenv ("OUTPUT_CHARSET");
|
unsetenv ("OUTPUT_CHARSET");
|
||||||
/* This is the name of the existing domain with a catalog for the
|
/* This is the name of the existing domain with a catalog for the
|
||||||
LC_MESSAGES category. */
|
LC_MESSAGES category. */
|
||||||
@@ -108,7 +119,7 @@ main (int argc, char *argv[])
|
|||||||
/* Now the same tests with LC_ALL deciding. */
|
/* Now the same tests with LC_ALL deciding. */
|
||||||
unsetenv ("LANGUAGE");
|
unsetenv ("LANGUAGE");
|
||||||
setenv ("LC_ALL", "existing-locale", 1);
|
setenv ("LC_ALL", "existing-locale", 1);
|
||||||
setlocale (LC_ALL, "");
|
check_setlocale (LC_ALL, "");
|
||||||
puts ("test `gettext' with LC_ALL set");
|
puts ("test `gettext' with LC_ALL set");
|
||||||
/* This is the name of the existing domain with a catalog for the
|
/* This is the name of the existing domain with a catalog for the
|
||||||
LC_MESSAGES category. */
|
LC_MESSAGES category. */
|
||||||
@@ -138,11 +149,17 @@ main (int argc, char *argv[])
|
|||||||
/* Now the same tests with LC_MESSAGES deciding. */
|
/* Now the same tests with LC_MESSAGES deciding. */
|
||||||
unsetenv ("LC_ALL");
|
unsetenv ("LC_ALL");
|
||||||
setenv ("LC_MESSAGES", "existing-locale", 1);
|
setenv ("LC_MESSAGES", "existing-locale", 1);
|
||||||
setlocale (LC_MESSAGES, "");
|
check_setlocale (LC_MESSAGES, "");
|
||||||
setenv ("LC_TIME", "existing-locale", 1);
|
setenv ("LC_TIME", "existing-locale", 1);
|
||||||
setlocale (LC_TIME, "");
|
check_setlocale (LC_TIME, "");
|
||||||
setenv ("LC_NUMERIC", "non-existing-locale", 1);
|
setenv ("LC_NUMERIC", "non-existing-locale", 1);
|
||||||
setlocale (LC_NUMERIC, "");
|
char *what = setlocale (LC_NUMERIC, "");
|
||||||
|
if (what != NULL)
|
||||||
|
{
|
||||||
|
printf ("setlocale succeeded (%s), expected failure\n", what);
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
|
|
||||||
puts ("test `gettext' with LC_ALL set");
|
puts ("test `gettext' with LC_ALL set");
|
||||||
/* This is the name of the existing domain with a catalog for the
|
/* This is the name of the existing domain with a catalog for the
|
||||||
LC_MESSAGES category. */
|
LC_MESSAGES category. */
|
||||||
@@ -191,8 +208,11 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
/* Now the same tests with LANG deciding. */
|
/* Now the same tests with LANG deciding. */
|
||||||
unsetenv ("LC_MESSAGES");
|
unsetenv ("LC_MESSAGES");
|
||||||
|
unsetenv ("LC_CTYPE");
|
||||||
|
unsetenv ("LC_TIME");
|
||||||
|
unsetenv ("LC_NUMERIC");
|
||||||
setenv ("LANG", "existing-locale", 1);
|
setenv ("LANG", "existing-locale", 1);
|
||||||
setlocale (LC_ALL, "");
|
check_setlocale (LC_ALL, "");
|
||||||
/* This is the name of the existing domain with a catalog for the
|
/* This is the name of the existing domain with a catalog for the
|
||||||
LC_MESSAGES category. */
|
LC_MESSAGES category. */
|
||||||
textdomain ("existing-domain");
|
textdomain ("existing-domain");
|
||||||
@@ -219,7 +239,7 @@ main (int argc, char *argv[])
|
|||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
setlocale (LC_ALL, "C");
|
check_setlocale (LC_ALL, "C");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -78,7 +78,11 @@ struct locale_data
|
|||||||
{
|
{
|
||||||
const uint32_t *wstr;
|
const uint32_t *wstr;
|
||||||
const char *string;
|
const char *string;
|
||||||
unsigned int word;
|
/* The values we store here are always uint32_t in fact. But it's
|
||||||
|
safer for the union to use a type that matches pointers so that
|
||||||
|
casting one of the pointer values to uint32_t produces the right
|
||||||
|
value for big-endian 64-bit platforms. */
|
||||||
|
uintptr_t word;
|
||||||
}
|
}
|
||||||
values __flexarr; /* Items, usually pointers into `filedata'. */
|
values __flexarr; /* Items, usually pointers into `filedata'. */
|
||||||
};
|
};
|
||||||
@@ -232,7 +236,7 @@ extern __thread struct locale_data *const *_nl_current_##category \
|
|||||||
|
|
||||||
/* Extract the current CATEGORY locale's word for ITEM. */
|
/* Extract the current CATEGORY locale's word for ITEM. */
|
||||||
#define _NL_CURRENT_WORD(category, item) \
|
#define _NL_CURRENT_WORD(category, item) \
|
||||||
((*_nl_current_##category)->values[_NL_ITEM_INDEX (item)].word)
|
((uint32_t) (*_nl_current_##category)->values[_NL_ITEM_INDEX (item)].word)
|
||||||
|
|
||||||
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
|
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
|
||||||
#define _NL_CURRENT_DEFINE(category) \
|
#define _NL_CURRENT_DEFINE(category) \
|
||||||
@@ -268,7 +272,7 @@ extern __thread struct locale_data *const *_nl_current_##category \
|
|||||||
|
|
||||||
/* Extract the current CATEGORY locale's word for ITEM. */
|
/* Extract the current CATEGORY locale's word for ITEM. */
|
||||||
# define _NL_CURRENT_WORD(category, item) \
|
# define _NL_CURRENT_WORD(category, item) \
|
||||||
(_NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].word)
|
((uint32_t) _NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].word)
|
||||||
|
|
||||||
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
|
/* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */
|
||||||
# define _NL_CURRENT_DEFINE(category) \
|
# define _NL_CURRENT_DEFINE(category) \
|
||||||
|
@@ -21,7 +21,8 @@ main (void)
|
|||||||
}
|
}
|
||||||
printf ("current locale : %s\n", ca);
|
printf ("current locale : %s\n", ca);
|
||||||
|
|
||||||
nrules = (size_t) nl_langinfo (_NL_COLLATE_NRULES);
|
u.string = nl_langinfo (_NL_COLLATE_NRULES);
|
||||||
|
nrules = u.word;
|
||||||
if (nrules == 0)
|
if (nrules == 0)
|
||||||
{
|
{
|
||||||
printf("No rule\n");
|
printf("No rule\n");
|
||||||
|
@@ -25,6 +25,9 @@ $2 == "g" || $2 == "w" && NF == 7 {
|
|||||||
if (type == "D" && $4 == ".tbss") {
|
if (type == "D" && $4 == ".tbss") {
|
||||||
print symbol, version, weak, "TLS", size | outpipe;
|
print symbol, version, weak, "TLS", size | outpipe;
|
||||||
}
|
}
|
||||||
|
else if (type == "D" && $4 == ".opd") {
|
||||||
|
print symbol, version, weak, "FDESC" | outpipe;
|
||||||
|
}
|
||||||
else if (type == "DO" && $4 == "*ABS*") {
|
else if (type == "DO" && $4 == "*ABS*") {
|
||||||
print symbol, version, weak, "ABS" | outpipe;
|
print symbol, version, weak, "ABS" | outpipe;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user