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

[Folly] Disable non-underscore posix names on windows #6974

Merged
merged 1 commit into from
Jun 20, 2019

Conversation

PhoebeHui
Copy link
Contributor

Fix related issue #6670.

Background:
In previous windows sdk verison 10.0.17763.0, we used to do the equivalent of checking for STDC on a per-file basis with:
#define _CRT_INTERNAL_NONSTDC_NAMES
(
( defined _CRT_DECLARE_NONSTDC_NAMES && _CRT_DECLARE_NONSTDC_NAMES) ||
(!defined _CRT_DECLARE_NONSTDC_NAMES && !STDC )
)

Then in individual files, doing
#if _CRT_INTERNAL_NONSTDC_NAMES
// define mktemp, chmod, close, etc
#endif // _CRT_INTERNAL_NONSTDC_NAMES

However, that takes advantage of non-standard preprocessor behavior, in windows sdk 10.0.18362.0 we switched to this:
#if ( defined _CRT_DECLARE_NONSTDC_NAMES && _CRT_DECLARE_NONSTDC_NAMES) ||
(!defined _CRT_DECLARE_NONSTDC_NAMES && !STDC )
#define _CRT_INTERNAL_NONSTDC_NAMES 1
#else
#define _CRT_INTERNAL_NONSTDC_NAMES 0
#endif

So, we’re no longer evaluating STDC on a per-file basis, but on a whole project basis.

@PhoebeHui PhoebeHui added the info:internal This PR or Issue was filed by the vcpkg team. label Jun 20, 2019
@Rastaban Rastaban merged commit 83520db into microsoft:master Jun 20, 2019
@PhoebeHui PhoebeHui deleted the dev/Phoebe/PatchFolly branch August 28, 2019 06:47
@ayermolo
Copy link

@PhoebeHui I am trying to build VS 2017 project that links against folly, and running in to error:
googletest\googletest\include\gtest/internal/gtest-port.h(2025): error C3861: 'chdir': identifier not found.
Because of #define _CRT_INTERNAL_NONSTDC_NAMES 0 in Windows.h.

Anything I am missing?
Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants