summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorJesse Buhagiar <jooster669@gmail.com>2022-01-02 01:16:04 +1100
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-01-04 07:27:04 +0000
commiteefad5ccd7ff79695a4b6413d0072cabc093bed5 (patch)
tree1d40f11d17f5c08a83c63698dc2d6a22d24d01ba /Userland
parent857c8850f3127718dbe349bdc8bb7aed6f16ace4 (diff)
downloadserenity-eefad5ccd7ff79695a4b6413d0072cabc093bed5.zip
LibC: Include `strings.h` in `string.h`
Certain C Libraries have (unfortunately) included strings.h as a part of string.h, which violates the POSIX spec for that specific header. Some applications rely on this being the case, so let's include it in our string.h
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibC/string.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/string.h b/Userland/Libraries/LibC/string.h
index 44dabc3e36..71ffb914b2 100644
--- a/Userland/Libraries/LibC/string.h
+++ b/Userland/Libraries/LibC/string.h
@@ -11,6 +11,11 @@
__BEGIN_DECLS
+// A few C Standard Libraries include this header in <string.h>, and hence expect
+// `strcasecmp` etcetera to be available as part of a <string.h> include, so let's
+// do the same here to maintain compatibility
+#include <strings.h>
+
size_t strlen(const char*);
size_t strnlen(const char*, size_t maxlen);