Skip to content
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 SDLmain on Windows, rather than maintaining our own Impl. #77

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

playmer
Copy link
Contributor

@playmer playmer commented Oct 13, 2024

We currently rely on a forked version of the SDLmain library on Windows, through usage of SDL_win32_main.c. This is primarily just so we can place the std output redirects into AppData.

Rather than maintain this entire file, I've updated the scripts to use SDLmain itself, and then within onscripter.cpp disabled the SDLmain redirection and re-implemented the redirection to AppData. If we so desire it's also set up to allow us to expand redirection for platforms where it makes sense to do so. (Unix, Mac, maybe others.)

SDLmain is fairly important for the more esoteric platforms, so trying to unify on using it's entry point is what led to me looking deeper at this.

This is missing some compatability ifdefs that allowed compiling for Windows CE. I could bring them back, but I have no way to actually test that codepath.

In addition I've sorted some of our options to not use redundant platform ifdefs.

@Galladite27
Copy link
Owner

Is this ready to go?

@playmer
Copy link
Contributor Author

playmer commented Nov 29, 2024

Yup

@Galladite27
Copy link
Owner

I just have one complaint about this. I don't like how the Windows-specific flags are moved to be grouped together. I get this reduces the number of #ifdefs, but they are where they are for a reason - because they're related to similar OS-agnostic flags with which they're grouped. Please remove this and then I'll merge.

@playmer
Copy link
Contributor Author

playmer commented Nov 29, 2024

No worries, will work on it over the weekend.

@playmer playmer force-pushed the playmer/Use_SDLMain branch from 867ade7 to 3b131a2 Compare November 30, 2024 20:37
@Galladite27
Copy link
Owner

Thanks

@Galladite27 Galladite27 merged commit 6f00eef into Galladite27:master Nov 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants