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

Fix Windows compilation when _CRT_DECLARE_NONSTDC_NAMES=0 #4571

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mon
Copy link

@mon mon commented Jul 1, 2024

Closes #934 (which was closed due to inactivity, not due to it being fixed).

On Windows, using the POSIX names for some filesystem ops (chdir, fdopen, read, write, close) has been deprecated for some time (potentially as far back as the early to mid 90s).

Of course, Microsoft has kept the old names around for backwards compat for over 25 years. But when the above #define is set, (or when clang-cl is used with a /std: specified, apparently), the names are left undefined, causing compilation failures.

Considering how long the underscored names have been available, I consider this change to have no compatibility concerns.

@mon
Copy link
Author

mon commented Jul 12, 2024

Apologies for the force push, I had a mistaken #if instead of #ifdef for one of the guards.

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.

Doesn't compile with Clang/C2
1 participant