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
{{ message }}
Repository navigation
facade: libobs/util/platform.c and profiler-io.c: move 7 platform conditionals into platform-<os> files #874
platform.c is not swapped for Rust under ENABLE_RUST_LIBOBS (only base/bmem/config-file/dstr/pipe/profiler/utf8 are); profiler-io.c is compiled in both builds. Targets: util/platform-windows.c, platform-nix.c, platform-cocoa.m.
Class totals: (a) movable 7, (b) stays - public header 0, (c) Rust-ported 0. Total: 7. Line numbers on origin/master.
file:line
macro
branch
class
proposed function / target
libobs/util/platform.c:37
_MSC_VER
os_fopen mode converted to wide char
a
os_fopen Windows body in platform-windows.c
libobs/util/platform.c:57
_WIN32
wide-char fopen (UTF-8 path to wcs)
a
same
libobs/util/platform.c:92
_WIN32
os_stat implementation using wide stat
a
move to platform-windows.c
libobs/util/platform.c:125
_MSC_VER
os_fseeki64: _fseeki64 vs fseeko
a
os_fseeki64/os_ftelli64 in platform-windows.c and platform-nix.c
libobs/util/platform.c:134
_MSC_VER
os_ftelli64: _ftelli64 vs ftello
a
same
libobs/util/profiler-io.c:343
_WIN32
gzopen_w with wide filename
a
os_gzopen(const char*,const char*) in platform-.c
libobs/util/profiler-io.c:360
_WIN32
gzclose_w vs gzclose
a
os_gzclose in platform-.c
Classes: (a) movable behind per-platform files; (b) public-header ABI/export/type selection, stays; (c) already replaced by the Rust port (platform code isolated in src/platform/). Macro column abbreviates the #if expression; ! means negated, elif means an #elif line.
Test approach: Existing cmocka util tests (Tier 2 Linux Rust OFF/ON) incl. os_fopen/os_fseeko; Windows branch via native build; add a characterization test of os_fopen/os_stat on a UTF-8 path.
Each move is one function per facade entry, mechanical, so upstream merges stay manageable; the ratchet baseline (step 1) drops by the moved count.
Claiming: #874. The 7 conditionals are still on master: libobs/util/platform-file.c.h (5, from platform.c) and profiler-io.c.h (2).
RED: a ci/ facade test asserting these two files have no host conditionals and that the Windows/nix bodies live in platform-windows.c.h / platform-nix.c.h.
GREEN: move os_fopen/os_stat/os_fseeki64/os_ftelli64 bodies into the host files (all are C-only ported-* groups, so the build sets match). The gz open/close move behind a private (non-public) header. Lower the ratchet baseline by 7.
No public header changes. PR today.
#2016 removes 1 of the 7 conditionals: gzclose replaces the Windows-only gzclose_w branch. The other 6 need more than a mechanical move.
Oracle:rust/obs-c-oracle/oracle/platform.c compiles platform-file.c.h on its own with oracle_ renames. If the bodies move into platform-nix.c.h / platform-windows.c.h, the same renames have to be added to oracle/platform_nix_posix.c and oracle/platform_windows.c.
MinGW:os_wfopen, os_fseeki64 and os_ftelli64 branch on _MSC_VER, not _WIN32. So MinGW has a third variant: UTF-8 conversion plus fopen, fseeko and ftello. build.rs drops platform_windows.c for windows-gnu (rust: Port libobs/util/platform-windows.c to obs-util #707), so after a plain move the windows-gnu oracle would have no oracle_os_fopen. It needs either a MinGW home for those bodies or a decision that windows-gnu stops using them.
gzopen: the gzopen_w branch in profiler-io.c.h needs a host gzopen helper behind a private header, plus zlib in the windows/posix host PCHs. The profiler-io oracle unit would then need it too.
I'm releasing the remainder after #2016. Releasing #874 (rest).
Triage: scoped (7 conditionals, 1 removed by #2016). The remaining 6 have the oracle constraint described above (rust/obs-c-oracle/oracle/platform.c builds platform-file.c.h alone with oracle_ renames), so a PR has to keep the oracle building those bodies. Acceptance: the 6 moved into the host files, the oracle and the Tier 3 differential tests unchanged and green, and the ratchet baseline lowered. P3, size:M.
Claiming: #874 (the remaining 6). Plan: move the bodies into the host files, keep the oracle building them (including windows-gnu), lower the ratchet baseline.
Activity
util: Port profiler-io to obs-util (GREEN)
util: Port profiler-io to obs-util (GREEN)
util: Port profiler-io to obs-util (GREEN)
util: Port profiler-io to obs-util (GREEN)
util: Port profiler-io to obs-util (obs-rust#1875)
zackees commentedon Oct 24, 2026
Claiming: #874. The 7 conditionals are still on master:
libobs/util/platform-file.c.h(5, from platform.c) andprofiler-io.c.h(2).ci/facade test asserting these two files have no host conditionals and that the Windows/nix bodies live inplatform-windows.c.h/platform-nix.c.h.os_fopen/os_stat/os_fseeki64/os_ftelli64bodies into the host files (all are C-onlyported-*groups, so the build sets match). The gz open/close move behind a private (non-public) header. Lower the ratchet baseline by 7.No public header changes. PR today.
zackees commentedon Oct 24, 2026
#2016 removes 1 of the 7 conditionals:
gzclosereplaces the Windows-onlygzclose_wbranch. The other 6 need more than a mechanical move.rust/obs-c-oracle/oracle/platform.ccompilesplatform-file.c.hon its own withoracle_renames. If the bodies move intoplatform-nix.c.h/platform-windows.c.h, the same renames have to be added tooracle/platform_nix_posix.candoracle/platform_windows.c.os_wfopen,os_fseeki64andos_ftelli64branch on_MSC_VER, not_WIN32. So MinGW has a third variant: UTF-8 conversion plusfopen,fseekoandftello.build.rsdropsplatform_windows.cfor windows-gnu (rust: Port libobs/util/platform-windows.c to obs-util #707), so after a plain move the windows-gnu oracle would have nooracle_os_fopen. It needs either a MinGW home for those bodies or a decision that windows-gnu stops using them.gzopen_wbranch inprofiler-io.c.hneeds a hostgzopenhelper behind a private header, plus zlib in the windows/posix host PCHs. The profiler-io oracle unit would then need it too.I'm releasing the remainder after #2016. Releasing #874 (rest).
util: close the profiler's csv.gz with gzclose on every host (obs-rus…
zackees commentedon Oct 25, 2026
/ready
Triage: scoped (7 conditionals, 1 removed by #2016). The remaining 6 have the oracle constraint described above (
rust/obs-c-oracle/oracle/platform.cbuildsplatform-file.c.halone withoracle_renames), so a PR has to keep the oracle building those bodies. Acceptance: the 6 moved into the host files, the oracle and the Tier 3 differential tests unchanged and green, and the ratchet baseline lowered. P3, size:M.zackees commentedon Oct 25, 2026
Claiming: #874 (the remaining 6). Plan: move the bodies into the host files, keep the oracle building them (including windows-gnu), lower the ratchet baseline.
util: Host files include their group's PCH; group members sorted (#874)
test: platform-file and profiler-io host bodies live in the host file…
util: Move platform-file and profiler-io host branches into the host …
util: profiler_gzopen returns zlib's gzFile, so the oracle's zlib shi…
util: Host files include their group's PCH; group members sorted (#874)
util: Move platform-file and profiler-io host branches into host files (