Skip to content

Commit f3e12fb

Browse files
committed
Make ForSwiftFoundationOnly an explicit submodule that doesn't re-export
This allows us to prevent the ambiguity for various STATX defines from linux/stat.h when building for Android, as those are defined in the Android platform module
1 parent 69cfa27 commit f3e12fb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include <sys/stat.h>
6565
#include <sys/syscall.h>
6666
#include <termios.h>
67+
#include <linux/stat.h>
6768
#elif TARGET_OS_WASI
6869
#include <fcntl.h>
6970
#include <sys/stat.h>

CoreFoundation/Base.subproj/module.modulemap

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
framework module CoreFoundation [extern_c] [system] {
22
umbrella header "CoreFoundation.h"
33
explicit module CFPlugInCOM { header "CFPlugInCOM.h" }
4+
explicit module ForSwiftFoundationOnly {
5+
header "ForSwiftFoundationOnly.h"
6+
// Do not re-export imported Clang modules to avoid pulling in
7+
// system headers like linux/stat.h whose constants might conflict
8+
// with constants from the platform module.
9+
}
410

511
export *
612
module * {

0 commit comments

Comments
 (0)