• src/doors/syncmoo1/build.bat src/doors/syncmoo1/compat/msvc_compat.h s

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Fri Jul 10 23:41:56 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/50d84eeeb975bd8ad050308a
    Added Files:
    src/doors/syncmoo1/build.bat src/doors/syncmoo1/compat/msvc_compat.h strings.h unistd.h src/doors/syncmoo1/deploy.bat syncmoo1_os_win32.c syncmoo1_plat.c syncmoo1_plat.h
    Modified Files:
    src/doors/syncmoo1/.gitignore CLAUDE.md CMakeLists.txt DESIGN.md PROVENANCE.md README.md hw_sbbs.c syncmoo1.h syncmoo1_config.c syncmoo1_door.c syncmoo1_input.c syncmoo1_io.c xtrn/syncmoo1/getdata.js install-xtrn.ini
    Log Message:
    syncmoo1: build on Windows (MSVC, Win32), and hide the door's console

    Add the Windows half of the build. Win32 (x86) is the one supported
    target: a Win32 door runs on both a Win32 and a future Win64 Synchronet
    host (the DOOR32.SYS comm handle is 32-bit-significant and crosses the process-bitness boundary), so one binary covers every Windows BBS, and
    MoO1 through 1oom gains nothing from x64 anyway. build.bat / deploy.bat
    mirror the sibling doors; JPEG-XL comes from the x86-windows-static-md
    vcpkg triplet, absent which the door degrades to the sixel tier.

    All of the door's Windows-vs-POSIX difference is confined to the new syncmoo1_plat.c, implemented over xpdev: the monotonic clock
    (xp_timer64), sleep (SLEEP), and non-blocking descriptor I/O built on sockwrap.h, which normalizes WSAGetLastError() onto the POSIX errno
    values so a single test classifies a failed send()/recv() on both
    platforms. syncmoo1_io.c, _input.c, _door.c and hw_sbbs.c lose their
    direct read/write/fcntl/clock_gettime/gettimeofday/signal calls and
    carry no #ifdef; door.c and config.c move onto xpdev's stricmp() and FULLPATH()/isdir() (MSVC has no realpath()).

    The vendored 1oom/ tree stays byte-identical to upstream. Three MSVC
    gaps are worked around in our own code or build flags, recorded in PROVENANCE.md's new "Deliberate non-patches" section:

    - os/win32/os.c is not compiled. Its os_make_path() calls mkdir()
    with no "already exists" guard (the os/unix sibling guards with
    access()), so it fails on any existing directory and thereby breaks
    cfg_save() AND game saving (game_save.c). 1oom's os/ is a pluggable
    backend directory, so Windows compiles our own syncmoo1_os_win32.c
    against the same os.h contract, delegating to xpdev's recursive
    mkpath().
    - compat/msvc_compat.h is force-included (/FI) to define away the one
    GCC __attribute__((noreturn)) in log.h, which MSVC can't parse.
    - compat/{strings,unistd}.h shim the two POSIX headers the vendored
    util.h / game_save.c include unconditionally.

    install-xtrn.ini gains XTRN_NODISPLAY so no per-session console window
    pops up on a Windows BBS. Shipped together with a durable capture for
    the door's own diagnostics (hangup reason, -home/session errors), which
    a console-less process would otherwise strand: on Windows they are
    freopen()'d to data/syncmoo1/syncmoo1_n<node>.log, unbuffered (_IONBF)
    so sm_door_hangup()'s _exit() can't drop the tail. 1oom's engine log (1oom_log.txt) was already durable; POSIX keeps its inherited stderr.

    README now states plainly that the sysop must purchase a legal MoO1 v1.3
    copy, and links where: GOG's DRM-free "Master of Orion 1+2"
    (recommended -- the LBX files extract straight out) and Steam's
    Collector's Edition. getdata.js's "no data found" message gains the GOG
    link too.

    Verified on Windows (VS2022, Win32/Release, clean build via build.bat):
    the door builds with the JXL tier, all four unit tests pass, and an
    end-to-end run over a real inherited Winsock socket renders a sixel
    frame, decodes a keypress, exits cleanly on ack, and hangs up on peer
    close with the reason captured to the node log. The shared .c files
    changed for both platforms but were compiled under MSVC only -- not yet
    built under GCC/Clang.

    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net