浏览代码

LibCore: Don't wrap `<mach/mach.h>` in extern "C" on Darwin

This causes issues when loading the file into a clang module, such as
when using Core::MachPort from Objective-C or Swift.
Andrew Kaster 1 年之前
父节点
当前提交
422f1ed8de
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Userland/Libraries/LibCore/MachPort.h

+ 5 - 1
Userland/Libraries/LibCore/MachPort.h

@@ -15,9 +15,13 @@
 #include <AK/Error.h>
 #include <AK/Noncopyable.h>
 
+#if defined(AK_OS_MACOS) || defined(AK_OS_IOS)
+#    include <mach/mach.h>
+#else
 extern "C" {
-#include <mach/mach.h>
+#    include <mach/mach.h>
 }
+#endif
 
 namespace Core {