Skip to content

Commit

Permalink
Set repr(C) attribute on translated structs (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Grosse committed Jul 12, 2016
1 parent 36cdc31 commit 22c8aa1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/dist/
.stack-work/
2 changes: 1 addition & 1 deletion src/Language/Rust/Corrode/C.md
Original file line number Diff line number Diff line change
Expand Up @@ -2028,7 +2028,7 @@ baseTypeOf specs = do
let name = identToString ident
addIdent (StructIdent ident) (Rust.Immutable, IsStruct name fields)
Nothing -> uniqueName "Struct"
let attrs = [Rust.Attribute "derive(Clone, Copy)"]
let attrs = [Rust.Attribute "derive(Clone, Copy)", Rust.Attribute "repr(C)"]
emitItems [Rust.Item attrs Rust.Public (Rust.Struct name [ (field, toRustType fieldTy) | (field, fieldTy) <- fields ])]
return (mut, IsStruct name fields)
go spec@(CTypeDef ident _) (mut1, _) = do
Expand Down

0 comments on commit 22c8aa1

Please sign in to comment.