mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The PR https://github.com/swiftlang/swift/pull/77857 added windows-specific workaround for https://github.com/swiftlang/swift/issues/77856, that happened after https://github.com/swiftlang/swift/pull/77843. Unfortunately this caused a new issue on windows - https://github.com/swiftlang/swift/issues/78119. It looks like windows is suffering from a similar serialization issue as libstdc++, although its even more complex as the callAsFunction is not only a derived function from a base class, the base class although has a static call operator. In any case, the libstdc++ callAsFunction deserialization fix should align with the static operator () deserialization too, so for now make windows use the same workaround as other platforms to avoid the deserialization crash (77856). This change was tested on i686 windows too, ensuring that IR verifier crash no longer happens
38 lines
1.4 KiB
C++
38 lines
1.4 KiB
C++
#include <chrono>
|
|
#include <functional>
|
|
#include <string>
|
|
|
|
/// Used for std::string conformance to Swift.Hashable
|
|
typedef std::hash<std::string> __swift_interopHashOfString;
|
|
inline std::size_t __swift_interopComputeHashOfString(const std::string &str) {
|
|
return __swift_interopHashOfString()(str);
|
|
}
|
|
|
|
/// Used for std::u16string conformance to Swift.Hashable
|
|
typedef std::hash<std::u16string> __swift_interopHashOfU16String;
|
|
inline std::size_t __swift_interopComputeHashOfU16String(const std::u16string &str) {
|
|
return __swift_interopHashOfU16String()(str);
|
|
}
|
|
|
|
/// Used for std::u32string conformance to Swift.Hashable
|
|
typedef std::hash<std::u32string> __swift_interopHashOfU32String;
|
|
inline std::size_t __swift_interopComputeHashOfU32String(const std::u32string &str) {
|
|
return __swift_interopHashOfU32String()(str);
|
|
}
|
|
|
|
inline std::chrono::seconds __swift_interopMakeChronoSeconds(int64_t seconds) {
|
|
return std::chrono::seconds(seconds);
|
|
}
|
|
|
|
inline std::chrono::milliseconds __swift_interopMakeChronoMilliseconds(int64_t milliseconds) {
|
|
return std::chrono::milliseconds(milliseconds);
|
|
}
|
|
|
|
inline std::chrono::microseconds __swift_interopMakeChronoMicroseconds(int64_t microseconds) {
|
|
return std::chrono::microseconds(microseconds);
|
|
}
|
|
|
|
inline std::chrono::nanoseconds __swift_interopMakeChronoNanoseconds(int64_t nanoseconds) {
|
|
return std::chrono::nanoseconds(nanoseconds);
|
|
}
|