From 6c6c962a202299b55d180e04f44a63ffb748096c Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Mon, 5 Feb 2018 13:09:15 -0500 Subject: Post-cleanup 1: move libio.h back out of bits/. We can't go very far with libio cleanups as long as we still have _IO_MTSAFE_IO, and I am not tackling that in this patch series, but we can at least make the maze of stdio-related headers a little less complicated. In this patch, libio.h moves back out of bits/ into the top level of the libio subdirectory, and is merged with libio/bits/libio-ldbl.h (which also used to be installed) and include/libio.h. Since almost no files include libio.h directly, this is quite straightforward. libio.h is now always used with _LIBC defined, so all of the _LIBC || _GLIBCPP_USE_WCHAR_T conditionals are unnecessary. Similarly, the ifdef nest surrounding the definition of _IO_fwide_maybe_incompatible can collapse down to a single SHLIB_COMPAT check. I also took the opportunity to add some checks for configuration botches to libio.h. Installed stripped libraries are unchanged by this patch. * libio/bits/libio.h: Move back to libio/libio.h and adjust multiple-include guard to match. Merge contents of libio/bits/libio-ldbl.h and include/libio.h into this file. Remove preprocessor conditionals that are always true and/or redundant to other preprocessor conditionals in the same nest. Include shlib-compat.h unconditionally. Error out if _LIBC is not defined, or if _ISOMAC is defined, or if _IO_MTSAFE_IO is defined but _IO_lock_t_defined is not defined after including stdio.h. Use __BEGIN_DECLS/__END_DECLS. * libio/bits/libio-ldbl.h, include/bits/libio.h: Delete file. * include/stdio.h, libio/iolibio.h, libio/libioP.h: Include libio.h as rather than as . --- include/bits/libio.h | 45 --------------------------------------------- include/stdio.h | 2 +- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 include/bits/libio.h (limited to 'include') diff --git a/include/bits/libio.h b/include/bits/libio.h deleted file mode 100644 index 572395d5ff..0000000000 --- a/include/bits/libio.h +++ /dev/null @@ -1,45 +0,0 @@ -#if !defined _ISOMAC && defined _IO_MTSAFE_IO -# include -#endif -#include - -#ifndef _ISOMAC -#ifndef _LIBC_LIBIO_H -#define _LIBC_LIBIO_H - -libc_hidden_proto (__overflow) -libc_hidden_proto (__underflow) -libc_hidden_proto (__uflow) -libc_hidden_proto (__woverflow) -libc_hidden_proto (__wunderflow) -libc_hidden_proto (__wuflow) -libc_hidden_proto (_IO_free_backup_area) -libc_hidden_proto (_IO_free_wbackup_area) -libc_hidden_proto (_IO_padn) -libc_hidden_proto (_IO_putc) -libc_hidden_proto (_IO_sgetn) -libc_hidden_proto (_IO_vfprintf) -libc_hidden_proto (_IO_vfscanf) - -#ifdef _IO_MTSAFE_IO -# undef _IO_peekc -# undef _IO_flockfile -# undef _IO_funlockfile -# 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 diff --git a/include/stdio.h b/include/stdio.h index 3b6da17d82..f12b281b4d 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -5,7 +5,7 @@ # include # ifndef _ISOMAC # define _LIBC_STDIO_H 1 -# include +# include /* Now define the internal interfaces. */ -- cgit v1.2.3