diff --git a/libc/hdr/types/char32_t.h b/libc/hdr/types/char32_t.h index 94fe5747d3415..df629d44edd3b 100644 --- a/libc/hdr/types/char32_t.h +++ b/libc/hdr/types/char32_t.h @@ -15,8 +15,13 @@ #else // overlay mode +// MacOS doesn't provide uchar.h so we use the types provided by LLVM-libc. +#ifdef __APPLE__ +#include "include/llvm-libc-types/char32_t.h" +#else #include "hdr/uchar_overlay.h" +#endif -#endif // LLVM_LIBC_FULL_BUILD +#endif // LIBC_FULL_BUILD #endif // LLVM_LIBC_HDR_TYPES_CHAR32_T_H diff --git a/libc/shared/rpc_server.h b/libc/shared/rpc_server.h index ad72eb16c74fa..175f91dd34b01 100644 --- a/libc/shared/rpc_server.h +++ b/libc/shared/rpc_server.h @@ -20,6 +20,10 @@ #define flockfile _lock_file #define funlockfile _unlock_file #define fwrite_unlocked _fwrite_nolock +#elif defined(__APPLE__) +// MacOS doesn't have an equivalent of fwrite_unlocked so we just use +// fwrite. +#define fwrite_unlocked fwrite #endif namespace rpc { diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt index 08a4db8e49a73..ce69d4e6f69ac 100644 --- a/libc/src/__support/CMakeLists.txt +++ b/libc/src/__support/CMakeLists.txt @@ -452,12 +452,8 @@ add_subdirectory(fixed_point) add_subdirectory(time) -# Requires access to uchar header which is not on macos -# Therefore, cannot currently build this on macos in overlay mode -if(NOT (LIBC_TARGET_OS_IS_DARWIN)) - add_subdirectory(wchar) - add_subdirectory(wctype) -endif() +add_subdirectory(wchar) +add_subdirectory(wctype) add_subdirectory(math) if(LIBC_COMPILER_HAS_EXT_VECTOR_TYPE) diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt index 64e15852c2ec3..6b9c1b4ac8cc7 100644 --- a/libc/test/src/__support/CMakeLists.txt +++ b/libc/test/src/__support/CMakeLists.txt @@ -311,9 +311,5 @@ add_subdirectory(fixed_point) add_subdirectory(HashTable) add_subdirectory(time) add_subdirectory(threads) -# Requires access to uchar header which is not on MacOS -# Cannot currently build this on MacOS in overlay mode -if(NOT(LIBC_TARGET_OS_IS_DARWIN)) - add_subdirectory(wchar) - add_subdirectory(wctype) -endif() +add_subdirectory(wchar) +add_subdirectory(wctype)