Skip to content

Commit

Permalink
LibC: Include strings.h in string.h
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Quaker762 authored and bgianfo committed Jan 4, 2022
1 parent 857c885 commit eefad5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Userland/Libraries/LibC/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit eefad5c

Please sign in to comment.