summaryrefslogtreecommitdiff
path: root/src/string
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2018-09-12 00:08:09 -0400
committerRich Felker <dalias@aerifal.cx>2018-09-12 14:34:37 -0400
commit5ce3737931bb411a8d167356d4d0287b53b0cbdc (patch)
tree726fc5dde9cc462316faa715158c38f0da72292d /src/string
parent0676c3a34c7bf12b33f8f5efb92476f4ffc7f20e (diff)
downloadmusl-5ce3737931bb411a8d167356d4d0287b53b0cbdc.tar.gz
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.
Diffstat (limited to 'src/string')
-rw-r--r--src/string/memrchr.c1
-rw-r--r--src/string/stpcpy.c1
-rw-r--r--src/string/stpncpy.c1
-rw-r--r--src/string/strcasecmp.c1
-rw-r--r--src/string/strchrnul.c1
-rw-r--r--src/string/strerror_r.c1
-rw-r--r--src/string/strlcpy.c1
-rw-r--r--src/string/strncasecmp.c1
-rw-r--r--src/string/wcsdup.c1
9 files changed, 0 insertions, 9 deletions
diff --git a/src/string/memrchr.c b/src/string/memrchr.c
index a78e9d6c..e51748b8 100644
--- a/src/string/memrchr.c
+++ b/src/string/memrchr.c
@@ -1,5 +1,4 @@
#include <string.h>
-#include "libc.h"
void *__memrchr(const void *m, int c, size_t n)
{
diff --git a/src/string/stpcpy.c b/src/string/stpcpy.c
index 06623c44..54cf9ca5 100644
--- a/src/string/stpcpy.c
+++ b/src/string/stpcpy.c
@@ -1,7 +1,6 @@
#include <string.h>
#include <stdint.h>
#include <limits.h>
-#include "libc.h"
#define ALIGN (sizeof(size_t))
#define ONES ((size_t)-1/UCHAR_MAX)
diff --git a/src/string/stpncpy.c b/src/string/stpncpy.c
index 1f57a4dd..d6d92ffc 100644
--- a/src/string/stpncpy.c
+++ b/src/string/stpncpy.c
@@ -1,7 +1,6 @@
#include <string.h>
#include <stdint.h>
#include <limits.h>
-#include "libc.h"
#define ALIGN (sizeof(size_t)-1)
#define ONES ((size_t)-1/UCHAR_MAX)
diff --git a/src/string/strcasecmp.c b/src/string/strcasecmp.c
index 3cd5f2d0..002c6aa1 100644
--- a/src/string/strcasecmp.c
+++ b/src/string/strcasecmp.c
@@ -1,6 +1,5 @@
#include <strings.h>
#include <ctype.h>
-#include "libc.h"
int strcasecmp(const char *_l, const char *_r)
{
diff --git a/src/string/strchrnul.c b/src/string/strchrnul.c
index 05700ad6..f2b9ae11 100644
--- a/src/string/strchrnul.c
+++ b/src/string/strchrnul.c
@@ -1,7 +1,6 @@
#include <string.h>
#include <stdint.h>
#include <limits.h>
-#include "libc.h"
#define ALIGN (sizeof(size_t))
#define ONES ((size_t)-1/UCHAR_MAX)
diff --git a/src/string/strerror_r.c b/src/string/strerror_r.c
index da26b4fe..1dc88bb1 100644
--- a/src/string/strerror_r.c
+++ b/src/string/strerror_r.c
@@ -1,6 +1,5 @@
#include <string.h>
#include <errno.h>
-#include "libc.h"
int strerror_r(int err, char *buf, size_t buflen)
{
diff --git a/src/string/strlcpy.c b/src/string/strlcpy.c
index 193d7241..dcb22f6e 100644
--- a/src/string/strlcpy.c
+++ b/src/string/strlcpy.c
@@ -2,7 +2,6 @@
#include <string.h>
#include <stdint.h>
#include <limits.h>
-#include "libc.h"
#define ALIGN (sizeof(size_t)-1)
#define ONES ((size_t)-1/UCHAR_MAX)
diff --git a/src/string/strncasecmp.c b/src/string/strncasecmp.c
index 3af53008..e0ef93c2 100644
--- a/src/string/strncasecmp.c
+++ b/src/string/strncasecmp.c
@@ -1,6 +1,5 @@
#include <strings.h>
#include <ctype.h>
-#include "libc.h"
int strncasecmp(const char *_l, const char *_r, size_t n)
{
diff --git a/src/string/wcsdup.c b/src/string/wcsdup.c
index dd49c1b6..f398e809 100644
--- a/src/string/wcsdup.c
+++ b/src/string/wcsdup.c
@@ -1,6 +1,5 @@
#include <stdlib.h>
#include <wchar.h>
-#include "libc.h"
wchar_t *wcsdup(const wchar_t *s)
{