> On Aug 1, 2016, at 9:12 AM, Dmitri Gribenko via swift-users > <swift-users@swift.org> wrote: > > On Mon, Aug 1, 2016 at 4:20 AM, KS Sreeram via swift-users > <swift-users@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.
Right. In the future we will probably add the ability to put explicit alignment/layout information on structure fields. This would be useful for this, as well as other cases where you’re trying to match a specific layout used in an on-disk file format or memory mapped device. That said, this doesn’t fit in the scope for Swift 4 stage 1. -Chris _______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users