1 #include "stdio_impl.h"
2 #include "locale_impl.h"
7 wint_t __fputwc_unlocked(wchar_t c
, FILE *f
)
11 locale_t
*ploc
= &CURRENT_LOCALE
, loc
= *ploc
;
13 if (f
->mode
<= 0) fwide(f
, 1);
17 c
= putc_unlocked(c
, f
);
18 } else if (f
->wpos
+ MB_LEN_MAX
< f
->wend
) {
19 l
= wctomb((void *)f
->wpos
, c
);
24 if (l
< 0 || __fwritex((void *)mbc
, l
, f
) < l
) c
= WEOF
;
26 if (c
==WEOF
) f
->flags
|= F_ERR
;
31 wint_t fputwc(wchar_t c
, FILE *f
)
34 c
= __fputwc_unlocked(c
, f
);
39 weak_alias(__fputwc_unlocked
, fputwc_unlocked
);
40 weak_alias(__fputwc_unlocked
, putwc_unlocked
);