Skip to content

Commit

Permalink
Added array pointers to the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
elichai committed May 20, 2019
1 parent b99297e commit 482e29a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ impl Builder {
output_vector.push("--no-prepend-enum-name".into());
}

if self.options.array_pointers {
output_vector.push("--use-array-pointers".into());
}

self.options
.opaque_types
.get_items()
Expand Down
7 changes: 7 additions & 0 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ where
.long("enable-function-attribute-detection")
.help("Enables detecting unexposed attributes in functions (slow).
Used to generate #[must_use] annotations."),
Arg::with_name("use-array-pointers")
.long("use-array-pointers")
.help("Use `*const [T; size]` instead of `*const T` for C arrays"),
]) // .args()
.get_matches_from(args);

Expand Down Expand Up @@ -458,6 +461,10 @@ where
builder = builder.time_phases(true);
}

if matches.is_present("use-array-pointers") {
builder = builder.array_pointers(true);
}

if let Some(prefix) = matches.value_of("ctypes-prefix") {
builder = builder.ctypes_prefix(prefix);
}
Expand Down

0 comments on commit 482e29a

Please sign in to comment.