wickwirew / Runtime

A Swift Runtime library for viewing type info, and the dynamic getting and setting of properties.
MIT License
1.08k stars 94 forks source link

CRuntime can be removed #39

Closed NSExceptional closed 5 years ago

NSExceptional commented 5 years ago

Simply include this function definition somewhere in this project:

@_silgen_name("swift_getTypeByMangledNameInContext")
func swift_getTypeByMangledNameInContext(
    _ typeNameStart: UnsafeMutablePointer<Int8>,
    _ typeNameLength: Int32,
    _ context: UnsafeRawPointer?,
    _ genericArgs: UnsafePointer<UnsafeRawPointer?>?
) -> UnsafeRawPointer?
NSExceptional commented 5 years ago

Closing this issue because it has occurred to me that using a bridging header is more formal than using the private @_silgen_name

wickwirew commented 5 years ago

Back in swift 4.2 we had something similar to that for the swift_getFieldAt call, which caused linking problems on linux. Moving it to a separate module was the ultimate fix.

Heres the thread: https://github.com/wickwirew/Runtime/issues/18#issuecomment-426062296

If we can remove it I'd love too though

NSExceptional commented 5 years ago

Yeah, sounds like what Joe told me. Relevant thread on the forums.