Skip to content

Commit e84c2a8

Browse files
committed
[embedded] Conditionalize passing -D__MACH__ on isOSBinFormatMachO()
1 parent e22aedb commit e84c2a8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,13 @@ importer::getNormalInvocationArguments(
631631
});
632632
}
633633

634-
// To support -apple-none triples, which are non-Darwin, we need to #define
635-
// a few things that the Apple SDKs expect.
634+
// To support -apple-none, -apple-none-macho, -unknown-none-wasm triples.
636635
if (triple.getVendor() == llvm::Triple::VendorType::Apple) {
637-
invocationArgStrs.insert(invocationArgStrs.end(),
638-
{"-D__APPLE__", "-D__MACH__"});
636+
invocationArgStrs.insert(invocationArgStrs.end(), {"-D__APPLE__"});
637+
}
638+
if (triple.isOSBinFormatMachO()) {
639+
invocationArgStrs.insert(invocationArgStrs.end(), {"-D__MACH__"});
639640
}
640-
641641
if (triple.isOSBinFormatWasm()) {
642642
invocationArgStrs.insert(invocationArgStrs.end(), {"-D__wasi__"});
643643
}

0 commit comments

Comments
 (0)