-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Move emscripten_GetProcAddress callers into C #13524
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
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.
Awesome!!
|
||
void* glfwGetProcAddress(const char* name) { | ||
return emscripten_GetProcAddress(name); | ||
} |
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.
Would it not make sense to these to live in their various different libraries?
Is emscripten_GetProcAddress
just for GL symbols? I wonder if it should be renamed to reflect that?
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.
We don't have compiled libraries for them, and adding new ones just for what are basically aliases seemed like overkill. Perhaps we can even just make them aliases in the headers, if you prefer that?
Yes, that function is just for GL symbols. I'm not opposed to renaming it (separate from this PR I assume?)
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'm fine with this now if tests pass.
Can we also do the same for When those entries removed too the vast majority of the effect of
JS size hardly effected and wasm size goes up by ~10k which is basically the cost of malloc/free:
|
@sbc100 Yes, I think those can be done as well. Do you prefer them in this PR or in another? But ping on my questions from earlier, this PR is waiting on a response from you there I believe? (#13524 (comment)) |
Followup PR is fine. |
Looks like tests failed due to SDL2 linking in its own |
Making it weak sounds fine. Another alternative might be to put each function in its own object file.. but that might cause complications with |
This avoids having them on the right-hand-side in deps_info, which
means that in
REVERSE_DEPS=all
mode we do not include thatfunction and all the GL code it calls. Instead, the callers are just more
C functions that the linker does the right thing.