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/locale/__lctrans.c | 1 - src/locale/dcngettext.c | 1 - src/locale/freelocale.c | 1 - src/locale/langinfo.c | 1 - src/locale/newlocale.c | 1 - src/locale/strcoll.c | 1 - src/locale/strxfrm.c | 1 - src/locale/textdomain.c | 2 -- src/locale/wcscoll.c | 1 - src/locale/wcsxfrm.c | 1 - 10 files changed, 11 deletions(-) (limited to 'src/locale') diff --git a/src/locale/__lctrans.c b/src/locale/__lctrans.c index 107fe14a..9fbe762a 100644 --- a/src/locale/__lctrans.c +++ b/src/locale/__lctrans.c @@ -1,6 +1,5 @@ #include #include "locale_impl.h" -#include "libc.h" static const char *dummy(const char *msg, const struct __locale_map *lm) { diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c index fc1018df..eefa31a8 100644 --- a/src/locale/dcngettext.c +++ b/src/locale/dcngettext.c @@ -7,7 +7,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" #include "atomic.h" #include "pleval.h" diff --git a/src/locale/freelocale.c b/src/locale/freelocale.c index e75acd66..802b8bfe 100644 --- a/src/locale/freelocale.c +++ b/src/locale/freelocale.c @@ -1,6 +1,5 @@ #include #include "locale_impl.h" -#include "libc.h" void freelocale(locale_t l) { diff --git a/src/locale/langinfo.c b/src/locale/langinfo.c index 83be6433..14773093 100644 --- a/src/locale/langinfo.c +++ b/src/locale/langinfo.c @@ -1,7 +1,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" static const char c_time[] = "Sun\0" "Mon\0" "Tue\0" "Wed\0" "Thu\0" "Fri\0" "Sat\0" diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c index f50bbe91..8fb006a7 100644 --- a/src/locale/newlocale.c +++ b/src/locale/newlocale.c @@ -1,7 +1,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" int __loc_is_allocated(locale_t loc) { diff --git a/src/locale/strcoll.c b/src/locale/strcoll.c index 84f199ff..dd3cbc48 100644 --- a/src/locale/strcoll.c +++ b/src/locale/strcoll.c @@ -1,7 +1,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" int __strcoll_l(const char *l, const char *r, locale_t loc) { diff --git a/src/locale/strxfrm.c b/src/locale/strxfrm.c index 14b76a63..c66c6203 100644 --- a/src/locale/strxfrm.c +++ b/src/locale/strxfrm.c @@ -1,7 +1,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" /* collate only by code points */ size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t loc) diff --git a/src/locale/textdomain.c b/src/locale/textdomain.c index c501501d..d7275397 100644 --- a/src/locale/textdomain.c +++ b/src/locale/textdomain.c @@ -3,8 +3,6 @@ #include #include #include -#include "libc.h" -#include "atomic.h" static char *current_domain; diff --git a/src/locale/wcscoll.c b/src/locale/wcscoll.c index 14bb8b9f..ad2cc691 100644 --- a/src/locale/wcscoll.c +++ b/src/locale/wcscoll.c @@ -1,7 +1,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" /* FIXME: stub */ int __wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) diff --git a/src/locale/wcsxfrm.c b/src/locale/wcsxfrm.c index 0a0b776d..05e3e115 100644 --- a/src/locale/wcsxfrm.c +++ b/src/locale/wcsxfrm.c @@ -1,7 +1,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" /* collate only by code points */ size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc) -- cgit v1.2.1