Skip to content

fix(sqlite-objstore): provide S_ISDIR/S_ISREG macros for MSVC - #26

Merged
gabewillen merged 1 commit into
mainfrom
fix/win32-stat-macros
Aug 18, 2026
Merged

fix(sqlite-objstore): provide S_ISDIR/S_ISREG macros for MSVC#26
gabewillen merged 1 commit into
mainfrom
fix/win32-stat-macros

Conversation

@gabewillen

Copy link
Copy Markdown
Contributor

Round 5 of the Windows port for the npm release of @augmem/cortext v1.3.3
(follow-up to PRs #22-#25). Compile and the cortext.lib name collision are
fixed; both Windows matrix jobs now fail at link with:

unresolved external symbol S_ISREG
unresolved external symbol S_ISDIR

MSVC does not define the POSIX S_ISDIR/S_ISREG macros, so C treated the
identifiers as implicit functions. This adds the standard
((m) & _S_IFMT) == _S_IFDIR/REG definitions to win_posix.h (guarded) and
includes that header from backend_fs_common.c on Windows. No other S_IS*
macros are used in the embedded objstore sources.

Copilot AI lite review requested due to automatic review settings August 18, 2026 02:31
@gabewillen
gabewillen merged commit f22d63f into main Aug 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR unblocks the Windows build/link step for the embedded sqlite-objstore backend by providing missing POSIX-style S_ISDIR / S_ISREG macros for MSVC, which otherwise treats them as implicitly-declared functions and fails at link.

Changes:

  • Add guarded MSVC-compatible definitions for S_ISDIR and S_ISREG in win_posix.h using _S_IFMT / _S_IFDIR / _S_IFREG.
  • Include win_posix.h from backend_fs_common.c on _WIN32 so the directory/file checks in that translation unit compile correctly on MSVC.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
third_party/sqlite-objstore/src/win_posix.h Adds guarded S_ISDIR / S_ISREG macro definitions for Windows/MSVC builds.
third_party/sqlite-objstore/src/backend_fs_common.c Ensures Windows builds include win_posix.h so S_ISDIR use in this TU doesn’t become an unresolved external at link time.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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