Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for mingw toolchain in Windows #627

Merged
merged 6 commits into from
Mar 4, 2025

Conversation

Biswa96
Copy link
Contributor

@Biswa96 Biswa96 commented Feb 27, 2025

No description provided.

_MSC_VER is defined in MSVC toolchain only whereas _WIN32 is defined for all toolchain targeting Windows.
See https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros
This fixes compiler errors as following with cmake and mingw compiler.

cava/output/sdl_glsl.c:9:10: fatal error: output/sdl_glsl.h: No such file or directory
 9 | #include "output/sdl_glsl.h"
   |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
This fixes the following compiler error with mingw compiler.

cava/output/sdl_glsl.c:89:16: error:
passing argument 1 of 'printf' from incompatible pointer type [-Wincompatible-pointer-types]
89 |         printf(stderr, "Error initializing GLEW! %s\n", glewGetErrorString(glewError));
   |                ^~~~~~
   |                |
   |                FILE * {aka struct _iobuf *}
This fixes the following compiler error with mingw compiler.

cava/cava.c:258:32: error:
passing argument 1 of 'SetConsoleCtrlHandler' from incompatible pointer type [-Wincompatible-pointer-types]
258 |     if (!SetConsoleCtrlHandler(sig_handler, TRUE)) {
    |                                ^~~~~~~~~~~
    |                                |
    |                                void (*)(int)
@Biswa96
Copy link
Contributor Author

Biswa96 commented Feb 27, 2025

tl;dr The changes are not due to mingw toolchain. These fix the assumptions and mistakes with Microsoft Visual Studio compiler.

@karlstav
Copy link
Owner

karlstav commented Mar 4, 2025

nice! yes the windows support was thrown together sitting in visual studio, didn't really expect it to catch on. Maybe the cmake could be expanded to be used in visual studio as well and get rid of some of the hardcoded project files. Not sure how to do the nuget stuff though.

@karlstav karlstav merged commit 80f7390 into karlstav:master Mar 4, 2025
6 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants