This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Remove _G_HAVE_IO_GETLINE_INFO
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Sun, 16 Sep 2012 19:33:50 +0000
- Subject: Remove _G_HAVE_IO_GETLINE_INFO
The macro _G_HAVE_IO_GETLINE_INFO, defined in _G_config.h, is used
only in two places in libio as part of a conditional "#if defined
_LIBC || !_G_HAVE_IO_GETLINE_INFO". Since this code is only used in
libc, _LIBC is always defined here and the conditional is redundant
and _G_HAVE_IO_GETLINE_INFO is effectively unused. This patch removes
the macro and the conditionals that used it.
Tested x86_64 that the same code is produced for glibc's shared
libraries before and after the patch.
2012-09-16 Joseph Myers <joseph@codesourcery.com>
* libio/iogetline.c [_LIBC || !_G_HAVE_IO_GETLINE_INFO]: Make code
unconditional.
* libio/iogetwline.c [_LIBC || !_G_HAVE_IO_GETLINE_INFO]:
Likewise.
* sysdeps/generic/_G_config.h (_G_HAVE_IO_GETLINE_INFO): Remove.
* sysdeps/gnu/_G_config.h (_G_HAVE_IO_GETLINE_INFO): Likewise.
* sysdeps/mach/hurd/_G_config.h (_G_HAVE_IO_GETLINE_INFO):
Likewise.
diff --git a/libio/iogetline.c b/libio/iogetline.c
index f097f80..bdb35b3 100644
--- a/libio/iogetline.c
+++ b/libio/iogetline.c
@@ -27,8 +27,6 @@
#include "libioP.h"
#include <string.h>
-#if defined _LIBC || !_G_HAVE_IO_GETLINE_INFO
-
_IO_size_t
_IO_getline (fp, buf, n, delim, extract_delim)
_IO_FILE *fp;
@@ -117,5 +115,3 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
return ptr - buf;
}
libc_hidden_def (_IO_getline_info)
-
-#endif /* Defined _LIBC || !_G_HAVE_IO_GETLINE_INFO */
diff --git a/libio/iogetwline.c b/libio/iogetwline.c
index 598ece1..63b7da6 100644
--- a/libio/iogetwline.c
+++ b/libio/iogetwline.c
@@ -32,8 +32,6 @@
# define wmemcpy __wmemcpy
#endif
-#if defined _LIBC || !_G_HAVE_IO_GETLINE_INFO
-
_IO_size_t
_IO_getwline (fp, buf, n, delim, extract_delim)
_IO_FILE *fp;
@@ -122,5 +120,3 @@ _IO_getwline_info (fp, buf, n, delim, extract_delim, eof)
}
return ptr - buf;
}
-
-#endif /* Defined _LIBC || !_G_HAVE_IO_GETLINE_INFO */
diff --git a/sysdeps/generic/_G_config.h b/sysdeps/generic/_G_config.h
index df08676..71974ca 100644
--- a/sysdeps/generic/_G_config.h
+++ b/sysdeps/generic/_G_config.h
@@ -57,7 +57,6 @@ typedef union
#define _G_va_list __gnuc_va_list
#define _G_HAVE_MMAP 1
-#define _G_HAVE_IO_GETLINE_INFO 1
#define _G_IO_IO_FILE_VERSION 0x20001
diff --git a/sysdeps/gnu/_G_config.h b/sysdeps/gnu/_G_config.h
index 7d71643..604fa2e 100644
--- a/sysdeps/gnu/_G_config.h
+++ b/sysdeps/gnu/_G_config.h
@@ -58,7 +58,6 @@ typedef union
#define _G_HAVE_MMAP 1
#define _G_HAVE_MREMAP 1
-#define _G_HAVE_IO_GETLINE_INFO 1
#define _G_IO_IO_FILE_VERSION 0x20001
diff --git a/sysdeps/mach/hurd/_G_config.h b/sysdeps/mach/hurd/_G_config.h
index 0808a55..70de3c6 100644
--- a/sysdeps/mach/hurd/_G_config.h
+++ b/sysdeps/mach/hurd/_G_config.h
@@ -57,7 +57,6 @@ typedef union
#define _G_va_list __gnuc_va_list
#define _G_HAVE_MMAP 1
-#define _G_HAVE_IO_GETLINE_INFO 1
#define _G_IO_IO_FILE_VERSION 0x20001
--
Joseph S. Myers
joseph@codesourcery.com