Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clar: simplify how we handle stat(3P) on Win32 #105

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Oct 3, 2024

The Windows platform has multiple different definitions for stat(3P) and its struct stat with different integer widths for both the filesize and the timestamps. For our usecase, we really only need to care whether we end up using _stat() or stat(), which require us to use either struct _stat or struct stat, respectively.

The way we handle this in "clar.c" is somewhat convoluted though because we select the function and structure to use independently of each other. This can cause us to pick the wrong combination of features in some environments, like mingw-w64.

Simplify the code such both function and struct get set up under the same condition such that this cannot happen anymore.

The Windows platform has multiple different definitions for stat(3P) and
its `struct stat` with different integer widths for both the filesize
and the timestamps. For our usecase, we really only need to care whether
we end up using `_stat()` or `stat()`, which require us to use either
`struct _stat` or `struct stat`, respectively.

The way we handle this in "clar.c" is somewhat convoluted though because
we select the function and structure to use independently of each other.
This can cause us to pick the wrong combination of features in some
environments, like mingw-w64.

Refactor the code so that both function and struct get set up under the
same condition, thus fixing the issue.
@pks-t pks-t requested a review from ethomson October 3, 2024 10:00
@pks-t pks-t self-assigned this Oct 3, 2024
@ethomson ethomson merged commit f065214 into clar-test:main Oct 3, 2024
5 checks passed
@ethomson
Copy link
Member

ethomson commented Oct 3, 2024

Thanks!

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