[swift-users] C compatible structs

Dmitri Gribenko gribozavr at gmail.com
Mon Aug 1 11:12:14 CDT 2016


On Mon, Aug 1, 2016 at 4:20 AM, KS Sreeram via swift-users
<swift-users at swift.org> wrote:
> Hello
>
> Is it possible to declare Swift structs that have C compatible memory
> layout?

The only supported way to do this is to declare your structs in a C
header that you import in Swift as a module, and #include in your C
libraries.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-users mailing list