• src/xpdev/wrapdll.h

    From Deucе@VERT to Git commit to main/sbbs/master on Fri Mar 20 11:13:24 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/ea63a7844ac80992fa6862d8
    Modified Files:
    src/xpdev/wrapdll.h
    Log Message:
    Add ELF visibility("default") attribute to DLLEXPORT on GCC/Clang

    On Windows, DLLEXPORT expands to __declspec(dllexport) or __declspec(dllimport), controlling which symbols are exported from
    DLLs. On non-Windows, it previously expanded to nothing.

    This adds __attribute__((visibility("default"))) for GCC and Clang,
    which is the ELF equivalent of dllexport — it marks a symbol for
    export from shared libraries.

    Currently this is a no-op: ELF defaults to "default" visibility for
    all symbols, so the attribute is redundant. It would only take effect
    if code were compiled with -fvisibility=hidden, which flips the
    default so that only explicitly-marked symbols are exported.

    Unfortunately, -fvisibility=hidden cannot be enabled project-wide
    because the gmake build system shares library CFLAGS variables (XPDEV-MT_CFLAGS, CIOLIB-MT_CFLAGS, etc.) across consumers. Adding
    the flag to any library's CFLAGS bleeds into sbbs3 and other
    projects, hiding symbols that lack DLLEXPORT annotations and breaking
    shared library linking. Scoping it to only shared library targets
    would require separate output directories for objects destined for
    .so files vs static archives — doubling the existing single/multi-
    thread directory split (obj.release, obj.release-mt,
    obj.release-shlib, obj.release-mt-shlib, and again for debug).

    In the meantime, the attribute documents export intent in the source
    and is ready to take effect when visibility control is enabled
    per-target.

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

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