fix: windows build (#40)#51
Open
keenanjohnson wants to merge 1 commit into
Open
Conversation
This was referenced Sep 5, 2025
Open
dcliftreaves
pushed a commit
to dcliftreaves/gpr
that referenced
this pull request
May 4, 2026
Pre-existing GoPro issues fixed for MSVC/Windows: - expat_lib: replace __attribute((fallthrough)) with FALL_THROUGH macro (from gopro#51 by @keenanjohnson) - encoder.c, decoder.c, vlc.c: guard pthread.h with #ifndef _WIN32 - encoder.c: force embedded_mode on Windows (single-thread, no pthreads) - decoder.c: single-thread inverse transform on Windows - vlc.c: replace pthread_once with simple init check on Windows - main_c.c: guard strings.h, add _stricmp for MSVC (from #51) - CMakeLists: conditional -lm (not needed on MSVC) and Threads linkage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced May 4, 2026
dcliftreaves
pushed a commit
to dcliftreaves/gpr
that referenced
this pull request
May 13, 2026
Replace raw __attribute((fallthrough)) with the FALL_THROUGH macro already defined in expat_lib/internal.h. The macro expands to __attribute__((fallthrough)) on GCC/Clang and ((void)0) on MSVC. Without this fix, MSVC produces: error C2065: 'fallthrough': undeclared identifier Credit: approach from gopro#51 by @keenanjohnson Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dcliftreaves
pushed a commit
to dcliftreaves/gpr
that referenced
this pull request
May 13, 2026
- Guard #include <strings.h> with #ifndef _WIN32 (not available on MSVC) - Add _stricmp definition for _WIN32 (MSVC equivalent of strcasecmp) Without this fix, MSVC produces: fatal error C1083: Cannot open include file: 'strings.h' Credit: approach from gopro#51 by @keenanjohnson Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes the windows build errors as described in the issue: #40
Verified by myself locally and my github actions CI I have configured here: https://github.com/keenanjohnson/gpr_tools/actions