1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibC: The standard C library needs to be able to build as pure C.

Looks like we can't use those comfy C++ attributes in this code then.
This commit is contained in:
Andreas Kling 2019-02-15 22:37:20 +01:00
parent 3b42db0b4c
commit cbfd416279
4 changed files with 14 additions and 12 deletions

View file

@ -4,41 +4,41 @@
__BEGIN_DECLS
[[gnu::always_inline]] inline int isascii(int ch)
ALWAYS_INLINE int isascii(int ch)
{
return (ch & ~0x7f) == 0;
}
[[gnu::always_inline]] inline int isspace(int ch)
ALWAYS_INLINE int isspace(int ch)
{
return ch == ' ' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\v';
}
[[gnu::always_inline]] inline int islower(int c)
ALWAYS_INLINE int islower(int c)
{
return c >= 'a' && c <= 'z';
}
[[gnu::always_inline]] inline int isupper(int c)
ALWAYS_INLINE int isupper(int c)
{
return c >= 'A' && c <= 'Z';
}
[[gnu::always_inline]] inline int tolower(int c)
ALWAYS_INLINE int tolower(int c)
{
if (isupper(c))
return c | 0x20;
return c;
}
[[gnu::always_inline]] inline int toupper(int c)
ALWAYS_INLINE int toupper(int c)
{
if (islower(c))
return c & ~0x20;
return c;
}
[[gnu::always_inline]] inline int isdigit(int c)
ALWAYS_INLINE int isdigit(int c)
{
return c >= '0' && c <= '9';
}