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/math/exp10.c | 1 - src/math/exp10f.c | 1 - src/math/exp10l.c | 1 - src/math/lgamma_r.c | 1 - src/math/lgammaf_r.c | 1 - src/math/lgammal.c | 1 - src/math/remainder.c | 1 - src/math/remainderf.c | 1 - src/math/signgam.c | 1 - 9 files changed, 9 deletions(-) (limited to 'src/math') diff --git a/src/math/exp10.c b/src/math/exp10.c index 9f5e3c2c..26899eba 100644 --- a/src/math/exp10.c +++ b/src/math/exp10.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include -#include "libc.h" double exp10(double x) { diff --git a/src/math/exp10f.c b/src/math/exp10f.c index 7a8d4470..d009f0a8 100644 --- a/src/math/exp10f.c +++ b/src/math/exp10f.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include -#include "libc.h" float exp10f(float x) { diff --git a/src/math/exp10l.c b/src/math/exp10l.c index b758ebff..f3da1a08 100644 --- a/src/math/exp10l.c +++ b/src/math/exp10l.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include -#include "libc.h" #include "libm.h" #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 diff --git a/src/math/lgamma_r.c b/src/math/lgamma_r.c index fff565d2..f9984cd0 100644 --- a/src/math/lgamma_r.c +++ b/src/math/lgamma_r.c @@ -79,7 +79,6 @@ */ #include "libm.h" -#include "libc.h" static const double pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */ diff --git a/src/math/lgammaf_r.c b/src/math/lgammaf_r.c index c5b43db5..3f353f19 100644 --- a/src/math/lgammaf_r.c +++ b/src/math/lgammaf_r.c @@ -14,7 +14,6 @@ */ #include "libm.h" -#include "libc.h" static const float pi = 3.1415927410e+00, /* 0x40490fdb */ diff --git a/src/math/lgammal.c b/src/math/lgammal.c index 8c798123..abbd4fc6 100644 --- a/src/math/lgammal.c +++ b/src/math/lgammal.c @@ -87,7 +87,6 @@ #define _GNU_SOURCE #include "libm.h" -#include "libc.h" #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 long double __lgammal_r(long double x, int *sg) diff --git a/src/math/remainder.c b/src/math/remainder.c index 6cd089c4..612155fe 100644 --- a/src/math/remainder.c +++ b/src/math/remainder.c @@ -1,5 +1,4 @@ #include -#include "libc.h" double remainder(double x, double y) { diff --git a/src/math/remainderf.c b/src/math/remainderf.c index 420d3bfc..bf1d7b28 100644 --- a/src/math/remainderf.c +++ b/src/math/remainderf.c @@ -1,5 +1,4 @@ #include -#include "libc.h" float remainderf(float x, float y) { diff --git a/src/math/signgam.c b/src/math/signgam.c index b4903a58..ee331b27 100644 --- a/src/math/signgam.c +++ b/src/math/signgam.c @@ -1,6 +1,5 @@ #include #include "libm.h" -#include "libc.h" int __signgam = 0; -- cgit v1.2.1