Skip to content

Commit

Permalink
Use C.uint64_t for lowered callback response
Browse files Browse the repository at this point in the history
Exact size of `ulong` may vary in different OSes or architectures.
Uniffi-rs always expects integers of specific sizes. In this case -
`uint64_t`

Signed-off-by: Savolro <[email protected]>
  • Loading branch information
Savolro committed May 17, 2023
1 parent d577eda commit 2ddd6a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindgen/templates/CallbackInterfaceRuntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func (c *FfiConverterCallbackInterface[CallbackInterface]) read(reader io.Reader
return c.lift(readUint64(reader))
}

func (c *FfiConverterCallbackInterface[CallbackInterface]) lower(value CallbackInterface) C.ulong {
return C.ulong(c.handleMap.insert(&value))
func (c *FfiConverterCallbackInterface[CallbackInterface]) lower(value CallbackInterface) C.uint64_t {
return C.uint64_t(c.handleMap.insert(&value))
}

func (c *FfiConverterCallbackInterface[CallbackInterface]) write(writer io.Writer, value CallbackInterface) {
Expand Down

0 comments on commit 2ddd6a5

Please sign in to comment.