googletest
googletest copied to clipboard
Fix Windows compilation when _CRT_DECLARE_NONSTDC_NAMES=0
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.
Apologies for the force push, I had a mistaken #if instead of #ifdef for one of the guards.