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/time/asctime_r.c | 1 - src/time/clock_gettime.c | 1 - src/time/clock_nanosleep.c | 1 - src/time/gmtime_r.c | 1 - src/time/localtime_r.c | 2 +- src/time/nanosleep.c | 1 - src/time/strftime.c | 1 - src/time/wcsftime.c | 1 - 8 files changed, 1 insertion(+), 8 deletions(-) (limited to 'src/time') diff --git a/src/time/asctime_r.c b/src/time/asctime_r.c index af2618de..26809ca2 100644 --- a/src/time/asctime_r.c +++ b/src/time/asctime_r.c @@ -3,7 +3,6 @@ #include #include "locale_impl.h" #include "atomic.h" -#include "libc.h" char *__asctime_r(const struct tm *restrict tm, char *restrict buf) { diff --git a/src/time/clock_gettime.c b/src/time/clock_gettime.c index c24fe173..8fd1b8f5 100644 --- a/src/time/clock_gettime.c +++ b/src/time/clock_gettime.c @@ -2,7 +2,6 @@ #include #include #include "syscall.h" -#include "libc.h" #include "atomic.h" #ifdef VDSO_CGT_SYM diff --git a/src/time/clock_nanosleep.c b/src/time/clock_nanosleep.c index 9e4d9f1f..32f0c07e 100644 --- a/src/time/clock_nanosleep.c +++ b/src/time/clock_nanosleep.c @@ -1,7 +1,6 @@ #include #include #include "syscall.h" -#include "libc.h" int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem) { diff --git a/src/time/gmtime_r.c b/src/time/gmtime_r.c index e529799b..22aec2c2 100644 --- a/src/time/gmtime_r.c +++ b/src/time/gmtime_r.c @@ -1,6 +1,5 @@ #include "time_impl.h" #include -#include "libc.h" struct tm *__gmtime_r(const time_t *restrict t, struct tm *restrict tm) { diff --git a/src/time/localtime_r.c b/src/time/localtime_r.c index 2e62c29f..1a15b314 100644 --- a/src/time/localtime_r.c +++ b/src/time/localtime_r.c @@ -1,6 +1,6 @@ #include "time_impl.h" #include -#include "libc.h" +#include struct tm *__localtime_r(const time_t *restrict t, struct tm *restrict tm) { diff --git a/src/time/nanosleep.c b/src/time/nanosleep.c index a2ff4839..1e6f3922 100644 --- a/src/time/nanosleep.c +++ b/src/time/nanosleep.c @@ -1,6 +1,5 @@ #include #include "syscall.h" -#include "libc.h" int nanosleep(const struct timespec *req, struct timespec *rem) { diff --git a/src/time/strftime.c b/src/time/strftime.c index ba18a27c..cc53d536 100644 --- a/src/time/strftime.c +++ b/src/time/strftime.c @@ -6,7 +6,6 @@ #include #include #include "locale_impl.h" -#include "libc.h" #include "time_impl.h" static int is_leap(int y) diff --git a/src/time/wcsftime.c b/src/time/wcsftime.c index 31b30caf..8e1437b3 100644 --- a/src/time/wcsftime.c +++ b/src/time/wcsftime.c @@ -3,7 +3,6 @@ #include #include "locale_impl.h" #include "time_impl.h" -#include "libc.h" size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc) { -- cgit v1.2.1