Skip to content

fix, H5Qall.hpp MSVC __cplusplus and Apple Clang stop_token availability #209

@steven-varga

Description

@steven-varga

Problem

Two platform-specific build failures on staging, both rooted in H5Qall.hpp being included unconditionally in h5cpp/core:

MSVC — fires the `#error "H5Qall.hpp requires C++20 or later"` guard even though CMakeLists sets C++20. Root cause: without `/Zc:__cplusplus`, MSVC always reports `__cplusplus = 199711L` regardless of the actual language standard. The guard sees a C++98 value and errors out.

Apple Clang (macOS 15) — `no type named 'stop_token' in namespace 'std'` at H5Qall.hpp:216. Root cause: Apple's libc++ gates `std::stop_token` (and the rest of `<stop_token>`) behind `MACOSX_DEPLOYMENT_TARGET >= 13.0` via an availability macro. The CI runner doesn't set a deployment target, so the header's content is suppressed.

Fix

  • CMakeLists.txt: add `/Zc:__cplusplus` to MSVC interface compile options so `__cplusplus` reflects the actual standard.
  • CMakeLists.txt: set `CMAKE_OSX_DEPLOYMENT_TARGET "13.0"` before the `project()` call so Apple's jthread/stop_token availability guard is satisfied.

Observed

CI run 25950680215 on staging — jobs `windows-latest / msvc` and `macos-15 / apple-clang` both fail at the Build step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions