diff options
Diffstat (limited to 'libc/stdio/local.h')
-rw-r--r-- | libc/stdio/local.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/stdio/local.h b/libc/stdio/local.h index 46b11f13a..ce0414129 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -111,8 +111,8 @@ extern void __atexit_register_cleanup(void (*)(void)); (fp)->_lb._base = NULL; \ } -#define FLOCKFILE(fp) flockfile(fp) -#define FUNLOCKFILE(fp) funlockfile(fp) +#define FLOCKFILE(fp) if (_EXT(fp)->_stdio_handles_locking) flockfile(fp) +#define FUNLOCKFILE(fp) if (_EXT(fp)->_stdio_handles_locking) funlockfile(fp) #define FLOATING_POINT #define PRINTF_WIDE_CHAR @@ -124,6 +124,7 @@ extern void __atexit_register_cleanup(void (*)(void)); #define __sferror(p) (((p)->_flags & __SERR) != 0) #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) #define __sfileno(p) ((p)->_file) +#if !defined(__cplusplus) #define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) static __inline int __sputc(int _c, FILE* _p) { if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) { @@ -132,6 +133,7 @@ static __inline int __sputc(int _c, FILE* _p) { return (__swbuf(_c, _p)); } } +#endif /* OpenBSD declares these in fvwrite.h but we want to ensure they're hidden. */ struct __suio; |