Skip to content

fix: windows build (#40)#51

Open
keenanjohnson wants to merge 1 commit into
gopro:masterfrom
keenanjohnson:windows-build-fix
Open

fix: windows build (#40)#51
keenanjohnson wants to merge 1 commit into
gopro:masterfrom
keenanjohnson:windows-build-fix

Conversation

@keenanjohnson

Copy link
Copy Markdown

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

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>
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>
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