Skip to content

Commit 6858ac5

Browse files
committed
revert code output location change
1 parent c2f99f0 commit 6858ac5

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

crates/csharp/src/function.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,13 +1038,9 @@ impl Bindgen for FunctionBindgen<'_, '_> {
10381038
None => operands.join(", "),
10391039
};
10401040

1041-
let (_namespace, interface_name) =
1042-
&CSharp::get_class_name_from_qualified_name(self.interface_gen.name);
1043-
let interop_name = format!("{}Interop", interface_name.strip_prefix("I").unwrap());
1044-
10451041
uwriteln!(
10461042
self.src,
1047-
"{assignment} {interop_name}.{func_name}WasmInterop.wasmImport{func_name}({operands});"
1043+
"{assignment} {func_name}WasmInterop.wasmImport{func_name}({operands});"
10481044
);
10491045

10501046
if let Some(buffer) = async_return_buffer {

crates/csharp/src/interface.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,14 @@ impl InterfaceGenerator<'_> {
279279
func.name.to_string()
280280
};
281281

282+
let target = if let FunctionKind::Freestanding = &func.kind {
283+
&mut self.csharp_interop_src
284+
} else {
285+
&mut self.src
286+
};
287+
282288
uwrite!(
283-
self.csharp_interop_src,
289+
target,
284290
r#"
285291
internal static class {interop_camel_name}WasmInterop
286292
{{
@@ -292,7 +298,7 @@ impl InterfaceGenerator<'_> {
292298

293299
for (src, params) in funcs {
294300
uwrite!(
295-
self.src,
301+
target,
296302
r#"
297303
{access} {modifiers} unsafe {result_type} {camel_name}({params})
298304
{{

0 commit comments

Comments
 (0)