diff --git a/crates/libs/bindgen/src/standalone.rs b/crates/libs/bindgen/src/standalone.rs index c81d2d4b45..63e362e84e 100644 --- a/crates/libs/bindgen/src/standalone.rs +++ b/crates/libs/bindgen/src/standalone.rs @@ -19,7 +19,7 @@ pub fn standalone(names: &[&str]) -> String { let mut type_names = BTreeSet::new(); let mut core_types = BTreeSet::new(); - let mut enums = BTreeMap::new(); + let mut enums = BTreeSet::new(); for name in names { let type_name = TypeName::parse(name); @@ -95,7 +95,7 @@ pub fn standalone(names: &[&str]) -> String { found = true; let enum_name = gen.reader.type_def_type_name(def); type_names.insert(enum_name); - enums.insert(enum_name, type_name.name); + enums.insert((enum_name, type_name.name)); } } } diff --git a/crates/tests/standalone/build.rs b/crates/tests/standalone/build.rs index 1780bfb854..d40ac38450 100644 --- a/crates/tests/standalone/build.rs +++ b/crates/tests/standalone/build.rs @@ -59,7 +59,10 @@ fn main() { write( "src/b_enumerator.rs", - &["Windows.Win32.Foundation.WAIT_IO_COMPLETION"], + &[ + "Windows.Win32.Foundation.WAIT_IO_COMPLETION", + "Windows.Win32.Foundation.WAIT_TIMEOUT", + ], ); write( diff --git a/crates/tests/standalone/src/b_enumerator.rs b/crates/tests/standalone/src/b_enumerator.rs index 7eed5fcae5..96be6122d4 100644 --- a/crates/tests/standalone/src/b_enumerator.rs +++ b/crates/tests/standalone/src/b_enumerator.rs @@ -9,3 +9,4 @@ )] pub type WIN32_ERROR = u32; pub const WAIT_IO_COMPLETION: WIN32_ERROR = 192u32; +pub const WAIT_TIMEOUT: WIN32_ERROR = 258u32; diff --git a/crates/tests/standalone/src/lib.rs b/crates/tests/standalone/src/lib.rs index 995c280df8..679986d90c 100644 --- a/crates/tests/standalone/src/lib.rs +++ b/crates/tests/standalone/src/lib.rs @@ -97,6 +97,12 @@ fn unknown() { } } +#[test] +fn enumerator() { + assert_eq!(b_enumerator::WAIT_IO_COMPLETION, 192); + assert_eq!(b_enumerator::WAIT_TIMEOUT, 258); +} + #[test] fn test() { use b_test::*;