diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-10 13:32:44 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-11 12:05:38 +0100 |
commit | d5cd85d1a1ab2368a3dc8443ee5969e66aabc8ad (patch) | |
tree | f1603784da34cfa9d53cdf82950c0a7afb3af270 /libbindgen/tests | |
parent | 4663ae9d7187fb4c7420bca8fedc6acdf0cea39d (diff) |
codegen: Constify enum variants.
Diffstat (limited to 'libbindgen/tests')
-rw-r--r-- | libbindgen/tests/expectations/tests/constify-enum.rs | 22 | ||||
-rw-r--r-- | libbindgen/tests/headers/constify-enum.h | 13 |
2 files changed, 35 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/constify-enum.rs b/libbindgen/tests/expectations/tests/constify-enum.rs new file mode 100644 index 00000000..356aaa05 --- /dev/null +++ b/libbindgen/tests/expectations/tests/constify-enum.rs @@ -0,0 +1,22 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue: + nsCSSPropertyID = + nsCSSPropertyID::eCSSProperty_COUNT_unexistingVariantValue; +pub const nsCSSPropertyID_eCSSProperty_COUNT: nsCSSPropertyID = + nsCSSPropertyID::eCSSPropertyAlias_aa; +pub const nsCSSPropertyID_eCSSProperty_COUNT_DUMMY2: nsCSSPropertyID = + nsCSSPropertyID::eCSSProperty_b; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum nsCSSPropertyID { + eCSSProperty_a = 0, + eCSSProperty_b = 1, + eCSSPropertyAlias_aa = 2, + eCSSPropertyAlias_bb = 3, + eCSSProperty_COUNT_unexistingVariantValue = 4, +} diff --git a/libbindgen/tests/headers/constify-enum.h b/libbindgen/tests/headers/constify-enum.h new file mode 100644 index 00000000..f2771e59 --- /dev/null +++ b/libbindgen/tests/headers/constify-enum.h @@ -0,0 +1,13 @@ + +enum nsCSSPropertyID { + eCSSProperty_a, + eCSSProperty_b, + + eCSSProperty_COUNT, /**< <div rustbindgen constant></div> */ + eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1, /**< <div rustbindgen constant></div> */ + + eCSSPropertyAlias_aa, + eCSSPropertyAlias_bb, + + eCSSProperty_COUNT_unexistingVariantValue, /**< <div rustbindgen constant></div> */ +}; |