Description
Inventory of platform conditionals in plugins/obs-webrtc/whip-utils.h (5 branches of one #ifdef chain, lines 61-69).
| lines | macro | what the branch does |
|---|---|---|
| 61 | _WIN64 |
OS_NAME = "Windows x86_64" |
| 63 | __APPLE__ |
OS_NAME = "Mac OS X" |
| 65 | __OpenBSD__ |
OS_NAME = "OpenBSD" |
| 67 | __FreeBSD__ |
OS_NAME = "FreeBSD" |
| 69 | __linux__ && __LP64__ |
OS_NAME = "Linux x86_64" (else "Linux") |
Proposed facade
const char *whip_platform_os_name(void) in whip-platform-windows.c, -mac.c, -nix.c; the User-Agent builder calls it. A cheaper alternative is a single obs_get_os_name() style helper in libobs/util shared by other plugins (check libobs for an existing one before adding).
Likely must stay
Nothing, though this is a low-value move: pure string selection. Do it as a starter task. 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.
Part of #847.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 17, 2026
Claiming.
whip-host.h(const char *whip_host_os_name(void)) withwhip-host-{windows,macos,posix}implementations in per-OS groups, same shape as #1248. The posix host picks Linux/FreeBSD/OpenBSD fromuname()at run time instead of compile-time macros, keeping today's strings exactly (64-bit Linux →Linux x86_64, anything else →Linux; Windows 64-bit →Windows x86_64). Test: the posix host on Linux returns the same string the old chain produced.obs-webrtc: OS name for the WHIP User-Agent behind whip-host.h (obs-r…