1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macros

It's tedious to write (and look at) [[gnu::always_inline]] etc. :^)
This commit is contained in:
Andreas Kling 2020-04-30 11:43:25 +02:00
parent f1a8fb1e88
commit 888e35f0fe
14 changed files with 63 additions and 56 deletions

View file

@ -393,13 +393,13 @@ int dbgprintf(const char* fmt, ...)
return ret;
}
[[gnu::always_inline]] inline void stdout_putch(char*&, char ch)
ALWAYS_INLINE void stdout_putch(char*&, char ch)
{
putchar(ch);
}
static FILE* __current_stream = nullptr;
[[gnu::always_inline]] inline static void stream_putch(char*&, char ch)
ALWAYS_INLINE static void stream_putch(char*&, char ch)
{
fputc(ch, __current_stream);
}
@ -455,7 +455,7 @@ int sprintf(char* buffer, const char* fmt, ...)
}
static size_t __vsnprintf_space_remaining;
[[gnu::always_inline]] inline void sized_buffer_putch(char*& bufptr, char ch)
ALWAYS_INLINE void sized_buffer_putch(char*& bufptr, char ch)
{
if (__vsnprintf_space_remaining) {
*bufptr++ = ch;