fputwc.c 849 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #include "_stdio.h"
  8. #ifdef __DO_UNLOCKED
  9. wint_t fputwc_unlocked(wchar_t wc, FILE *stream)
  10. {
  11. return _wstdio_fwrite(&wc, 1, stream) ? wc : WEOF;
  12. }
  13. libc_hidden_def(fputwc_unlocked)
  14. strong_alias(fputwc_unlocked,putwc_unlocked)
  15. #ifndef __UCLIBC_HAS_THREADS__
  16. strong_alias(fputwc_unlocked,fputwc)
  17. strong_alias(fputwc_unlocked,putwc)
  18. #endif
  19. #elif defined __UCLIBC_HAS_THREADS__
  20. wint_t fputwc(wchar_t wc, register FILE *stream)
  21. {
  22. wint_t retval;
  23. __STDIO_AUTO_THREADLOCK_VAR;
  24. __STDIO_AUTO_THREADLOCK(stream);
  25. retval = fputwc_unlocked(wc, stream);
  26. __STDIO_AUTO_THREADUNLOCK(stream);
  27. return retval;
  28. }
  29. strong_alias(fputwc,putwc)
  30. #endif