Skip to content

Commit 8748bdd

Browse files
committed
Redefine strdup, open, fdopen as _strdup, _open, _fdopen to avoid linking errors on MSVC
1 parent 900ba55 commit 8748bdd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libprofiler_builtins/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ fn main() {
3939
// Don't pull in extra libraries on MSVC
4040
cfg.flag("/Zl");
4141
profile_sources.push("WindowsMMap.c");
42+
cfg.define("strdup", Some("_strdup"));
43+
cfg.define("open", Some("_open"));
44+
cfg.define("fdopen", Some("_fdopen"));
4245
} else {
4346
// Turn off various features of gcc and such, mostly copying
4447
// compiler-rt's build system already

0 commit comments

Comments
 (0)