blob: 7f46f48b818709426c95642d6c44fdd9f3126fe2 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
2 *
3 * GNU Library General Public License (LGPL) version 2 or later.
4 *
5 * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
6 */
7
8#include "_stdio.h"
9
10
11#ifdef __DO_UNLOCKED
12
13wint_t fputwc_unlocked(wchar_t wc, FILE *stream)
14{
15 return _wstdio_fwrite(&wc, 1, stream) ? wc : WEOF;
16}
17libc_hidden_def(fputwc_unlocked)
18
19strong_alias(fputwc_unlocked,putwc_unlocked)
20#ifndef __UCLIBC_HAS_THREADS__
21strong_alias(fputwc_unlocked,fputwc)
22strong_alias(fputwc_unlocked,putwc)
23#endif
24
25#elif defined __UCLIBC_HAS_THREADS__
26
27wint_t fputwc(wchar_t wc, register FILE *stream)
28{
29 wint_t retval;
30 __STDIO_AUTO_THREADLOCK_VAR;
31
32 __STDIO_AUTO_THREADLOCK(stream);
33
34 retval = fputwc_unlocked(wc, stream);
35
36 __STDIO_AUTO_THREADUNLOCK(stream);
37
38 return retval;
39}
40
41strong_alias(fputwc,putwc)
42
43#endif