File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,14 @@ extension PythonObject : CustomStringConvertible {
124
124
}
125
125
}
126
126
127
+ #if !swift(>=5)
127
128
// Make `PythonObject` show up nicely in the Xcode Playground results sidebar.
128
129
extension PythonObject : CustomPlaygroundQuickLookable {
129
130
public var customPlaygroundQuickLook : PlaygroundQuickLook {
130
131
return . text( description)
131
132
}
132
133
}
134
+ #endif
133
135
134
136
// Mirror representation, used by debugger/REPL.
135
137
extension PythonObject : CustomReflectable {
Original file line number Diff line number Diff line change @@ -59,7 +59,10 @@ public struct PythonLibrary {
59
59
#if canImport(Darwin) || canImport(Glibc)
60
60
return dlsym ( libraryHandle, name)
61
61
#elseif os(Windows)
62
- return GetProcAddress ( libraryHandle, name)
62
+ let moduleHandle = libraryHandle
63
+ . assumingMemoryBound ( to: HINSTANCE__ . self)
64
+ let moduleSymbol = GetProcAddress ( moduleHandle, name)
65
+ return unsafeBitCast ( moduleSymbol, to: UnsafeMutableRawPointer ? . self)
63
66
#endif
64
67
}
65
68
@@ -225,7 +228,7 @@ private extension PythonLibrary {
225
228
// modules may depend on this .so file.
226
229
let pythonLibraryHandle = dlopen ( path, RTLD_LAZY | RTLD_GLOBAL)
227
230
#elseif os(Windows)
228
- let pythonLibraryHandle = LoadLibraryA ( path)
231
+ let pythonLibraryHandle = UnsafeMutableRawPointer ( LoadLibraryA ( path) )
229
232
#endif
230
233
231
234
if pythonLibraryHandle != nil {
You can’t perform that action at this time.
0 commit comments