From 3f90e9a8a0b8e17c017f97463d256079649e8535 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 3 Sep 2023 21:59:06 +0300 Subject: [PATCH] AK: Add AK_LIBC_GLIBC This is defined when we're compiling against the GNU C Library, whether on Linux or on other kernels that glibc works on. More AK_LIBC_xxxx definitions could be potentially added in the future. Also add AK_LIBC_GLIBC_PREREQ(), which checks for a specific glibc version. --- AK/Platform.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AK/Platform.h b/AK/Platform.h index 23fa7d28a2..0de3cfe8fd 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -47,6 +47,13 @@ # define AK_COMPILER_GCC #endif +#if defined(__GLIBC__) +# define AK_LIBC_GLIBC +# define AK_LIBC_GLIBC_PREREQ(maj, min) __GLIBC_PREREQ((maj), (min)) +#else +# define AK_LIBC_GLIBC_PREREQ(maj, min) 0 +#endif + #if defined(__serenity__) # define AK_OS_SERENITY #endif