Skip to content

Fix Windows build break in hdf5_utils.cpp by making access() include cross-platform#70

Closed
Copilot wants to merge 2 commits into
developfrom
copilot/fix-hdf5-utils-include-issue
Closed

Fix Windows build break in hdf5_utils.cpp by making access() include cross-platform#70
Copilot wants to merge 2 commits into
developfrom
copilot/fix-hdf5-utils-include-issue

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown

Windows CI fails in src/hdf5/hdf5_utils.cpp because <unistd.h> is POSIX-only and unavailable under MSVC. The file uses access(path, W_OK), so the include and symbols must be mapped to Windows equivalents while preserving current POSIX behavior.

  • What changed

    • Replaced the unconditional POSIX include with a platform-gated include block in src/hdf5/hdf5_utils.cpp.
    • On Windows (_WIN32), include <io.h> and map:
      • access_access
      • W_OK2
    • On non-Windows, continue using <unistd.h> unchanged.
  • Scope

    • No behavioral or logic changes outside this include/macro compatibility block.
    • No changes to errno handling (EAGAIN, EBUSY), which remains provided by <errno.h>.
#ifdef _WIN32
#  include <io.h>       // _access()
#  define access  _access
#  define W_OK    2
#else
#  include <unistd.h>
#endif

Copilot AI changed the title [WIP] Fix unistd.h include issue for Windows CI Fix Windows build break in hdf5_utils.cpp by making access() include cross-platform Jun 19, 2026
Copilot AI requested a review from olivhoenen June 19, 2026 13:59
@olivhoenen

Copy link
Copy Markdown
Collaborator

Added directly in #69 to allow relevant tests

@olivhoenen olivhoenen closed this Jun 20, 2026
@olivhoenen olivhoenen deleted the copilot/fix-hdf5-utils-include-issue branch June 20, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants