<div dir="ltr"><div>Hi K,</div><div><br></div><div>I met similar problem in Cygwin porting.</div><div><br></div><div>I think it will be resolved by defining the typealias with #if/#endif, <span style="color:rgb(51,51,51);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)">_stdlib_pthread_attr_t </span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)">=</span><span style="color:rgb(51,51,51);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)"> </span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)">UnsafePointer</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)">&lt;</span><span style="color:rgb(51,51,51);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)">pthread_attr_t?</span><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93);font-family:consolas,&quot;liberation mono&quot;,menlo,courier,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(234,255,234)">&gt;.</span></div><div><br></div><div>Please reference my PR for Cygwin.  <a href="https://github.com/apple/swift/pull/3886/files#diff-99fd89ad44c4466de8ad6b8aab9c207d">https://github.com/apple/swift/pull/3886/files#diff-99fd89ad44c4466de8ad6b8aab9c207d</a></div><div><br></div><div>Thanks</div><div>Han Sangjin<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-19 5:08 GMT+09:00 K Staring via swift-dev <span dir="ltr">&lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
While trying to port the current swift code to FreeBSD, some swift code fails to compile. The failures are concentrated in SwiftPrivatePthreadExtras.<wbr>swift and code which depends on it.<br>
<br>
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?<br>
<br>
--(start compile failure)<br>
/home/qdk/src/swift-source/<wbr>swift/stdlib/private/<wbr>SwiftPrivatePthreadExtras/<wbr>SwiftPrivatePthreadExtras.<wbr>swift:75:42: error: cannot convert value of type &#39;UnsafePointer&lt;pthread_attr_t&gt;<wbr>?&#39; to expected argument type &#39;UnsafePointer&lt;pthread_attr_t?<wbr>&gt;!&#39;<br>
  let result = pthread_create(&amp;threadID, attr,<br>
                                         ^~~~<br>
/home/qdk/src/swift-source/<wbr>swift/stdlib/private/<wbr>SwiftPrivatePthreadExtras/<wbr>PthreadBarriers.swift:72:46: error: cannot convert value of type &#39;UnsafeMutablePointer&lt;pthread_<wbr>mutex_t&gt;&#39; (aka &#39;UnsafeMutablePointer&lt;<wbr>OpaquePointer&gt;&#39;) to expected argument type &#39;UnsafeMutablePointer&lt;pthread_<wbr>mutex_t?&gt;&#39; (aka &#39;UnsafeMutablePointer&lt;<wbr>Optional&lt;OpaquePointer&gt;&gt;&#39;)<br>
  if pthread_mutex_init(barrier.<wbr>pointee.mutex!, nil) != 0 {<br>
                        ~~~~~~~~~~~~~~~~~~~~~^<br>
/home/qdk/src/swift-source/<wbr>swift/stdlib/private/<wbr>SwiftPrivatePthreadExtras/<wbr>PthreadBarriers.swift:77:44: error: cannot convert value of type &#39;UnsafeMutablePointer&lt;pthread_<wbr>cond_t&gt;&#39; (aka &#39;UnsafeMutablePointer&lt;<wbr>OpaquePointer&gt;&#39;) to expected argument type &#39;UnsafeMutablePointer&lt;pthread_<wbr>cond_t?&gt;&#39; (aka &#39;UnsafeMutablePointer&lt;<wbr>Optional&lt;OpaquePointer&gt;&gt;&#39;)<br>
  if pthread_cond_init(barrier.<wbr>pointee.cond!, nil) != 0 {<br>
                       ~~~~~~~~~~~~~~~~~~~~^<br>
<br>
--(end compile failure)<br>
<br>
Thanks for any suggestions or pointers!<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Kind regards,<br>
<br>
K Staring &lt;<a href="mailto:qdk@quickdekay.net">qdk@quickdekay.net</a>&gt;<br>
<br>
<br>
______________________________<wbr>_________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</a><br>
</font></span></blockquote></div><br></div></div>