Closed tokyovigilante closed 8 months ago
@swift-server-bot test this please
@swift-server-bot test this please
Hmm, this appears to be a bit overzealous, as our CI is failing the build:
16:45:30 /code/Sources/NIOSSL/PosixPort.swift:44:63: error: C function pointer signature '(UnsafeMutablePointer<FILE>?) -> Int32' (aka '(Optional<UnsafeMutablePointer<_IO_FILE>>) -> Int32') is not compatible with expected type '@convention(c) (FILEPointer) -> CInt' (aka '@convention(c) (UnsafeMutablePointer<_IO_FILE>) -> Int32')
What Linux distribution did you test on?
What Linux distribution did you test on?
Fedora rawhide, with Clang 16 and glibc 2.37.9.
This is probably more that combination. We can probably get around this by redeclaring the variable as a closure wrapping the underlying function:
private let sysFclose: @convention(c) (FILEPointer?) -> CInt = { fclose($0) }
@Lukasa I tried your fix but the argument had to be unwrapped, this is the version that worked:
private let sysFclose: @convention(c) (FILEPointer?) -> CInt = { fclose($0!) }
cc: @tokyovigilante
Closes #429.