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

Add support for mingw toolchain in Windows #627

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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.

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.

1 participant