Skip to content

Commit b022ff1

Browse files
committedNov 29, 2024·
Unbreak .def generation
Fixes #426.
1 parent c027fcf commit b022ff1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎src/build.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,23 @@ fn build_def_file(
147147
// Create the .def output file
148148
let def_file = cargo_util::paths::create(targetdir.join(format!("{name}.def")))?;
149149

150-
write_def_file(dll_file, def_file)?;
150+
write_def_file(name, dll_file, def_file)?;
151151
}
152152

153153
Ok(())
154154
}
155155

156-
fn write_def_file<W: std::io::Write>(dll_file: object::File, mut def_file: W) -> anyhow::Result<W> {
156+
fn write_def_file<W: std::io::Write>(
157+
name: &str,
158+
dll_file: object::File,
159+
mut def_file: W,
160+
) -> anyhow::Result<W> {
157161
use object::read::Object;
158162

163+
writeln!(def_file, "LIBRARY \"{name}.dll\"")?;
159164
writeln!(def_file, "EXPORTS")?;
160165

161166
for export in dll_file.exports()? {
162-
def_file.write_all(b"\t")?;
163167
def_file.write_all(export.name())?;
164168
def_file.write_all(b"\n")?;
165169
}

0 commit comments

Comments
 (0)
Please sign in to comment.