Skip to content

Documented platform support is wider than what is implemented #33

Description

@skipbit

The platform layer is POSIX-only, but the pages and headers describe Windows and macOS behaviour that does not exist in the code.

What the code does

  • src/platform/path.cpp includes <pwd.h> and <unistd.h>; home() reads $HOME and falls back to getpwuid(getuid()).
  • separator() returns "/" unconditionally.
  • src/platform/xdg.cpp builds Unix dot-directories only: .config, .local/share, .cache, .local/state.

What the documentation says

  • include/dross/platform/path.h:19 — "Cross-platform path handling (Windows, Unix-like systems)"
  • include/dross/platform/path.h:108 — "Windows: %USERPROFILE% or %HOMEDRIVE%%HOMEPATH%"
  • include/dross/platform/path.h:122 — the separator is "'/' on Unix, '\\' on Windows"
  • docs/sphinx/source/api/platform.rst — a "Windows Support" section stating that XDG directories map to appropriate Windows locations, and a macOS note saying ~/Library paths are used for some directories

None of these have an implementation. %APPDATA%, %LOCALAPPDATA% and ~/Library appear nowhere in src/.

Either direction closes it

Narrow the documentation to what is implemented, or implement the mapping. Narrowing is the smaller change and can be done first; the CI has no Windows runner, so a claim about Windows behaviour is currently unverifiable either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions