From a6c1ed4716cf02626ea035beb6dd4a921642ba80 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 3 Jan 2018 17:39:24 -0700 Subject: Use libc from agbcc instead of standalone newlib\nYou must have AGBCC commit 80d029caec189587f8b9294b6c8a5a489b8f5f88 in order to compile pmd_red.gba --- newlib/libc/stdlib/wctomb_r.c | 110 ------------------------------------------ 1 file changed, 110 deletions(-) delete mode 100644 newlib/libc/stdlib/wctomb_r.c (limited to 'newlib/libc/stdlib/wctomb_r.c') diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c deleted file mode 100644 index 8fa6e16..0000000 --- a/newlib/libc/stdlib/wctomb_r.c +++ /dev/null @@ -1,110 +0,0 @@ -#include -#include -#include "mbctype.h" - -int -_DEFUN (_wctomb_r, (r, s, wchar, state), - struct _reent *r _AND - char *s _AND - wchar_t wchar _AND - int *state) -{ - if (strlen (r->_current_locale) <= 1) - { /* fall-through */ } - else if (!strcmp (r->_current_locale, "C-SJIS")) - { - unsigned char char2 = (unsigned char)wchar; - unsigned char char1 = (unsigned char)(wchar >> 8); - - if (s == NULL) - return 0; /* not state-dependent */ - - if (char1 != 0x00) - { - /* first byte is non-zero..validate multi-byte char */ - if (_issjis1(char1) && _issjis2(char2)) - { - *s++ = (char)char1; - *s = (char)char2; - return 2; - } - else - return -1; - } - } - else if (!strcmp (r->_current_locale, "C-EUCJP")) - { - unsigned char char2 = (unsigned char)wchar; - unsigned char char1 = (unsigned char)(wchar >> 8); - - if (s == NULL) - return 0; /* not state-dependent */ - - if (char1 != 0x00) - { - /* first byte is non-zero..validate multi-byte char */ - if (_iseucjp (char1) && _iseucjp (char2)) - { - *s++ = (char)char1; - *s = (char)char2; - return 2; - } - else - return -1; - } - } - else if (!strcmp (r->_current_locale, "C-JIS")) - { - int cnt = 0; - unsigned char char2 = (unsigned char)wchar; - unsigned char char1 = (unsigned char)(wchar >> 8); - - if (s == NULL) - return 1; /* state-dependent */ - - if (char1 != 0x00) - { - /* first byte is non-zero..validate multi-byte char */ - if (_isjis (char1) && _isjis (char2)) - { - if (*state == 0) - { - /* must switch from ASCII to JIS state */ - *state = 1; - *s++ = ESC_CHAR; - *s++ = '$'; - *s++ = 'B'; - cnt = 3; - } - *s++ = (char)char1; - *s = (char)char2; - return cnt + 2; - } - else - return -1; - } - else - { - if (*state != 0) - { - /* must switch from JIS to ASCII state */ - *state = 0; - *s++ = ESC_CHAR; - *s++ = '('; - *s++ = 'B'; - cnt = 3; - } - *s = (char)char2; - return cnt + 1; - } - } - - if (s == NULL) - return 0; - - /* otherwise we are dealing with a single byte character */ - *s = (char) wchar; - return 1; -} - - -- cgit v1.2.3