Skip to content

Commit

Permalink
Add workaround for VaList being generated in v(f)printf
Browse files Browse the repository at this point in the history
Merges: #40
  • Loading branch information
chrysn authored Feb 5, 2024
2 parents 8ff2d35 + 2538002 commit 297c670
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,13 @@ fn main() {
.to_string();
}

// On 64-bit native, what gets emitted as vprintf(_, _, _: __builtin_va_list) gets emitted as
// vprintf(_, _, _: core::ffi::VaList), which is unsupported in stable -- but we don't use that
// function, it's just an unfortunate side effect of --preserve-unused-functions. This quick
// workaround enables building and ensures that the function is never called.
rustcode = rustcode.replace("::core::ffi::VaList", "::core::convert::Infallible");
rustcode = rustcode.replace("__arg.as_va_list()", "__arg");

// Replace the function declarations with ... usually something pub, but special considerations
// may apply
let mut rustcode_functionsreplaced = String::new();
Expand Down

0 comments on commit 297c670

Please sign in to comment.