Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
cbindgen
Commits
58caa33f
Commit
58caa33f
authored
Jul 17, 2017
by
Ryan Hunt
Browse files
Put template specialization behind a config
parent
be9a8f44
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
58caa33f
...
...
@@ -100,6 +100,8 @@ rename_args = "[None|GeckoCase|LowerCase|UpperCase|PascalCase|CamelCase|SnakeCas
[struct]
# A rule to use to rename field names
rename_fields
=
"[None|GeckoCase|LowerCase|UpperCase|PascalCase|CamelCase|SnakeCase|ScreamingSnakeCase|QualifiedScreamingSnakeCase]"
# Whether to generate helper template specialization for generics
generic_template_specialization
=
true
,
# Whether to derive an operator== for all structs
derive_eq
=
false
# Whether to derive an operator!= for all structs
...
...
src/bindgen/config.rs
View file @
58caa33f
...
...
@@ -145,6 +145,8 @@ impl FunctionConfig {
pub
struct
StructConfig
{
/// The rename rule to apply to the name of struct fields
pub
rename_fields
:
Option
<
RenameRule
>
,
/// Whether to generate helper template specialization for generics
pub
generic_template_specialization
:
bool
,
/// Whether to generate a piecewise equality operator
pub
derive_eq
:
bool
,
/// Whether to generate a piecewise inequality operator
...
...
@@ -163,6 +165,7 @@ impl Default for StructConfig {
fn
default
()
->
StructConfig
{
StructConfig
{
rename_fields
:
None
,
generic_template_specialization
:
true
,
derive_eq
:
false
,
derive_neq
:
false
,
derive_lt
:
false
,
...
...
src/bindgen/library.rs
View file @
58caa33f
...
...
@@ -776,7 +776,8 @@ impl GeneratedBindings {
out
.new_line
();
}
if
self
.config.language
==
Language
::
Cxx
{
if
self
.config.structure.generic_template_specialization
&&
self
.config.language
==
Language
::
Cxx
{
for
(
path
,
monomorph_sets
)
in
&
self
.monomorphs
{
if
monomorph_sets
.len
()
==
0
{
continue
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment