diff options
Diffstat (limited to 'iconvdata/iso_6937.c')
-rw-r--r-- | iconvdata/iso_6937.c | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/iconvdata/iso_6937.c b/iconvdata/iso_6937.c index d27b923689..b7ab0841eb 100644 --- a/iconvdata/iso_6937.c +++ b/iconvdata/iso_6937.c @@ -18,6 +18,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <dlfcn.h> #include <stdint.h> /* Data taken from the WG15 tables. */ @@ -397,7 +398,7 @@ static const char from_ucs4[][2] = is also available. */ \ int ch2; \ \ - if (NEED_LENGTH_TEST && __builtin_expect (inptr + 1 >= inend, 0)) \ + if (__builtin_expect (inptr + 1 >= inend, 0)) \ { \ /* The second character is not available. Store the \ intermediate result. */ \ @@ -466,6 +467,7 @@ static const char from_ucs4[][2] = put32 (outptr, ch); \ outptr += 4; \ } +#define LOOP_NEED_FLAGS #include <iconv/loop.c> @@ -540,29 +542,50 @@ static const char from_ucs4[][2] = if (__builtin_expect (fail, 0)) \ { \ /* Illegal characters. */ \ - 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 ()) \ { \ /* This is an illegal character. */ \ result = __GCONV_ILLEGAL_INPUT; \ break; \ } \ - \ - inptr += 4; \ - ++*irreversible; \ + else \ + { \ + inptr += 4; \ + ++*irreversible; \ + } \ continue; \ } \ } \ else if (__builtin_expect (from_ucs4[ch][0], '\1') == '\0' && ch != 0) \ { \ /* Illegal characters. */ \ - 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 \ + { \ + inptr += 4; \ + ++*irreversible; \ + } \ continue; \ } \ else \ @@ -572,7 +595,7 @@ static const char from_ucs4[][2] = /* Now test for a possible second byte and write this if possible. */ \ if (cp[1] != '\0') \ { \ - if (NEED_LENGTH_TEST && __builtin_expect (outptr >= outend, 0)) \ + if (__builtin_expect (outptr >= outend, 0)) \ { \ /* The result does not fit into the buffer. */ \ --outptr; \ @@ -584,6 +607,7 @@ static const char from_ucs4[][2] = \ inptr += 4; \ } +#define LOOP_NEED_FLAGS #include <iconv/loop.c> |