1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

* include/stdio_ext.h (__fsetlocking): Define as macro.

This commit is contained in:
Ulrich Drepper
2007-10-01 21:21:46 +00:00
parent a7f573e5dc
commit 035ef8d757
2 changed files with 18 additions and 3 deletions

View File

@ -4,8 +4,19 @@
extern int __fsetlocking_internal (FILE *__fp, int __type) attribute_hidden;
#ifndef NOT_IN_libc
# define __fsetlocking(fp, type) INTUSE(__fsetlocking) (fp, type)
#endif
#define __fsetlocking(fp, type) \
({ int __result = ((fp->_flags & _IO_USER_LOCK) \
? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL); \
\
if (type != FSETLOCKING_QUERY) \
{ \
fp->_flags &= ~_IO_USER_LOCK; \
if (type == FSETLOCKING_BYCALLER) \
fp->_flags |= _IO_USER_LOCK; \
} \
\
__result; \
})
#endif