-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -675,6 +675,23 @@ var LibraryEmbind = { | |
return this['fromWireType']({{{ makeGetValue('pointer', '0', 'i32') }}}); | ||
}, | ||
|
||
_embind_register_std_nullptr_t__sig: 'vpppDn', | ||
_embind_register_std_nullptr_t__deps: ['$registerType'], | ||
_embind_register_std_nullptr_t: function(rawType, name) { | ||
|
||
registerType(rawType, { | ||
name: name, | ||
'fromWireType': function (value) { | ||
return null; | ||
}, | ||
'toWireType': function (destructors, value) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
return null; | ||
}, | ||
'argPackAdvance': 8, | ||
destructorFunction: null, // This type does not need a destructor | ||
}); | ||
}, | ||
|
||
_embind_register_std_string__sig: 'vpp', | ||
_embind_register_std_string__deps: [ | ||
'$readLatin1String', '$registerType', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
// University of Illinois/NCSA Open Source License. Both these licenses can be | ||
// found in the LICENSE file. | ||
|
||
#include <cstddef> | ||
#include <string> | ||
#include <malloc.h> | ||
#include <functional> | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Why would a function have a return type of There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
return nullptr; | ||
} | ||
|
||
bool emval_test_not(bool b) { | ||
return !b; | ||
} | ||
|
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
.