I forgot to do this in be0e1aaf8f.
This makes us actually install that header into the sysroot, unbreaking
ports like openssl, which previously failed to build with:
"fatal error: Kernel/API/POSIX/winsize.h: No such file or directory"
This aligns the behavior with both Linux and OpenBSD (and probably all
other implementations of openpty).
This bug was visible in SSHServer, indeed when using an interactive
shell, the start pty size was always the default (80x25) instead of
whatever the client's window is using. It is quite visible with `top`,
which now fills the whole window :^)
It's wasteful to compute everything with long double precision when we
don't need it, so this change will be required down the road when we get
to make erf precise and fast. For the time being, this is more a
cosmetic change to align this implementation with others.
Before this commit, you could either use the inlinable function by
using the macro or have the externally-linked version by first
undefining the macro and then using the function.
This commit makes all the ctype functions both inlinable and have
external linkage at the same time. To pull this trick, we provide
inlinable definitions in ctype.h and use a dedicated C feature that
forces the symbol to be emitted in the TU of ctype.c.
This could also have been achieved by using some #ifdef to hide the
inline definition in ctype.h so a C++ compiler would still emit a normal
symbol for the functions in ctype.cpp.
This only affect the output if the current locale has alternative
representations. Given that on Serenity we only use the POSIX/C locale,
and it doesn't have any alternative representations, these modifiers are
basically useless.
"If the alternative format or specification does not exist for the
current locale [...], the behavior shall be as if the unmodified
conversion specification were used."
According to POSIX:
"In the POSIX locale the value of {MB_CUR_MAX} shall be 1."
As we only support "POSIX"-compatible locales, let's make MB_CUR_MAX
equal to 1. Note that if we start to support other locales, this macro
will need to defer to a runtime function.
The C++ standard defines strchr, strrchr, strpbrk, strstr and memchr
differently than POSIX. To be conformant, we need to provide a different
signature when __cplusplus is defined.
This is the same logic as 73d178af, but applied to string.h.
This is required to obtain results for large values of `x`. The Gamma
function can produce extremely large values, causing `gamma(x)` to
return `inf` even when `lgamma(x)` can still return a finite result.
The C++ standard defines wcschr, wcsrchr, wcspbrk, wcsstr and wmemchr
differently than POSIX. To be conformant, we need to provide a different
signature when __cplusplus is defined.
By defining the `__WCHAR_FORCE_C_DECLARATION` macro, users of `wchar.h`
can force the header to provide the C declaration even if __cplusplus is
defined. This escape hatch is needed to properly implement the C
function in LibC.
This makes us pass 3 more libcxx tests.
This is required by POSIX and is supposed to be equal to the number
of unique filenames that tmpnam can return. Given that we only have a
stub for that function, TMP_MAX is only here to please libcxx tests.
The current version of the libcxx patch stubs these function in libcxx
internals. A future revision of the patch will instead require us to
define these functions in LibC.
ESUCCESS is not part of POSIX or any SUS standard, and is only present
in esoteric Unix-like systems from days gone by. And glibc, for some
reason. Remove it from the public headers now that there's no uses
in Userland/ anymore.