mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
AK: On macOS host builds, wrap unistd.h with missing extern "C"
During the build process on macOS, multiple versions of <unistd.h> were being included (Apple's version and GCC's version). It appears that all other places #include the version from GCC, but in Platform.h the Apple header was being used. GCC's <unistd.h> is wrapped in `extern "C"`, while Apple's is not. This causes a conflicting declaration, so we need to wrap the #include with extern "C". Issue has been observed on macOS Mojave. See https://github.com/microsoft/vcpkg/issues/11320 for a similar issue.
This commit is contained in:
parent
6386b54746
commit
d55dfe2418
Notes:
sideshowbarker
2024-07-18 00:47:39 +09:00
Author: https://github.com/csb6 🔰 Commit: https://github.com/SerenityOS/serenity/commit/d55dfe24185 Pull-request: https://github.com/SerenityOS/serenity/pull/9716 Reviewed-by: https://github.com/linusg
1 changed files with 8 additions and 0 deletions
|
@ -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 <unistd.h>
|
||||
# undef PAGE_SIZE
|
||||
# define PAGE_SIZE sysconf(_SC_PAGESIZE)
|
||||
# ifdef AK_OS_MACOS
|
||||
};
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Reference in a new issue