-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Emscripten: Uses macOS behavior on macOS (using glfw contrib port) (part 2) #7965
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
e3bcaf7
to
1a3c005
Compare
The first run failed because of the syntax: #if EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3 >= 3'4'0'20240817
This error is due to compiling with c++11 which does not support this syntax: this syntax was introduced 10 years ago with c++14... I fixed it by removing the quotes and now CI is happy |
On the CI commit:
I agree but the comment doesn't seem to mention this: Thanks for writing and linking to that docs/Usage.md docs in your repository, this is helpful! |
I have merged the OSX commit as ac2ad79 but not the CI commit yet. (You can freely force-push edits to same branchs and i'll merge the other commits), or since I am only expecting extra comments on the CI one you can write them here and I'll append them myself.
I have appended to your commit the same change to the other #if in the same file. I am also surprised that
Thanks! I always tend to make small tweaks. If you are super curious you may compare my merged commit to yours (personally I use Git Fork I can easily see both and compare) but nothing crucial, don't sweat it. |
1a3c005
to
7ba39ac
Compare
Thank you @ocornut I have force pushed a new commit with added comments as you suggested. |
I suppose I am not an expert in CPP preprocessor behavior so maybe it might cause problems with some compilers? Since we know for a fact that it works with the Emscripten compiler, maybe it would be safer to also protect this block? (other blocks are protected) // ... Line 649 ...
#ifdef __EMSCRIPTEN__
#if EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3 >= 34020240817
...
#endif
#endif |
+ Backends: GLFW: minor preemptive fix.
Merged both changes! Thank you! |
Hi @ocornut
This is the follow up that you requested in PR #7915
This PR contains 2 independent commits for you to cherry pick:
(1) this is the one that moves the code to use the macOS behavior to the
ImGui_ImplGlfw_Init
as you suggested. I also added comments and as I mentioned in the other PR, I created a comprehensive documentation to clearly explain the differences between the 2 implementations.Note that this commit also includes a change to the
CMakeLists.txt
file as without this change you get a nasty warning and the check#if EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3 >= 34020240817
does not work(2) This second commit corresponds to the commit (1) in the other PR
I still think that this is a worthwhile addition otherwise the piece of code I added in (1) is never tested in CI run...
I paid ultra close attention to code style. I hope I got it right this time around ;)