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

Mingw32 4.8.0 #23

Merged
merged 3 commits into from
Jan 28, 2024
Merged

Mingw32 4.8.0 #23

merged 3 commits into from
Jan 28, 2024

Conversation

dmitrysmagin
Copy link
Contributor

@dmitrysmagin dmitrysmagin commented Mar 26, 2023

Here's a PR for windows-specific modifications.

  1. Renamed local sdl.h -> sdlx.h to avoid confusion #include "sdl.h" vs #include <SDL.h>
  2. Added sdl-win-fix.sh script which fixes resulting Makefiles for compiling console application instead of windows one.
  3. Smaller header fixes for SDL2

And yes, both compiling against old SDL12 and newer SDL2 is working (--with-sdl=sdl12 or --with-sdl=sdl2 configure flags)

./configure --prefix=/mingw CXXFLAGS=-fpermissive

Also, a bit ugly, but I had to add #undef main just before main(), because SDL on windows does #define main SDLmain somewhere inside its headers and it can't be overriden in mingw command line. This #undef does no harm on other platforms, though.

@mywave82
Copy link
Contributor

mywave82 commented Mar 26, 2023

TODO list:

  • I will address the m4 stuff in a separate PR first, which also will make it easier to pull in the latest macro files in a more clean fasion.
  • Find a better fix for SDLmain issue, and worst case use the same method, but it will need to protected with #ifdef main
  • Try to find a better fix for the SDL linking that you currently patch via the script
  • Fix getopt_long() to remove that typecast (I can do this in a seperate PR)

@mywave82 mywave82 mentioned this pull request Apr 1, 2023
@mywave82
Copy link
Contributor

mywave82 commented Apr 2, 2023

#25 should remove the typecast needed for getopt_long. The const in the middle is a leftover from the original GNU implementation which lingers around many places.

@mywave82 mywave82 force-pushed the mingw32-4.8.0 branch 2 times, most recently from daa6dd4 to 9711796 Compare June 27, 2023 22:53
@mywave82
Copy link
Contributor

Sorry for all the extra forced pushes, but I have reworked your patches, and rebased them to the current master.

@mywave82
Copy link
Contributor

mywave82 commented Jun 27, 2023

fprintf (stderr, ""); // temporary bug-workaround. Running getopt_long in wine atleast without stderr being initialized causes a strlen(NULL) exception somehow

Should be debugged some probably. Atleast for me if I run the result binary under wine; it crashes without it. All a bit wierd.

No longer happens with my test-setup

@dmitrysmagin
Copy link
Contributor Author

Thanks for the effort.
Using sed in configure.ac to fix the flags is quite curious, much cleaner that using a separate script.

@mywave82 mywave82 merged commit ce0da9e into adplug:master Jan 28, 2024
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