diff options
Diffstat (limited to 'iconvdata/8bit-gap.c')
-rw-r--r-- | iconvdata/8bit-gap.c | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c index 2d66f8b666..23a63fd9e4 100644 --- a/iconvdata/8bit-gap.c +++ b/iconvdata/8bit-gap.c @@ -19,6 +19,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <dlfcn.h> #include <stdint.h> struct gap @@ -67,6 +68,7 @@ struct gap \ ++inptr; \ } +#define LOOP_NEED_FLAGS #include <iconv/loop.c> @@ -83,7 +85,15 @@ struct gap if (__builtin_expect (ch, 0) >= 0xffff) \ { \ /* This is an illegal character. */ \ - if (! ignore_errors_p ()) \ + if (step_data->__trans.__trans_fct != NULL) \ + { \ + result = DL_CALL_FCT (step_data->__trans.__trans_fct, \ + (step, step_data, *inptrp, &inptr, inend, \ + *outptrp, &outptr, outend, irreversible)); \ + if (result != __GCONV_OK) \ + break; \ + } \ + else if (! ignore_errors_p ()) \ { \ result = __GCONV_ILLEGAL_INPUT; \ break; \ @@ -98,14 +108,24 @@ struct gap if (__builtin_expect (ch < rp->start, 0)) \ { \ /* This is an illegal character. */ \ - if (! ignore_errors_p ()) \ + if (step_data->__trans.__trans_fct != NULL) \ + { \ + result = DL_CALL_FCT (step_data->__trans.__trans_fct, \ + (step, step_data, *inptrp, &inptr, inend, \ + *outptrp, &outptr, outend, irreversible)); \ + if (result != __GCONV_OK) \ + break; \ + } \ + else if (! ignore_errors_p ()) \ { \ result = __GCONV_ILLEGAL_INPUT; \ break; \ } \ - \ - ++*irreversible; \ - inptr += 4; \ + else \ + { \ + ++*irreversible; \ + inptr += 4; \ + } \ continue; \ } \ \ @@ -113,20 +133,31 @@ struct gap if (__builtin_expect (res, '\1') == '\0' && ch != 0) \ { \ /* This is an illegal character. */ \ - if (! ignore_errors_p ()) \ + if (step_data->__trans.__trans_fct != NULL) \ + { \ + result = DL_CALL_FCT (step_data->__trans.__trans_fct, \ + (step, step_data, *inptrp, &inptr, inend, \ + *outptrp, &outptr, outend, irreversible)); \ + if (result != __GCONV_OK) \ + break; \ + } \ + else if (! ignore_errors_p ()) \ { \ result = __GCONV_ILLEGAL_INPUT; \ break; \ } \ - \ - ++*irreversible; \ - inptr += 4; \ + else \ + { \ + ++*irreversible; \ + inptr += 4; \ + } \ continue; \ } \ \ *outptr++ = res; \ inptr += 4; \ } +#define LOOP_NEED_FLAGS #include <iconv/loop.c> |