aboutsummaryrefslogtreecommitdiff
path: root/libio/libio.h
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2018-02-07 19:21:54 -0500
committerZack Weinberg <zackw@panix.com>2018-02-21 14:13:21 -0500
commit177aad3ff637b32550aec8080314d76a189f7a03 (patch)
tree723dccbc1ca410f26efa1f49c741f0c188057a49 /libio/libio.h
parent9964a14579e5eef925aaa82facc4980f627802fe (diff)
downloadglibc-177aad3ff637b32550aec8080314d76a189f7a03.zip
glibc-177aad3ff637b32550aec8080314d76a189f7a03.tar.gz
glibc-177aad3ff637b32550aec8080314d76a189f7a03.tar.bz2
Remove legacy configuration knobs from libio.
This patch eliminates the "compatibility defines" _IO_UNIFIED_JUMPTABLES (always defined to 1, used in a number of #ifs which are therefore always false), _STDIO_USES_IOSTREAM (unused), __HAVE_COLUMN (unused), _IO_BE (replaced with __glibc_unlikely), and yet another redundant definition of EOF. Installed stripped libraries are unchanged by this patch. * libio/libio.h (_IO_UNIFIED_JUMPTABLES, _STDIO_USES_IOSTREAM) (__HAVE_COLUMN, _IO_BE): Don't define. (_IO_peekc_unlocked, _IO_getwc_unlocked, _IO_putwc_unlocked) (_IO_fwide_maybe_incompatible): Use __glibc_unlikely. * libio/libioP.h (EOF): Don't define. * libio/iofdopen.c, libio/iofopen.c, libio/iopopen.c * libio/iovdprintf.c, libio/oldiofdopen.c, libio/oldiofopen.c * libio/oldiopopen.c, debug/vdprintf_chk.c: Remove #if block testing _IO_UNIFIED_JUMPTABLES.
Diffstat (limited to 'libio/libio.h')
-rw-r--r--libio/libio.h36
1 files changed, 14 insertions, 22 deletions
diff --git a/libio/libio.h b/libio/libio.h
index 890b825..a3c679c 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -61,9 +61,6 @@ typedef union
#include <shlib-compat.h>
/* compatibility defines */
-#define _STDIO_USES_IOSTREAM
-#define _IO_UNIFIED_JUMPTABLES 1
-#define __HAVE_COLUMN
#define _IO_file_flags _flags
/* open modes */
@@ -228,28 +225,23 @@ extern wint_t __wunderflow (FILE *);
extern wint_t __wuflow (FILE *);
extern wint_t __woverflow (FILE *, wint_t);
-#if __GNUC__ >= 3
-# define _IO_BE(expr, res) __builtin_expect ((expr), res)
-#else
-# define _IO_BE(expr, res) (expr)
-#endif
-
#define _IO_getc_unlocked(_fp) __getc_unlocked_body (_fp)
-#define _IO_peekc_unlocked(_fp) \
- (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \
- && __underflow (_fp) == EOF ? EOF \
- : *(unsigned char *) (_fp)->_IO_read_ptr)
+#define _IO_peekc_unlocked(_fp) \
+ (__glibc_unlikely ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end) \
+ && __underflow (_fp) == EOF \
+ ? EOF \
+ : *(unsigned char *) (_fp)->_IO_read_ptr)
#define _IO_putc_unlocked(_ch, _fp) __putc_unlocked_body (_ch, _fp)
-# define _IO_getwc_unlocked(_fp) \
- (_IO_BE ((_fp)->_wide_data == NULL \
- || ((_fp)->_wide_data->_IO_read_ptr \
- >= (_fp)->_wide_data->_IO_read_end), 0) \
+# define _IO_getwc_unlocked(_fp) \
+ (__glibc_unlikely ((_fp)->_wide_data == NULL \
+ || ((_fp)->_wide_data->_IO_read_ptr \
+ >= (_fp)->_wide_data->_IO_read_end)) \
? __wuflow (_fp) : (wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
-# define _IO_putwc_unlocked(_wch, _fp) \
- (_IO_BE ((_fp)->_wide_data == NULL \
- || ((_fp)->_wide_data->_IO_write_ptr \
- >= (_fp)->_wide_data->_IO_write_end), 0) \
+# define _IO_putwc_unlocked(_wch, _fp) \
+ (__glibc_unlikely ((_fp)->_wide_data == NULL \
+ || ((_fp)->_wide_data->_IO_write_ptr \
+ >= (_fp)->_wide_data->_IO_write_end)) \
? __woverflow (_fp, _wch) \
: (wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
@@ -304,7 +296,7 @@ extern int _IO_fwide (FILE *__fp, int __mode) __THROW;
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
# define _IO_fwide_maybe_incompatible \
- (__builtin_expect (&_IO_stdin_used == NULL, 0))
+ (__glibc_unlikely (&_IO_stdin_used == NULL))
extern const int _IO_stdin_used;
weak_extern (_IO_stdin_used);
#else