mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[interop][SwiftToCxx] guard inline emitted Stdlib module
This commit is contained in:
@@ -773,7 +773,10 @@ EmittedClangHeaderDependencyInfo swift::printModuleContentsAsCxx(
|
||||
|
||||
// FIXME: refactor.
|
||||
if (!prologueOS.str().empty()) {
|
||||
os << "#endif\n";
|
||||
// FIXME: This is a workaround for prologue being emitted outside of
|
||||
// __cplusplus.
|
||||
if (!M.isStdlibModule())
|
||||
os << "#endif\n";
|
||||
os << "#ifdef __cplusplus\n";
|
||||
os << "namespace ";
|
||||
M.ValueDecl::getName().print(os);
|
||||
@@ -784,7 +787,8 @@ EmittedClangHeaderDependencyInfo swift::printModuleContentsAsCxx(
|
||||
|
||||
os << prologueOS.str();
|
||||
|
||||
os << "\n#ifdef __cplusplus\n";
|
||||
if (!M.isStdlibModule())
|
||||
os << "\n#ifdef __cplusplus\n";
|
||||
os << "}\n";
|
||||
os << "}\n";
|
||||
os << "}\n";
|
||||
|
||||
Reference in New Issue
Block a user