We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
0x
1 parent 319aa3c commit 1b79648Copy full SHA for 1b79648
build.rs
@@ -133,9 +133,14 @@ fn main() {
133
Err(env::VarError::NotUnicode(_)) => panic!(
134
"The `BOOTLOADER_PHYSICAL_MEMORY_OFFSET` environment variable must be valid unicode"
135
),
136
- Ok(s) => s.parse().expect(&format!(
137
- "The `BOOTLOADER_PHYSICAL_MEMORY_OFFSET` environment variable must be an\
138
- integer (is `{}`).",
+ Ok(s) => if s.starts_with("0x") {
+ u64::from_str_radix(&s[2..], 16)
+ } else {
139
+ u64::from_str_radix(&s, 10)
140
+ }
141
+ .expect(&format!(
142
+ "The `BOOTLOADER_PHYSICAL_MEMORY_OFFSET` environment variable must be an integer\
143
+ (is `{}`).",
144
s
145
)),
146
};
0 commit comments