Skip to content

facade: plugins/vlc-video: move 7 platform conditionals behind a per-platform layer #857

Closed

Description

@zackees

Inventory of platform conditionals in shared-named files of plugins/vlc-video/ (7 #ifs in 3 files).

file lines macro what the branch does
vlc-video-plugin.c 1 _WIN32 windows.h include
74 __APPLE__ libvlc_core_module global
155 _WIN32 locate libvlc via registry (HKLM\...\VideoLAN\VLC)
181 __APPLE__ hard-coded /Applications/VLC.app paths, set VLC_PLUGIN_PATH, load libvlccore.dylib
238 __APPLE__ os_dlclose(libvlc_core_module) at unload
vlc-video-plugin.h 4 _MSC_VER typedef SSIZE_T ssize_t
vlc-video-source.c 583 _WIN32 convert / to \ in non-URL paths

Proposed facade

vlc-platform.h with vlc_platform_find_library() (registry / mac bundle / default), vlc_platform_unload(), vlc_platform_native_path(dstr*, is_url); implementations vlc-platform-windows.c, vlc-platform-mac.c, vlc-platform-nix.c.

Likely must stay

  • vlc-video-plugin.h:4 (ssize_t typedef for MSVC): type shim; move to a Windows compat header or keep as exception.
  • CMake OS_WINDOWS (CMakeLists.txt:40) 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.

Part of #847.

Activity

  1. zackees commented on Oct 17, 2026

    @zackees
    MemberAuthor

    Claiming. Per the host naming policy (#1009) and BUILD.md: a vlc-video-host.h interface (find/load libvlc, unload, native path) with vlc-video-host-windows.c.h, vlc-video-host-macos.c.h, vlc-video-host-posix.c.h in per-OS unity groups picked by CMake; shared files keep their names and lose their conditionals; the MSVC ssize_t shim moves to a Windows-only header if the group rules allow, else stays as the documented exception. Pure path conversion gets a cmocka test; baseline goes down by what moves.

  2. added
    claimed
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions