diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-12-19 07:26:29 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-12-19 07:26:29 +0000 |
commit | 915a6c51c5d8127e87ef797ee23e04e4f92b4c4f (patch) | |
tree | 4c7f9881c4b6b3ab049688dc22e969c44e8fbcf9 /libio | |
parent | 477aa8698f7963b0984c15016f62f99efe4bb0b5 (diff) | |
download | glibc-915a6c51c5d8127e87ef797ee23e04e4f92b4c4f.tar glibc-915a6c51c5d8127e87ef797ee23e04e4f92b4c4f.tar.gz glibc-915a6c51c5d8127e87ef797ee23e04e4f92b4c4f.tar.bz2 glibc-915a6c51c5d8127e87ef797ee23e04e4f92b4c4f.zip |
* iconv/gconv.c: Demangle pointers before use if necessary.cvs/fedora-glibc-20051219T1003
* 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.
Diffstat (limited to 'libio')
-rw-r--r-- | libio/iofwide.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/libio/iofwide.c b/libio/iofwide.c index be3627ca99..a9936687dd 100644 --- a/libio/iofwide.c +++ b/libio/iofwide.c @@ -40,6 +40,7 @@ # include <wcsmbs/wcsmbsload.h> # include <iconv/gconv_int.h> # include <shlib-compat.h> +# include <sysdep.h> #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)); |