summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2020-03-27 11:13:13 -0400
committerJoe George <joe@zeroc.com>2020-03-27 11:13:13 -0400
commitc6306e50ce3e5d48c3a0b0e3aab4129c3f430eeb (patch)
tree7ea4298532c68e956e3f332787e57f4380bd0400
parentUpdate C# version to 3.7.3.2 (diff)
downloadice-c6306e50ce3e5d48c3a0b0e3aab4129c3f430eeb.tar.bz2
ice-c6306e50ce3e5d48c3a0b0e3aab4129c3f430eeb.tar.xz
ice-c6306e50ce3e5d48c3a0b0e3aab4129c3f430eeb.zip
Fix Swift 5.2 build failures
-rw-r--r--Cartfile.resolved2
-rw-r--r--cpp/src/slice2swift/Gen.cpp5
-rw-r--r--swift/src/Ice/Proxy.swift24
3 files changed, 17 insertions, 14 deletions
diff --git a/Cartfile.resolved b/Cartfile.resolved
index f969863e3e4..4576d79a844 100644
--- a/Cartfile.resolved
+++ b/Cartfile.resolved
@@ -1 +1 @@
-github "mxcl/PromiseKit" "6.11.0"
+github "mxcl/PromiseKit" "6.13.1"
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp
index 8a57e737181..45eb33c51e7 100644
--- a/cpp/src/slice2swift/Gen.cpp
+++ b/cpp/src/slice2swift/Gen.cpp
@@ -734,9 +734,12 @@ Gen::TypesVisitor::visitSequence(const SequencePtr& p)
out << nl << "var v = " << fixIdent(name) << "(repeating: nil, count: sz)";
out << nl << "for i in 0 ..< sz";
out << sb;
- out << nl << "let p = UnsafeMutablePointer<" << typeToString(p->type(), p) << ">(&v[i])";
+ out << nl << "try Swift.withUnsafeMutablePointer(to: &v[i])";
+ out << sb;
+ out << " p in";
writeMarshalUnmarshalCode(out, type, p, "p.pointee", false);
out << eb;
+ out << eb;
}
else
{
diff --git a/swift/src/Ice/Proxy.swift b/swift/src/Ice/Proxy.swift
index 31d0b19b00e..ae64663158e 100644
--- a/swift/src/Ice/Proxy.swift
+++ b/swift/src/Ice/Proxy.swift
@@ -804,7 +804,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!id.name.isEmpty, "Identity name cannot be empty")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_identity(id.name, category: id.category))
+ try fromICEObjectPrx(handle.ice_identity(id.name, category: id.category)) as Self
}
} catch {
fatalError("\(error)")
@@ -835,7 +835,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with an adapterId")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_adapterId(id))
+ try fromICEObjectPrx(handle.ice_adapterId(id)) as Self
}
} catch {
fatalError("\(error)")
@@ -850,7 +850,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with endpoints")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_endpoints(endpoints.toObjc()))
+ try fromICEObjectPrx(handle.ice_endpoints(endpoints.toObjc())) as Self
}
} catch {
fatalError("\(error)")
@@ -866,7 +866,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(timeout >= -1, "Invalid locator cache timeout value")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_locatorCacheTimeout(timeout))
+ try fromICEObjectPrx(handle.ice_locatorCacheTimeout(timeout)) as Self
}
} catch {
fatalError("\(error)")
@@ -881,7 +881,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(timeout >= 1 || timeout == -1 || timeout == -2, "Invalid invocation timeout value")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_invocationTimeout(timeout))
+ try fromICEObjectPrx(handle.ice_invocationTimeout(timeout)) as Self
}
} catch {
fatalError("\(error)")
@@ -896,7 +896,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with a connectionId")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_connectionId(id))
+ try fromICEObjectPrx(handle.ice_connectionId(id)) as Self
}
} catch {
fatalError("\(error)")
@@ -911,7 +911,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with a cached connection")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_connectionCached(cached))
+ try fromICEObjectPrx(handle.ice_connectionCached(cached)) as Self
}
} catch {
fatalError("\(error)")
@@ -926,7 +926,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with an endpointSelectionType")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_endpointSelection(type.rawValue))
+ try fromICEObjectPrx(handle.ice_endpointSelection(type.rawValue)) as Self
}
} catch {
fatalError("\(error)")
@@ -995,7 +995,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with preferSecure")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_preferSecure(preferSecure))
+ try fromICEObjectPrx(handle.ice_preferSecure(preferSecure)) as Self
}
} catch {
fatalError("\(error)")
@@ -1065,7 +1065,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(timeout > 0 || timeout == -1, "Invalid connection timeout value")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_timeout(timeout))
+ try fromICEObjectPrx(handle.ice_timeout(timeout)) as Self
}
} catch {
fatalError("\(error)")
@@ -1075,7 +1075,7 @@ open class ObjectPrxI: ObjectPrx {
public func ice_fixed(_ connection: Connection) -> Self {
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_fixed((connection as! ConnectionI).handle))
+ try fromICEObjectPrx(handle.ice_fixed((connection as! ConnectionI).handle)) as Self
}
} catch {
fatalError("\(error)")
@@ -1109,7 +1109,7 @@ open class ObjectPrxI: ObjectPrx {
precondition(!ice_isFixed(), "Cannot create a fixed proxy with collocation optimization")
do {
return try autoreleasepool {
- try fromICEObjectPrx(handle.ice_collocationOptimized(collocated))
+ try fromICEObjectPrx(handle.ice_collocationOptimized(collocated)) as Self
}
} catch {
fatalError("\(error)")