use crate::version::Version;
macro_rules! version {
($major:expr, $minor:expr, $patch:expr) => {
Version {
major: $major,
minor: $minor,
patch: $patch,
}
};
}
pub(crate) const KNOWN_ENUM_BREAKS: &[Version] = &[
version!(4, 8, 16),
version!(4, 13, 2),
version!(4, 14, 1),
version!(5, 0, 0),
];
pub(crate) fn warn_on_mismatches(detected: Version) {
let Some(¤t) = KNOWN_ENUM_BREAKS.last() else {
return;
};
if detected >= current {
return;
}
println!(
"cargo:warning=z3-sys: attempting to link against Z3 {detected} with `z3-sys` bindings for Z3 >= {current}; \
enum numbering (e.g. Z3_decl_kind) may differ across these versions. \
Consider updating Z3 or else enabling the `bindgen` feature to ensure compatibility.",
);
}