Skip to content

Commit 1a7ee21

Browse files
committed
Define DEPRECATED_SCANF macro to use older scanf,sscanf,fscanf symbols
1 parent 0ae8451 commit 1a7ee21

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,6 +2257,10 @@ fn test_linux(target: &str) {
22572257
let mut cfg = ctest::TestGenerator::new();
22582258
// FIXME: still necessary?
22592259
cfg.define("_GNU_SOURCE", None);
2260+
// This macro re-deifnes fscanf,scanf,sscanf to link to the symbols that are
2261+
// deprecated since glibc >= 2.29. This allows Rust binaries to link against
2262+
// glibc versions older than 2.29.
2263+
cfg.define("DEPRECATED_SCANF", None);
22602264

22612265
// FIXME: still necessary?
22622266
cfg.flag("-Wno-deprecated-declarations");

0 commit comments

Comments
 (0)