-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Use int
to represent webidl long
type
#20290
Conversation
As a follow up we might consider switch to However that seems like a big change that could cause breakages, relatively risk-free change first to unblock wasm64. |
f8f2fab
to
e951c06
Compare
e951c06
to
19c6e32
Compare
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.
Any particular reason not to just use int32_t
? or do we not use stdint in html5.h?
Yeah we don't include that header there... although we could. I'm inclined to stick with this solution since its kind of minimal fix. |
The webidl `long` type is defined to be a 32-bit type: https://webidl.spec.whatwg.org/#idl-long https://webidl.spec.whatwg.org/#idl-unsigned-long Using `long` on the native side works find for wasm32 but breaks under wasm64 where `long` is 64-bit. Using `int` instead means the type is the same under wasm32 and wasm64 which more accurately represents the html5/webidl type. See emscripten-core#20276
19c6e32
to
07eb137
Compare
The webidl
long
type is defined to be a 32-bit type:https://webidl.spec.whatwg.org/#idl-long
https://webidl.spec.whatwg.org/#idl-unsigned-long
Using
long
on the native side works find for wasm32 but breaks under wasm64 wherelong
is 64-bit. Usingint
instead means the type is the same under wasm32 and wasm64 which more accurately represents the html5/webidl type.See #20276