You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inventory of platform conditionals in shared-named files of plugins/image-source/ (7 #ifs in 4 files). Existing pattern: image-file-version-win32.c holds the Windows implementation; image-file-version.c is the non-Windows one but is named shared.
file
lines
macro
what the branch does
image-file-version.c
8
!_WIN32
whole nix implementation of image_file_version_get (Windows variant in -win32.c)
20
__APPLE__
st_mtimespec vs st_mtim nanoseconds
image-source.c
285, 294
_WIN32
file-dialog filter string includes JXR
obs-slideshow.c
241, 916
_WIN32
.jxr accepted as image ext; extension filter string
obs-slideshow-mk2.c
968
_WIN32
extension filter string includes *.jxr
Proposed facade
Rename image-file-version.c to image-file-version-posix.c (path marks platform) and move the __APPLE__ mtime nanosecond choice into a tiny image_file_version_mtime_nsec(const struct stat*) implemented in -posix.c and -mac.c, or use a helper from util/platform.h.
image-source/platform.h: image_platform_supports_jxr() plus image_platform_extra_filters() (Windows returns the JXR entries) so the three filter/extension sites call one function.
Likely must stay
Nothing structurally; the JXR rows are small data differences and are best served by the facade getter. CMake OS_WINDOWS (CMakeLists.txt:21) stays.
Test approach
Behaviour-preserving moves. Verify with: the plugin's native builds on each platform (ci-full label, since these are outside the quick gate), the existing cmocka tests where the moved function is testable, and ./lint. Where a facade function is pure (path/name/constant selection) add a small unit test per platform implementation. The #847 ratchet lint baseline must go down by the count moved.
Claiming. Same shape as #857 (PR #1248): upstream files stay in place and keep their names (#1051, so no -posix.c rename); a conditional-free image-source-host.h (JXR support/filter strings, mtime nanoseconds) with image-source-host-{windows,macos,posix}.c.h in per-OS unity groups picked by CMake (BUILD.md). Pure getters get a cmocka test; baseline goes down by what moves.
Activity
zackees commentedon Oct 17, 2026
Claiming. Same shape as #857 (PR #1248): upstream files stay in place and keep their names (#1051, so no
-posix.crename); a conditional-freeimage-source-host.h(JXR support/filter strings, mtime nanoseconds) withimage-source-host-{windows,macos,posix}.c.hin per-OS unity groups picked by CMake (BUILD.md). Pure getters get a cmocka test; baseline goes down by what moves.image-source: Host code behind image-source-host.h (obs-rust#858) (ob…