#[cfg_attr(any(not(windows), target_env = "gnu"), repr(u32))] // include windows-gnu
#[cfg_attr(all(windows, not(target_env = "gnu")), repr(u32))] // msvc being *special* again
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum WhisperGrammarElementType {
/// End of rule definition
End = whisper_gretype_WHISPER_GRETYPE_END,
/// Start of alternate definition for a rule
Alternate = whisper_gretype_WHISPER_GRETYPE_ALT,
/// Non-terminal element: reference to another rule
RuleReference = whisper_gretype_WHISPER_GRETYPE_RULE_REF,
/// Terminal element: character (code point)
Character = whisper_gretype_WHISPER_GRETYPE_CHAR,
/// Inverse of a character(s)
NotCharacter = whisper_gretype_WHISPER_GRETYPE_CHAR_NOT,
/// Modifies a preceding [Self::Character] to be an inclusive range
CharacterRangeUpper = whisper_gretype_WHISPER_GRETYPE_CHAR_RNG_UPPER,
/// Modifies a preceding [Self::Character] to add an alternate character to match
CharacterAlternate = whisper_gretype_WHISPER_GRETYPE_CHAR_ALT,
}
I'm getting those errors but with the types the other way around with the stable-x86_64-pc-windows-gnu toolchain. No errors if I switch the toolchain to msvc.
toolchain: stable-x86_64-pc-windows-msvc (default) rustc 1.76.0 (07dca489a 2024-02-04)
clang: clang version 17.0.6 Target: x86_64-w64-windows-gnu Thread model: posix InstalledDir: C:/msys64/mingw64/bin
cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32824 for x64
when building whisper-rs with whisper-rs-sys, the type mismatched.
I m wondering the problem came from here
https://github.com/tazz4843/whisper-rs/blob/4dca14d5ec88fb7e420d46789656628b8e191bec/src/whisper_grammar.rs#L9
we should align msvc special type just to be u32