1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#![allow(
non_camel_case_types,
non_snake_case,
clippy::too_many_arguments,
clippy::type_complexity,
clippy::upper_case_acronyms
)]
#[inline]
pub const fn make_version(major: u32, minor: u32, patch: u32) -> u32 {
(major << 22) | (minor << 12) | patch
}
#[inline]
pub const fn version_major(version: u32) -> u32 {
version >> 22
}
#[inline]
pub const fn version_minor(version: u32) -> u32 {
(version >> 12) & 0x3FF
}
#[inline]
pub const fn version_patch(version: u32) -> u32 {
version & 0xFFF
}