-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embind: Add support for std::nullptr_t
#18661
base: main
Are you sure you want to change the base?
Conversation
I think the first character in the signature represents the return type, in this case |
@@ -74,6 +75,10 @@ val emval_test_passthrough(val v) { | |||
void emval_test_return_void() { | |||
} | |||
|
|||
std::nullptr_t emval_test_return_nullptr_t() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would a function have a return type of std::nullptr_t
. I've seen it used for overloading with parameters but not this?
@@ -675,6 +675,23 @@ var LibraryEmbind = { | |||
return this['fromWireType']({{{ makeGetValue('pointer', '0', 'i32') }}}); | |||
}, | |||
|
|||
_embind_register_std_nullptr_t__sig: 'vpppDn', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be vpp
.
'fromWireType': function (value) { | ||
return null; | ||
}, | ||
'toWireType': function (destructors, value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think null is a valid wasm type. This should probably be 0.
@@ -74,6 +75,10 @@ val emval_test_passthrough(val v) { | |||
void emval_test_return_void() { | |||
} | |||
|
|||
std::nullptr_t emval_test_return_nullptr_t() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't see this function bound anywhere. e.g. look at how emval_test_not
works.
As the title says, this adds support for
std::nullptr_t
types to the Embind. This came up when bootstrapping a pre-existing binding generator test suite to work with Embind target.Used the sig
vpppDn
whereDn
is the Itanium C++ mangled encoding, but not really sure about the rest of the letters, and couldn't really find any documentation regarding how these signatures mean. Is this documented anywhere?