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. --- libio/iofwide.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'libio/iofwide.c') diff --git a/libio/iofwide.c b/libio/iofwide.c index be3627c..a993668 100644 --- a/libio/iofwide.c +++ b/libio/iofwide.c @@ -40,6 +40,7 @@ # include # include # include +# include #endif @@ -126,12 +127,11 @@ _IO_fwide (fp, mode) selected locale for LC_CTYPE. */ #ifdef _LIBC { - struct gconv_fcts fcts; - /* Clear the state. We start all over again. */ memset (&fp->_wide_data->_IO_state, '\0', sizeof (__mbstate_t)); memset (&fp->_wide_data->_IO_last_state, '\0', sizeof (__mbstate_t)); + struct gconv_fcts fcts; __wcsmbs_clone_conv (&fcts); assert (fcts.towc_nsteps == 1); assert (fcts.tomb_nsteps == 1); @@ -159,7 +159,8 @@ _IO_fwide (fp, mode) cc->__cd_out.__cd.__data[0].__statep = &fp->_wide_data->_IO_state; /* And now the transliteration. */ - cc->__cd_out.__cd.__data[0].__trans = &__libio_translit; + cc->__cd_out.__cd.__data[0].__trans + = (struct __gconv_trans_data *) &__libio_translit; } #else # ifdef _GLIBCPP_USE_WCHAR_T @@ -232,7 +233,13 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep, codecvt->__cd_out.__cd.__data[0].__outbufend = (unsigned char *) to_end; codecvt->__cd_out.__cd.__data[0].__statep = statep; - status = DL_CALL_FCT (gs->__fct, + __gconv_fct fct = gs->__fct; +#ifdef PTR_DEMANGLE + if (gs->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + + status = DL_CALL_FCT (fct, (gs, codecvt->__cd_out.__cd.__data, &from_start_copy, (const unsigned char *) from_end, NULL, &dummy, 0, 0)); @@ -298,7 +305,13 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep, codecvt->__cd_out.__cd.__data[0].__outbufend = (unsigned char *) to_end; codecvt->__cd_out.__cd.__data[0].__statep = statep; - status = DL_CALL_FCT (gs->__fct, + __gconv_fct fct = gs->__fct; +#ifdef PTR_DEMANGLE + if (gs->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + + status = DL_CALL_FCT (fct, (gs, codecvt->__cd_out.__cd.__data, NULL, NULL, NULL, &dummy, 1, 0)); @@ -361,7 +374,13 @@ do_in (struct _IO_codecvt *codecvt, __mbstate_t *statep, codecvt->__cd_in.__cd.__data[0].__outbufend = (unsigned char *) to_end; codecvt->__cd_in.__cd.__data[0].__statep = statep; - status = DL_CALL_FCT (gs->__fct, + __gconv_fct fct = gs->__fct; +#ifdef PTR_DEMANGLE + if (gs->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + + status = DL_CALL_FCT (fct, (gs, codecvt->__cd_in.__cd.__data, &from_start_copy, (const unsigned char *) from_end, NULL, &dummy, 0, 0)); @@ -459,7 +478,13 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep, codecvt->__cd_in.__cd.__data[0].__outbufend = (unsigned char *) &to_buf[max]; codecvt->__cd_in.__cd.__data[0].__statep = statep; - status = DL_CALL_FCT (gs->__fct, + __gconv_fct fct = gs->__fct; +#ifdef PTR_DEMANGLE + if (gs->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + + status = DL_CALL_FCT (fct, (gs, codecvt->__cd_in.__cd.__data, &cp, (const unsigned char *) from_end, NULL, &dummy, 0, 0)); -- cgit v1.1