-
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
Preprocessor: Use eval() for good #7651
Conversation
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.
;_; but yeah this is so much better
@@ -603,15 +603,15 @@ Module['registerFunctions'] = registerFunctions; | |||
#endif // RELOCATABLE | |||
#endif // EMULATED_FUNCTION_POINTERS | |||
|
|||
#if WASM_BACKEND_WITH_RESERVED_FUNCTION_POINTERS | |||
#if WASM_BACKEND && RESERVED_FUNCTION_POINTERS |
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.
Should also yank out the WASM_BACKEND_WITH_RESERVED_FUNCTION_POINTERS
definition from jsifier.js, because this should be all that uses it.
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.
Thanks, fixed
I undid the embind changes regarding |
Turns out #7653 will fix the |
Actually, this blocks #7612, so let's land it with a small workaround for that embind issue, that we can remove soon. |
Thanks for this - I was considering making #if on a non-existent setting an error as well. Happy to see you have already done so. |
This replaces our custom preprocessor code with
eval()
. This allows arbitrary conditions in our#if
s, e.g. the__EMSCRIPTEN_HAS_nodefs__
things are nowwhere that function is a new utility that checks if a library was included.
This patch also switches to things we've wanted to do, like
where in the past we had to create a new global for them.
We now error if we do if we ifdef on something nonexistent (the eval call throws), which noticed that we had a bunch of
NO_DYNAMIC_EXECUTION
code that could be removed (we removed that option a while ago).