Skip to content

Conversation

@rohlem
Copy link

@rohlem rohlem commented Jan 10, 2025

In updating dvui to zig version 0.14.0-dev.2628+5b5c60f43, on Windows I encountered the following build error:

...\zig\p\1220c3a9f874bda11563c0f1e7fa5bfab0f7378af40310dcd49426e7d1afe9483fb6\src/joystick/windows/SDL_windows_gaming_input.c:35:10: error: 'windows.gaming.input.h' file not found
#include "windows.gaming.input.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~
...\zig\p\1220c3a9f874bda11563c0f1e7fa5bfab0f7378af40310dcd49426e7d1afe9483fb6\src/joystick/windows/SDL_rawinputjoystick.c:67:10: error: 'windows.gaming.input.h' file not found
#include "windows.gaming.input.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~

I don't have MSVC installed, and I guess zig compiling via mingw headers doesn't provide this header.
Therefore to make the build succeed, I had to adjust this predefined macro not to assume the header is present.

Having build.zig options/integration for this would probably be preferable, however,
for whatever reason for .windows os tag the pregenerated config is chosen,
and I didn't want to touch any of that logic without the necessary context,
so this seemed like the minimal fix.

As far as I understand, __MINGW32__ shouldn't be defined when compiling for msvc ABI (which I assume includes the header),
so behavior should be the same for that target.

@rohlem rohlem changed the title disable windows gaming input for mingw don't assume windows gaming input available for mingw Jan 10, 2025
@jayschwa jayschwa merged commit a13d7e8 into allyourcodebase:main Jan 10, 2025
@rohlem rohlem deleted the zig-mingw-for-dvui branch January 18, 2025 16:24
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