3 #if defined (_MB_EXTENDED_CHARSETS_ISO) \
4 || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
10 #include <../locale/setlocale.h>
14 toupper_l (int c
, struct __locale_t
*locale
)
16 #if defined (_MB_EXTENDED_CHARSETS_ISO) \
17 || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
18 if ((unsigned char) c
<= 0x7f)
19 return islower_l (c
, locale
) ? c
- 'a' + 'A' : c
;
20 else if (c
!= EOF
&& __locale_mb_cur_max_l (locale
) == 1
21 && islower_l (c
, locale
))
23 char s
[MB_LEN_MAX
] = { c
, '\0' };
27 memset (&state
, 0, sizeof state
);
28 if (locale
->mbtowc (_REENT
, &wc
, s
, 1, &state
) >= 0
29 && locale
->wctomb (_REENT
, s
,
30 (wchar_t) towupper_l ((wint_t) wc
, locale
),
32 c
= (unsigned char) s
[0];
36 return islower_l (c
, locale
) ? c
- 'a' + 'A' : c
;