From 6e606fad8da37fb175205244c794c5aae58ffda1 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 5 Sep 2002 21:22:05 +0000 Subject: [PATCH] * ctype/ctype-info.c: Renamed __ctype_old_* symbols to __ctype_*. * locale/lc-ctype.c (_nl_postload_ctype): Likewise. --- ChangeLog | 5 +++++ ctype/ctype-info.c | 24 ++++++++++++------------ locale/lc-ctype.c | 27 +++++++++++++++------------ wcsmbs/wcsmbsload.c | 19 +++++++++---------- 4 files changed, 41 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f66d5c..e89d959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-09-05 Roland McGrath + + * ctype/ctype-info.c: Renamed __ctype_old_* symbols to __ctype_*. + * locale/lc-ctype.c (_nl_postload_ctype): Likewise. + 2002-09-05 Jakub Jelinek * wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Unlock and return in diff --git a/ctype/ctype-info.c b/ctype/ctype-info.c index 30c6d55..35f2fb5 100644 --- a/ctype/ctype-info.c +++ b/ctype/ctype-info.c @@ -48,18 +48,18 @@ extern const char _nl_C_LC_CTYPE_class_alnum[] attribute_hidden; #define b(t,x,o) (((const t *) _nl_C_LC_CTYPE_##x) + o) -const unsigned short int *__ctype_old_b = b (unsigned short int, class, 128); -const __uint32_t *__ctype32_old_b = b (__uint32_t, class32, 0); -const __int32_t *__ctype_old_tolower = b (__int32_t, tolower, 128); -const __int32_t *__ctype_old_toupper = b (__int32_t, toupper, 128); -const __uint32_t *__ctype32_old_tolower = b (__uint32_t, tolower, 128); -const __uint32_t *__ctype32_old_toupper = b (__uint32_t, toupper, 128); +const unsigned short int *__ctype_b = b (unsigned short int, class, 128); +const __uint32_t *__ctype32_b = b (__uint32_t, class32, 0); +const __int32_t *__ctype_tolower = b (__int32_t, tolower, 128); +const __int32_t *__ctype_toupper = b (__int32_t, toupper, 128); +const __uint32_t *__ctype32_tolower = b (__uint32_t, tolower, 128); +const __uint32_t *__ctype32_toupper = b (__uint32_t, toupper, 128); -compat_symbol (libc, __ctype_old_b, __ctype_b, GLIBC_2_0); -compat_symbol (libc, __ctype_old_tolower, __ctype_tolower, GLIBC_2_0); -compat_symbol (libc, __ctype_old_toupper, __ctype_toupper, GLIBC_2_0); -compat_symbol (libc, __ctype32_old_b, __ctype32_b, GLIBC_2_0); -compat_symbol (libc, __ctype32_old_tolower, __ctype32_tolower, GLIBC_2_2); -compat_symbol (libc, __ctype32_old_toupper, __ctype32_toupper, GLIBC_2_2); +compat_symbol (libc, __ctype_b, __ctype_b, GLIBC_2_0); +compat_symbol (libc, __ctype_tolower, __ctype_tolower, GLIBC_2_0); +compat_symbol (libc, __ctype_toupper, __ctype_toupper, GLIBC_2_0); +compat_symbol (libc, __ctype32_b, __ctype32_b, GLIBC_2_0); +compat_symbol (libc, __ctype32_tolower, __ctype32_tolower, GLIBC_2_2); +compat_symbol (libc, __ctype32_toupper, __ctype32_toupper, GLIBC_2_2); #endif diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c index 3011f4e..ad815df 100644 --- a/locale/lc-ctype.c +++ b/locale/lc-ctype.c @@ -54,19 +54,22 @@ _nl_postload_ctype (void) #include #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) - extern __const unsigned short int *__ctype_old_b; /* Characteristics. */ - extern __const __int32_t *__ctype_old_tolower; /* Case conversions. */ - extern __const __int32_t *__ctype_old_toupper; /* Case conversions. */ + /* We must use the exported names to access these so we are sure to + be accessing the main executable's copy if it has COPY relocs. */ - extern const uint32_t *__ctype32_old_b; - extern const uint32_t *__ctype32_old_toupper; - extern const uint32_t *__ctype32_old_tolower; + extern __const unsigned short int *__ctype_b; /* Characteristics. */ + extern __const __int32_t *__ctype_tolower; /* Case conversions. */ + extern __const __int32_t *__ctype_toupper; /* Case conversions. */ - __ctype_old_b = current (uint16_t, CLASS, 128); - __ctype_old_toupper = current (uint32_t, TOUPPER, 128); - __ctype_old_tolower = current (uint32_t, TOLOWER, 128); - __ctype32_old_b = current (uint32_t, CLASS32, 0); - __ctype32_old_toupper = current (uint32_t, TOUPPER32, 0); - __ctype32_old_tolower = current (uint32_t, TOLOWER32, 0); + extern const uint32_t *__ctype32_b; + extern const uint32_t *__ctype32_toupper; + extern const uint32_t *__ctype32_tolower; + + __ctype_b = current (uint16_t, CLASS, 128); + __ctype_toupper = current (uint32_t, TOUPPER, 128); + __ctype_tolower = current (uint32_t, TOLOWER, 128); + __ctype32_b = current (uint32_t, CLASS32, 0); + __ctype32_toupper = current (uint32_t, TOUPPER32, 0); + __ctype32_tolower = current (uint32_t, TOLOWER32, 0); #endif } diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c index b2ee834..bf23d25 100644 --- a/wcsmbs/wcsmbsload.c +++ b/wcsmbs/wcsmbsload.c @@ -166,12 +166,7 @@ __wcsmbs_load_conv (struct locale_data *new_category) /* Allocate the gconv_fcts structure. */ new_fcts = malloc (sizeof *new_fcts); if (new_fcts == NULL) - { - failed: - new_category->private.ctype = &__wcsmbs_gconv_fcts_c; - __libc_lock_unlock (__libc_setlocale_lock); - return; - } + goto failed; /* Get name of charset of the locale. */ charset_name = new_category->values[_NL_ITEM_INDEX(CODESET)].string; @@ -203,11 +198,15 @@ __wcsmbs_load_conv (struct locale_data *new_category) __gconv_close_transform (new_fcts->towc, new_fcts->towc_nsteps); free (new_fcts); - goto failed; - } - new_category->private.ctype = new_fcts; - new_category->private.cleanup = &_nl_cleanup_ctype; + failed: + new_category->private.ctype = &__wcsmbs_gconv_fcts_c; + } + else + { + new_category->private.ctype = new_fcts; + new_category->private.cleanup = &_nl_cleanup_ctype; + } } __libc_lock_unlock (__libc_setlocale_lock); -- 2.7.4