fputwc.c 884 B

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