diff options
Diffstat (limited to 'include/libio.h')
-rw-r--r-- | include/libio.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/libio.h b/include/libio.h index 97fc5b5..d2fa796 100644 --- a/include/libio.h +++ b/include/libio.h @@ -21,16 +21,25 @@ libc_hidden_proto (_IO_sgetn) libc_hidden_proto (_IO_vfprintf) libc_hidden_proto (_IO_vfscanf) -#if defined _IO_MTSAFE_IO && _IO_lock_inexpensive +#ifdef _IO_MTSAFE_IO +# undef _IO_peekc # undef _IO_flockfile -# define _IO_flockfile(_fp) \ - if (((_fp)->_flags & _IO_USER_LOCK) == 0) \ - _IO_lock_lock (*(_fp)->_lock) # undef _IO_funlockfile -# define _IO_funlockfile(_fp) \ - if (((_fp)->_flags & _IO_USER_LOCK) == 0) \ - _IO_lock_unlock (*(_fp)->_lock) -#endif +# undef _IO_ftrylockfile + +# define _IO_peekc(_fp) _IO_peekc_locked (_fp) +# if _IO_lock_inexpensive +# define _IO_flockfile(_fp) \ + if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock) +# define _IO_funlockfile(_fp) \ + if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock) +# else +# define _IO_flockfile(_fp) \ + if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp) +# define _IO_funlockfile(_fp) \ + if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp) +# endif +#endif /* _IO_MTSAFE_IO */ #endif #endif |