From 01a481d470af177b33bf07fc504792164bd6d275 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 13 Mar 2025 16:35:23 -0400 Subject: [PATCH] legacy stdc++: Make sure MTSAFE_IO is always enabled. It's set in _G_config.h, but this file doesn't include that, so in many cases the "unlocked" function was called instead. (Most of the stdc++ .cc files did have it set, though.) --- headers/cpp/libio.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/headers/cpp/libio.h b/headers/cpp/libio.h index 15d2cf18e8..258d052af6 100644 --- a/headers/cpp/libio.h +++ b/headers/cpp/libio.h @@ -181,26 +181,12 @@ extern int __uflow(_IO_FILE *stream); extern int __overflow(_IO_FILE *stream, int c); extern int _IO_peekc_locked(_IO_FILE *stream); - -/* This one is for Emacs. */ -#define _IO_PENDING_OUTPUT_COUNT(_fp) \ - ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) +#define _IO_peekc(_fp) _IO_peekc_locked (_fp) extern void _IO_flockfile(_IO_FILE *); extern void _IO_funlockfile(_IO_FILE *); extern int _IO_ftrylockfile(_IO_FILE *); -#ifdef _IO_MTSAFE_IO -# define _IO_peekc(_fp) _IO_peekc_locked (_fp) -#else -# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) -# define _IO_flockfile(_fp) /**/ -# define _IO_funlockfile(_fp) /**/ -# define _IO_ftrylockfile(_fp) /**/ -# define _IO_cleanup_region_start(_fct, _fp) /**/ -# define _IO_cleanup_region_end(_Doit) /**/ -#endif /* !_IO_MTSAFE_IO */ - extern int _IO_vfscanf(_IO_FILE *, const char *, va_list, int *); extern int _IO_vfprintf(_IO_FILE *, const char *, va_list); extern _IO_ssize_t _IO_padn(_IO_FILE *, int, _IO_ssize_t);