From 035ef8d75735b3cee4daa87f17abe682551a1a9f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 1 Oct 2007 21:21:46 +0000 Subject: * include/stdio_ext.h (__fsetlocking): Define as macro. --- include/stdio_ext.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/stdio_ext.h b/include/stdio_ext.h index 31c7a4e..c7b7724 100644 --- a/include/stdio_ext.h +++ b/include/stdio_ext.h @@ -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 -- cgit v1.1