diff options
Diffstat (limited to 'libio/iofwide.c')
-rw-r--r-- | libio/iofwide.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/libio/iofwide.c b/libio/iofwide.c index d1a0f1ef13..5ca0a84f0d 100644 --- a/libio/iofwide.c +++ b/libio/iofwide.c @@ -25,6 +25,7 @@ #include <libioP.h> #ifdef _LIBC +# include <dlfcn.h> # include <wchar.h> #endif #include <stdlib.h> @@ -165,15 +166,17 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep, #ifdef _LIBC struct __gconv_step *gs = codecvt->__cd_out.__cd.__steps; int status; - size_t written; + size_t dummy; const unsigned char *from_start_copy = (unsigned char *) from_start; codecvt->__cd_out.__cd.__data[0].__outbuf = to_start; codecvt->__cd_out.__cd.__data[0].__outbufend = to_end; codecvt->__cd_out.__cd.__data[0].__statep = statep; - status = (*gs->__fct) (gs, codecvt->__cd_out.__cd.__data, &from_start_copy, - (const unsigned char *) from_end, &written, 0, 0); + status = DL_CALL_FCT (gs->__fct, + (gs, codecvt->__cd_out.__cd.__data, &from_start_copy, + (const unsigned char *) from_end, to_start, + &dummy, 0, 0)); *from_stop = (wchar_t *) from_start_copy; *to_stop = codecvt->__cd_out.__cd.__data[0].__outbuf; @@ -212,14 +215,15 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep, #ifdef _LIBC struct __gconv_step *gs = codecvt->__cd_out.__cd.__steps; int status; - size_t written; + size_t dummy; codecvt->__cd_out.__cd.__data[0].__outbuf = to_start; codecvt->__cd_out.__cd.__data[0].__outbufend = to_end; codecvt->__cd_out.__cd.__data[0].__statep = statep; - status = (*gs->__fct) (gs, codecvt->__cd_out.__cd.__data, NULL, NULL, - &written, 1, 0); + status = DL_CALL_FCT (gs->__fct, + (gs, codecvt->__cd_out.__cd.__data, NULL, NULL, + to_start, &dummy, 1, 0)); *to_stop = codecvt->__cd_out.__cd.__data[0].__outbuf; @@ -258,15 +262,16 @@ do_in (struct _IO_codecvt *codecvt, __mbstate_t *statep, #ifdef _LIBC struct __gconv_step *gs = codecvt->__cd_in.__cd.__steps; int status; - size_t written; + size_t dummy; const unsigned char *from_start_copy = (unsigned char *) from_start; codecvt->__cd_in.__cd.__data[0].__outbuf = (char *) to_start; codecvt->__cd_in.__cd.__data[0].__outbufend = (char *) to_end; codecvt->__cd_in.__cd.__data[0].__statep = statep; - status = (*gs->__fct) (gs, codecvt->__cd_in.__cd.__data, &from_start_copy, - from_end, &written, 0, 0); + status = DL_CALL_FCT (gs->__fct, + (gs, codecvt->__cd_in.__cd.__data, &from_start_copy, + from_end, (char *) to_start, &dummy, 0, 0)); *from_stop = from_start_copy; *to_stop = (wchar_t *) codecvt->__cd_in.__cd.__data[0].__outbuf; @@ -335,14 +340,15 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep, wchar_t to_buf[max]; struct __gconv_step *gs = codecvt->__cd_in.__cd.__steps; int status; - size_t written; + size_t dummy; codecvt->__cd_in.__cd.__data[0].__outbuf = (char *) to_buf; codecvt->__cd_in.__cd.__data[0].__outbufend = (char *) &to_buf[max]; codecvt->__cd_in.__cd.__data[0].__statep = statep; - status = (*gs->__fct) (gs, codecvt->__cd_in.__cd.__data, &cp, from_end, - &written, 0, 0); + status = DL_CALL_FCT (gs->__fct, + (gs, codecvt->__cd_in.__cd.__data, &cp, from_end, + (char *) to_buf, &dummy, 0, 0)); result = cp - (const unsigned char *) from_start; #else |