From 5ce3737931bb411a8d167356d4d0287b53b0cbdc Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 12 Sep 2018 00:08:09 -0400 Subject: reduce spurious inclusion of libc.h libc.h was intended to be a header for access to global libc state and related interfaces, but ended up included all over the place because it was the way to get the weak_alias macro. most of the inclusions removed here are places where weak_alias was needed. a few were recently introduced for hidden. some go all the way back to when libc.h defined CANCELPT_BEGIN and _END, and all (wrongly implemented) cancellation points had to include it. remaining spurious users are mostly callers of the LOCK/UNLOCK macros and files that use the LFS64 macro to define the awful *64 aliases. in a few places, new inclusion of libc.h is added because several internal headers no longer implicitly include libc.h. declarations for __lockfile and __unlockfile are moved from libc.h to stdio_impl.h so that the latter does not need libc.h. putting them in libc.h made no sense at all, since the macros in stdio_impl.h are needed to use them correctly anyway. --- src/ctype/isalnum.c | 1 - src/ctype/isalpha.c | 1 - src/ctype/isblank.c | 1 - src/ctype/iscntrl.c | 1 - src/ctype/isdigit.c | 1 - src/ctype/isgraph.c | 1 - src/ctype/islower.c | 1 - src/ctype/isprint.c | 1 - src/ctype/ispunct.c | 1 - src/ctype/isspace.c | 1 - src/ctype/isupper.c | 1 - src/ctype/iswalnum.c | 1 - src/ctype/iswalpha.c | 1 - src/ctype/iswblank.c | 1 - src/ctype/iswcntrl.c | 1 - src/ctype/iswctype.c | 1 - src/ctype/iswdigit.c | 1 - src/ctype/iswgraph.c | 1 - src/ctype/iswlower.c | 1 - src/ctype/iswprint.c | 1 - src/ctype/iswpunct.c | 1 - src/ctype/iswspace.c | 1 - src/ctype/iswupper.c | 1 - src/ctype/iswxdigit.c | 1 - src/ctype/isxdigit.c | 1 - src/ctype/tolower.c | 1 - src/ctype/toupper.c | 1 - src/ctype/towctrans.c | 2 +- src/ctype/wctrans.c | 1 - 29 files changed, 1 insertion(+), 29 deletions(-) (limited to 'src/ctype') diff --git a/src/ctype/isalnum.c b/src/ctype/isalnum.c index 2214936f..8018a2bc 100644 --- a/src/ctype/isalnum.c +++ b/src/ctype/isalnum.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int isalnum(int c) { diff --git a/src/ctype/isalpha.c b/src/ctype/isalpha.c index f155d3aa..a87a9375 100644 --- a/src/ctype/isalpha.c +++ b/src/ctype/isalpha.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef isalpha int isalpha(int c) diff --git a/src/ctype/isblank.c b/src/ctype/isblank.c index 299120e9..716da23a 100644 --- a/src/ctype/isblank.c +++ b/src/ctype/isblank.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int isblank(int c) { diff --git a/src/ctype/iscntrl.c b/src/ctype/iscntrl.c index cb4114a0..f27837ea 100644 --- a/src/ctype/iscntrl.c +++ b/src/ctype/iscntrl.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iscntrl(int c) { diff --git a/src/ctype/isdigit.c b/src/ctype/isdigit.c index 4d8a103e..16beddb4 100644 --- a/src/ctype/isdigit.c +++ b/src/ctype/isdigit.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef isdigit int isdigit(int c) diff --git a/src/ctype/isgraph.c b/src/ctype/isgraph.c index a0aae08a..292d1983 100644 --- a/src/ctype/isgraph.c +++ b/src/ctype/isgraph.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef isgraph int isgraph(int c) diff --git a/src/ctype/islower.c b/src/ctype/islower.c index 02640213..c3fa74c4 100644 --- a/src/ctype/islower.c +++ b/src/ctype/islower.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef islower int islower(int c) diff --git a/src/ctype/isprint.c b/src/ctype/isprint.c index 067275fa..b950816b 100644 --- a/src/ctype/isprint.c +++ b/src/ctype/isprint.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef isprint int isprint(int c) diff --git a/src/ctype/ispunct.c b/src/ctype/ispunct.c index e772d76a..a491d5dc 100644 --- a/src/ctype/ispunct.c +++ b/src/ctype/ispunct.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int ispunct(int c) { diff --git a/src/ctype/isspace.c b/src/ctype/isspace.c index 231e9079..428813e7 100644 --- a/src/ctype/isspace.c +++ b/src/ctype/isspace.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef isspace int isspace(int c) diff --git a/src/ctype/isupper.c b/src/ctype/isupper.c index 68c36f4a..bfd15acd 100644 --- a/src/ctype/isupper.c +++ b/src/ctype/isupper.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef isupper int isupper(int c) diff --git a/src/ctype/iswalnum.c b/src/ctype/iswalnum.c index a6082da4..046c399c 100644 --- a/src/ctype/iswalnum.c +++ b/src/ctype/iswalnum.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iswalnum(wint_t wc) { diff --git a/src/ctype/iswalpha.c b/src/ctype/iswalpha.c index 00f9d81f..1c5485d2 100644 --- a/src/ctype/iswalpha.c +++ b/src/ctype/iswalpha.c @@ -1,5 +1,4 @@ #include -#include "libc.h" static const unsigned char table[] = { #include "alpha.h" diff --git a/src/ctype/iswblank.c b/src/ctype/iswblank.c index d9b33ef4..68c88002 100644 --- a/src/ctype/iswblank.c +++ b/src/ctype/iswblank.c @@ -1,6 +1,5 @@ #include #include -#include "libc.h" int iswblank(wint_t wc) { diff --git a/src/ctype/iswcntrl.c b/src/ctype/iswcntrl.c index daace82a..feccfcd5 100644 --- a/src/ctype/iswcntrl.c +++ b/src/ctype/iswcntrl.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iswcntrl(wint_t wc) { diff --git a/src/ctype/iswctype.c b/src/ctype/iswctype.c index 3d9c2cc7..71b09b8d 100644 --- a/src/ctype/iswctype.c +++ b/src/ctype/iswctype.c @@ -1,6 +1,5 @@ #include #include -#include "libc.h" #define WCTYPE_ALNUM 1 #define WCTYPE_ALPHA 2 diff --git a/src/ctype/iswdigit.c b/src/ctype/iswdigit.c index ed9a88e7..db817edf 100644 --- a/src/ctype/iswdigit.c +++ b/src/ctype/iswdigit.c @@ -1,5 +1,4 @@ #include -#include "libc.h" #undef iswdigit diff --git a/src/ctype/iswgraph.c b/src/ctype/iswgraph.c index 0ea5ca3a..ecdf466c 100644 --- a/src/ctype/iswgraph.c +++ b/src/ctype/iswgraph.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iswgraph(wint_t wc) { diff --git a/src/ctype/iswlower.c b/src/ctype/iswlower.c index 79df44a3..f02a4362 100644 --- a/src/ctype/iswlower.c +++ b/src/ctype/iswlower.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iswlower(wint_t wc) { diff --git a/src/ctype/iswprint.c b/src/ctype/iswprint.c index 69856e0d..86f9d646 100644 --- a/src/ctype/iswprint.c +++ b/src/ctype/iswprint.c @@ -1,5 +1,4 @@ #include -#include "libc.h" /* Consider all legal codepoints as printable except for: * - C0 and C1 control characters diff --git a/src/ctype/iswpunct.c b/src/ctype/iswpunct.c index d8801046..f0b9ea0a 100644 --- a/src/ctype/iswpunct.c +++ b/src/ctype/iswpunct.c @@ -1,5 +1,4 @@ #include -#include "libc.h" static const unsigned char table[] = { #include "punct.h" diff --git a/src/ctype/iswspace.c b/src/ctype/iswspace.c index 75ae7e8e..263afa15 100644 --- a/src/ctype/iswspace.c +++ b/src/ctype/iswspace.c @@ -1,6 +1,5 @@ #include #include -#include "libc.h" /* Our definition of whitespace is the Unicode White_Space property, * minus non-breaking spaces (U+00A0, U+2007, and U+202F) and script- diff --git a/src/ctype/iswupper.c b/src/ctype/iswupper.c index 6e1e029c..7e486665 100644 --- a/src/ctype/iswupper.c +++ b/src/ctype/iswupper.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iswupper(wint_t wc) { diff --git a/src/ctype/iswxdigit.c b/src/ctype/iswxdigit.c index 1e27f1f0..62bc9e74 100644 --- a/src/ctype/iswxdigit.c +++ b/src/ctype/iswxdigit.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int iswxdigit(wint_t wc) { diff --git a/src/ctype/isxdigit.c b/src/ctype/isxdigit.c index 0e9152a7..aab1a745 100644 --- a/src/ctype/isxdigit.c +++ b/src/ctype/isxdigit.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int isxdigit(int c) { diff --git a/src/ctype/tolower.c b/src/ctype/tolower.c index 362d6b2b..f10132ec 100644 --- a/src/ctype/tolower.c +++ b/src/ctype/tolower.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int tolower(int c) { diff --git a/src/ctype/toupper.c b/src/ctype/toupper.c index bbf4e06e..4e74a55c 100644 --- a/src/ctype/toupper.c +++ b/src/ctype/toupper.c @@ -1,5 +1,4 @@ #include -#include "libc.h" int toupper(int c) { diff --git a/src/ctype/towctrans.c b/src/ctype/towctrans.c index 12355af1..8f681018 100644 --- a/src/ctype/towctrans.c +++ b/src/ctype/towctrans.c @@ -1,6 +1,6 @@ #include +#include #include -#include "libc.h" #define CASEMAP(u1,u2,l) { (u1), (l)-(u1), (u2)-(u1)+1 } #define CASELACE(u1,u2) CASEMAP((u1),(u2),(u1)+1) diff --git a/src/ctype/wctrans.c b/src/ctype/wctrans.c index b1b12654..d3eda521 100644 --- a/src/ctype/wctrans.c +++ b/src/ctype/wctrans.c @@ -1,6 +1,5 @@ #include #include -#include "libc.h" wctrans_t wctrans(const char *class) { -- cgit v1.2.1