<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">It seems like Swift has broken a lot of the export functionality. Some of the exporting system was actually a bug but resulting in useful functionality (i.e like importing C Macros as enums). But once fixed we lost a lot of it.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">







<p><b><font color="#cc0000">___________________________________</font></b></p><p><b>James⎥Head of Trolls</b></p><p><b><font color="#cc0000"><a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a>⎥<a href="http://supmenow.com" target="_blank">supmenow.com</a></font></b></p><p><b><font size="2">Sup</font></b></p><p><b><font size="2">Runway East
</font></b></p><p><b><font size="2">10 Finsbury Square</font></b></p><p><b><font size="2">London</font></b></p><p><b><font size="2">
EC2A 1AF </font></b></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 6 July 2016 at 07:23, Antonino Ficarra via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">long double math.h functions appear to not be exported in swift. I don’t know why.<br><div><div style="word-wrap:break-word"><div><br></div><div>This horrible hack works:</div><div><br></div><div><div>// in f80.h</div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">extern</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> sqrt_f80( </span><span style="color:rgb(187,44,162)">void</span><span> *result, </span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> *v );</span></div></div><div><span><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">extern</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> pow_f80( </span><span style="color:rgb(187,44,162)">void</span><span> *result, </span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> *v, </span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> *e );</span></div><div><span>...</span></div><div><span><br></span></div></span></div><div><span><div>// in f80.c</div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">void</span><span> sqrt_f80( </span><span style="color:rgb(187,44,162)">void</span><span> *result, </span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> *v )<span style="white-space:pre-wrap">        </span>{ *(</span><span style="color:rgb(187,44,162)">long</span><span> </span><span style="color:rgb(187,44,162)">double</span><span> *)result = </span><span style="color:rgb(61,29,129)">sqrtl</span><span>( *(</span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">long</span><span> </span><span style="color:rgb(187,44,162)">double</span><span> *)v ); }</span></div></div><div><span><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">void</span><span> pow_f80( </span><span style="color:rgb(187,44,162)">void</span><span> *result, </span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> *v, </span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">void</span><span> *e )<span style="white-space:pre-wrap">        </span>{ *(</span><span style="color:rgb(187,44,162)">long</span><span> </span><span style="color:rgb(187,44,162)">double</span><span> *)result = </span><span style="color:rgb(61,29,129)">powl</span><span>( *(</span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">long</span><span> </span><span style="color:rgb(187,44,162)">double</span><span> *)v,*(</span><span style="color:rgb(187,44,162)">const</span><span> </span><span style="color:rgb(187,44,162)">long</span><span> </span><span style="color:rgb(187,44,162)">double</span><span> *)e ); }</span></div><div><span>…</span></div><div><span><br></span></div><div><span>// in f80.swift</span></div><div><span><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">func</span><span> sqrt( </span><span style="color:rgb(187,44,162)">_</span><span> a:</span><span style="color:rgb(112,61,170)">Float80</span><span> ) -&gt; </span><span style="color:rgb(112,61,170)">Float80</span><span><span style="white-space:pre-wrap">                </span>{ </span><span style="color:rgb(187,44,162)">var</span><span> result = </span><span style="color:rgb(112,61,170)">Float80</span><span>(); </span><span style="color:rgb(187,44,162)">var</span><span> v = a; </span><span style="color:rgb(49,89,93)">sqrt_f80</span><span>( &amp;result, &amp;v ); </span><span style="color:rgb(187,44,162)">return</span><span> result; }</span></div><div><span><div style="margin:0px;line-height:normal"><div style="font-family:Menlo;font-size:11px;margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">func</span><span> pow( </span><span style="color:rgb(187,44,162)">_</span><span> a:</span><span style="color:rgb(112,61,170)">Float80</span><span>,</span><span style="color:rgb(187,44,162)">_</span><span> e:</span><span style="color:rgb(112,61,170)">Float80</span><span> ) -&gt; </span><span style="color:rgb(112,61,170)">Float80</span><span> { </span><span style="color:rgb(187,44,162)">var</span><span> result = </span><span style="color:rgb(112,61,170)">Float80</span><span>(); </span><span style="color:rgb(187,44,162)">var</span><span> v1 = a; </span><span style="color:rgb(187,44,162)">var</span><span> v2 = e; </span><span style="color:rgb(49,89,93)">pow_f80</span><span>( &amp;result, &amp;v1, &amp;v2 ); </span><span style="color:rgb(187,44,162)">return</span><span> result; }</span></div><div><span>…</span></div></div></span></div></span></div></span></div></span></div></div><div><br></div><div>Sorry for my bad english.</div><div><br></div><br><div><blockquote type="cite"><div><div class="h5"><div>Il giorno 05 lug 2016, alle ore 19:44, Jeff Kelley via swift-users &lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt; ha scritto:</div><br></div></div><div><div><div class="h5"><div style="word-wrap:break-word"><div>Hello all,</div><div><br></div><div><span style="white-space:pre-wrap">        </span>I’m using Xcode 8.0 and Swift 3 on OS X 10.11, and I’m trying to use <font face="Menlo">powl</font> in an OS X Playground. I see the definition of the <font face="Menlo">pow</font>-related functions in <font face="Menlo">math.h</font> here:</div><div><br></div><div><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(195,34,117)"><span>extern</span><span> </span><span>float</span><span> powf(</span><span>float</span><span>, </span><span>float</span><span>);</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(195,34,117)"><span>extern</span><span> </span><span>double</span><span> pow(</span><span>double</span><span>, </span><span>double</span><span>);</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(195,34,117)"><span>extern</span><span> </span><span>long</span><span> </span><span>double</span><span> powl(</span><span>long</span><span> </span><span>double</span><span>, </span><span>long</span><span> </span><span>double</span><span>);</span></div></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(195,34,117)"><span><br></span></div><div>But the Swift-imported version at <font face="Menlo">Darwin.C.math</font> looks like this:</div><div><br></div><div><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo"><span style="color:#c32275">public</span><span> </span><span style="color:#c32275">func</span><span> powf(</span><span style="color:#c32275">_</span><span>: </span><span style="color:#703daa">Float</span><span>, </span><span style="color:#c32275">_</span><span>: </span><span style="color:#703daa">Float</span><span>) -&gt; </span><span style="color:#703daa">Float</span></div><div style="margin:0px;font-size:18px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)"><span style="color:#c32275">public</span><span> </span><span style="color:#c32275">func</span><span> pow(</span><span style="color:#c32275">_</span><span>: </span><span>Double</span><span>, </span><span style="color:#c32275">_</span><span>: </span><span>Double</span><span>) -&gt; </span><span>Double</span></div></div><div><span><br></span></div><div>Where did <font face="Menlo">powl</font> go?</div><div><br></div><br><div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><span style="border-collapse:separate;line-height:normal;border-spacing:0px"><div style="word-wrap:break-word"><div>Jeff Kelley</div><div><br></div><div><a href="mailto:SlaunchaMan@gmail.com" target="_blank">SlaunchaMan@gmail.com</a> | <a href="https://twitter.com/SlaunchaMan" target="_blank">@SlaunchaMan</a> | <a href="http://jeffkelley.org/" target="_blank">jeffkelley.org</a></div></div></span></div></div></div></div></div>
</div>

<br></div></div></div>_______________________________________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br></div></blockquote></div><br></div></div><br></div><br>_______________________________________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br>
<br></blockquote></div><br></div>