https://gitlab.synchro.net/main/sbbs/-/commit/04435dcc644a3b23c1be8c2e
Added Files:
src/doors/clans-src/src/tests/mocks_platform.h
Modified Files:
src/doors/clans-src/docs/functions.md testability.md src/doors/clans-src/src/alliancem.c chew.c clans.c clansini.c defines.h door.c ecomp.c empire.c help.c ibbs.c input.c install.c items.c makenpc.c mclass.c mcomp.c mitems.c mspells.c myibbs.c myopen.c news.c npc.c platform.c platform.h qtest.c quests.c readcfg.c reg.c reset.c scores.c semfile.c system.c src/doors/clans-src/src/tests/test_console.c test_maint.c test_news.c test_semfile.c src/doors/clans-src/src/unix_wrappers.c unix_wrappers.h user.c video.c video.h village.c win_wrappers.c win_wrappers.h
Log Message:
Wrap all non-C17 calls behind platform abstraction layer
Create plat_stricmp (wraps strcasecmp/stricmp), plat_fsopen (wraps
_fsopen), plat_CreateSemfile (NFS-safe on Unix, fopen "w+x" elsewhere), plat_mkdir, plat_GetExePath, plat_getmode, and plat_chmod. Move
DirExists from platform.c into the per-platform wrapper files.
Replace all 116 strcasecmp call sites with plat_stricmp. Replace all _fsopen/_SH_DENY* call sites with plat_fsopen/PLAT_SH_DENY*. Replace
MKDIR macro, GetModuleFileName/fullpath exe-path logic, stat()-based
permission capture (chew.c), and chmod()-based permission restore
(install.c) with platform wrappers.
On Windows, add a real strdup() function (conditional on C < C23) to
replace the old #define macro. Remove stale #includes from myibbs.c.
Eliminate all #ifndef __unix__ and #ifdef __unix__...#else patterns;
replace with explicit platform guards so new ports don't silently get
wrong behavior. Simplify FAR macro to default empty unless __MSDOS__.
Update docs/functions.md with ~60 previously undocumented functions
(fight.c second half, empire.c first half, user.c first half, new
platform wrappers). Update docs/testability.md with new sections,
corrected D/T markings, and clarified Non-C17 column rules.
Refactor test_semfile.c to use mock-driven plat_CreateSemfile instead
of real filesystem operations. Add mocks_platform.h shared test stubs.
Co-Authored-By: Claude Opus 4.6 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net