mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-04 17:12:13 +00:00
fix generation of C signature when roc returns c_void
This commit is contained in:
parent
35980e50b8
commit
a3e759cc3c
1 changed files with 6 additions and 2 deletions
|
|
@ -3972,13 +3972,17 @@ fn expose_function_to_host_help_c_abi_v2<'a, 'ctx, 'env>(
|
||||||
¶m_types[..param_types.len().saturating_sub(1)],
|
¶m_types[..param_types.len().saturating_sub(1)],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
(RocReturn::Return | RocReturn::ByPointer, CCReturn::Void) => {
|
(RocReturn::Return, CCReturn::Void) => {
|
||||||
|
// the roc function returns a unit value. like `{}` or `{ { {}, {} }, {} }`.
|
||||||
|
// In C, this is modelled as a function returning void
|
||||||
|
(¶ms[..], ¶m_types[..])
|
||||||
|
}
|
||||||
|
(RocReturn::ByPointer, CCReturn::Void) => {
|
||||||
// the roc function returns a unit value. like `{}` or `{ { {}, {} }, {} }`.
|
// the roc function returns a unit value. like `{}` or `{ { {}, {} }, {} }`.
|
||||||
// In C, this is modelled as a function returning void
|
// In C, this is modelled as a function returning void
|
||||||
(
|
(
|
||||||
¶ms[..],
|
¶ms[..],
|
||||||
¶m_types[..param_types.len().saturating_sub(1)],
|
¶m_types[..param_types.len().saturating_sub(1)],
|
||||||
// ¶m_types[..],
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
_ => (¶ms[..], ¶m_types[..]),
|
_ => (¶ms[..], ¶m_types[..]),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue