lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* 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 | |
| 13 | wint_t fputwc_unlocked(wchar_t wc, FILE *stream) |
| 14 | { |
| 15 | return _wstdio_fwrite(&wc, 1, stream) ? wc : WEOF; |
| 16 | } |
| 17 | libc_hidden_def(fputwc_unlocked) |
| 18 | |
| 19 | strong_alias(fputwc_unlocked,putwc_unlocked) |
| 20 | #ifndef __UCLIBC_HAS_THREADS__ |
| 21 | strong_alias(fputwc_unlocked,fputwc) |
| 22 | strong_alias(fputwc_unlocked,putwc) |
| 23 | #endif |
| 24 | |
| 25 | #elif defined __UCLIBC_HAS_THREADS__ |
| 26 | |
| 27 | wint_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 | |
| 41 | strong_alias(fputwc,putwc) |
| 42 | |
| 43 | #endif |