Skip to content

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
@Biswa96
Copy link
Contributor Author

Biswa96 commented Sep 10, 2025

With these changes, cava is now in msys2/mingw repository https://packages.msys2.org/base/mingw-w64-cava

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