From 915a6c51c5d8127e87ef797ee23e04e4f92b4c4f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 19 Dec 2005 07:26:29 +0000 Subject: * iconv/gconv.c: Demangle pointers before use if necessary. * iconv/gconv_cache.c: Likewise. * iconv/skeleton.c: Likewise. * libio/iofwide.c: Likewise. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs_l.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. * iconv_gconv_db.c: Likewise. After init functions returns mangle btowc pointer if necessary. * iconv/gconv_dl.c: Mangle function pointers retrieved from dlsym. --- wcsmbs/btowc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'wcsmbs/btowc.c') diff --git a/wcsmbs/btowc.c b/wcsmbs/btowc.c index 6add7ed..6517d4f 100644 --- a/wcsmbs/btowc.c +++ b/wcsmbs/btowc.c @@ -26,6 +26,8 @@ #include #include +#include + wint_t __btowc (c) @@ -45,13 +47,17 @@ __btowc (c) /* Get the conversion functions. */ fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); + __gconv_btowc_fct btowc_fct = fcts->towc->__btowc_fct; if (__builtin_expect (fcts->towc_nsteps == 1, 1) - && __builtin_expect (fcts->towc->__btowc_fct != NULL, 1)) + && __builtin_expect (btowc_fct != NULL, 1)) { /* Use the shortcut function. */ - return DL_CALL_FCT (fcts->towc->__btowc_fct, - (fcts->towc, (unsigned char) c)); +#ifdef PTR_DEMANGLE + if (fcts->towc->__shlib_handle != NULL) + PTR_DEMANGLE (btowc_fct); +#endif + return DL_CALL_FCT (btowc_fct, (fcts->towc, (unsigned char) c)); } else { @@ -78,9 +84,13 @@ __btowc (c) /* Create the input string. */ inbuf[0] = c; - status = DL_CALL_FCT (fcts->towc->__fct, - (fcts->towc, &data, &inptr, inptr + 1, - NULL, &dummy, 0, 1)); + __gconv_fct fct = fcts->towc->__fct; +#ifdef PTR_DEMANGLE + if (fcts->towc->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + status = DL_CALL_FCT (fct, (fcts->towc, &data, &inptr, inptr + 1, + NULL, &dummy, 0, 1)); if (status != __GCONV_OK && status != __GCONV_FULL_OUTPUT && status != __GCONV_EMPTY_INPUT) -- cgit v1.1