Hi,

While trying to port the current swift code to FreeBSD, some swift code fails 
to compile. The failures are concentrated in SwiftPrivatePthreadExtras.swift 
and code which depends on it.

Can someone shed some light on the following errors? I am having some 
difficulty understanding why the C headers would be interpreted so slightly 
differently than expected?

--(start compile failure)
/home/qdk/src/swift-source/swift/stdlib/private/SwiftPrivatePthreadExtras/SwiftPrivatePthreadExtras.swift:75:42:
 error: cannot convert value of type 'UnsafePointer<pthread_attr_t>?' to 
expected argument type 'UnsafePointer<pthread_attr_t?>!'
  let result = pthread_create(&threadID, attr,
                                         ^~~~
/home/qdk/src/swift-source/swift/stdlib/private/SwiftPrivatePthreadExtras/PthreadBarriers.swift:72:46:
 error: cannot convert value of type 'UnsafeMutablePointer<pthread_mutex_t>' 
(aka 'UnsafeMutablePointer<OpaquePointer>') to expected argument type 
'UnsafeMutablePointer<pthread_mutex_t?>' (aka 
'UnsafeMutablePointer<Optional<OpaquePointer>>')
  if pthread_mutex_init(barrier.pointee.mutex!, nil) != 0 {
                        ~~~~~~~~~~~~~~~~~~~~~^
/home/qdk/src/swift-source/swift/stdlib/private/SwiftPrivatePthreadExtras/PthreadBarriers.swift:77:44:
 error: cannot convert value of type 'UnsafeMutablePointer<pthread_cond_t>' 
(aka 'UnsafeMutablePointer<OpaquePointer>') to expected argument type 
'UnsafeMutablePointer<pthread_cond_t?>' (aka 
'UnsafeMutablePointer<Optional<OpaquePointer>>')
  if pthread_cond_init(barrier.pointee.cond!, nil) != 0 {
                       ~~~~~~~~~~~~~~~~~~~~^

--(end compile failure)

Thanks for any suggestions or pointers!

-- 
Kind regards,

K Staring <q...@quickdekay.net>


_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to