diff --git a/AK/Platform.h b/AK/Platform.h index ee51bcc3f9..15b3165cf4 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -87,9 +87,17 @@ #endif #ifndef __serenity__ +// On macOS (at least Mojave), Apple's version of this header is not wrapped +// in extern "C". +# ifdef AK_OS_MACOS +extern "C" { +# endif # include # undef PAGE_SIZE # define PAGE_SIZE sysconf(_SC_PAGESIZE) +# ifdef AK_OS_MACOS +}; +# endif #endif #ifdef __cplusplus