Skip to content

Commit 9c1604e

Browse files
committed
Attempt to fix libgit2's MinGW build
1 parent c0ab463 commit 9c1604e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libgit2-sys/build.rs

+7
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ fn main() {
5858
if windows {
5959
add_c_files(&mut cfg, "libgit2/src/win32".as_ref());
6060
cfg.define("STRSAFE_NO_DEPRECATE", None);
61+
62+
// libgit2's build system claims that forks like mingw-w64 of MinGW
63+
// still want this define to use C99 stdio functions automatically.
64+
// Apparently libgit2 breaks at runtime if this isn't here? Who knows!
65+
if target.contains("gnu") {
66+
cfg.define("__USE_MINGW_ANSI_STDIO", "1");
67+
}
6168
} else {
6269
add_c_files(&mut cfg, "libgit2/src/unix".as_ref());
6370
cfg.flag("-fvisibility=hidden");

0 commit comments

Comments
 (0)