Skip to content

Commit

Permalink
Make ForSwiftFoundationOnly an explicit submodule that doesn't re-export
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hyp committed May 28, 2024
1 parent 69cfa27 commit f3e12fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CoreFoundation/Base.subproj/ForSwiftFoundationOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include <sys/stat.h>
#include <sys/syscall.h>
#include <termios.h>
#include <linux/stat.h>
#elif TARGET_OS_WASI
#include <fcntl.h>
#include <sys/stat.h>
Expand Down
6 changes: 6 additions & 0 deletions CoreFoundation/Base.subproj/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
framework module CoreFoundation [extern_c] [system] {
umbrella header "CoreFoundation.h"
explicit module CFPlugInCOM { header "CFPlugInCOM.h" }
explicit module ForSwiftFoundationOnly {
header "ForSwiftFoundationOnly.h"
// Do not re-export imported Clang modules to avoid pulling in
// system headers like linux/stat.h whose constants might conflict
// with constants from the platform module.
}

export *
module * {
Expand Down

0 comments on commit f3e12fb

Please sign in to comment.