Skip to content

Commit 538ee30

Browse files
authored
Merge pull request #60331 from hyp/eng/i/shimsInt
[interop][SwiftToCxx] NFC, move swift::Int&UInt declarations into shi…
2 parents 7663052 + 51f9076 commit 538ee30

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

lib/PrintAsClang/PrintAsClang.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,6 @@ static void writePrologue(raw_ostream &out, ASTContext &ctx,
337337
emitCxxConditional(
338338
out, [&] { emitMacro("SWIFT_NOEXCEPT", "noexcept"); },
339339
[&] { emitMacro("SWIFT_NOEXCEPT"); });
340-
emitCxxConditional(out, [&] {
341-
out << "#if !defined(SWIFT_CXX_INT_DEFINED)\n";
342-
out << "#define SWIFT_CXX_INT_DEFINED\n";
343-
out << "namespace swift {\n";
344-
out << "using Int = ptrdiff_t;\n";
345-
out << "using UInt = size_t;\n";
346-
out << "}\n";
347-
out << "#endif\n";
348-
});
349340
static_assert(SWIFT_MAX_IMPORTED_SIMD_ELEMENTS == 4,
350341
"need to add SIMD typedefs here if max elements is increased");
351342
}

stdlib/public/SwiftShims/_SwiftCxxInteroperability.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ inline void opaqueFree(void *_Nonnull p) noexcept {
5151

5252
} // namespace _impl
5353

54+
/// Swift's Int type.
55+
using Int = ptrdiff_t;
56+
57+
/// Swift's UInt type.
58+
using UInt = size_t;
59+
5460
#pragma clang diagnostic push
5561
#pragma clang diagnostic ignored "-Wc++17-extensions"
5662

0 commit comments

Comments
 (0)