diff options
author | Gennadiy Civil <gennadiycivil@users.noreply.github.com> | 2018-08-20 14:21:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 14:21:32 (GMT) |
commit | c1230dea6b8a9677aaef0cc34d13d6b7a51d9def (patch) | |
tree | 054db67d46b9282759f14f1517e27f3cdc817a59 /googletest | |
parent | a946f7db03fb15fbed6f5f43f78509513bfe6396 (diff) | |
parent | 1778f2091e90c9cf36d0f7c01f3da5dd203db3a4 (diff) | |
download | googletest-c1230dea6b8a9677aaef0cc34d13d6b7a51d9def.zip googletest-c1230dea6b8a9677aaef0cc34d13d6b7a51d9def.tar.gz googletest-c1230dea6b8a9677aaef0cc34d13d6b7a51d9def.tar.bz2 |
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116refs/pull/1120/head
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/src/gtest.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 5de9f27..888ffd1 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -138,6 +138,12 @@ # define vsnprintf _vsnprintf #endif // GTEST_OS_WINDOWS +#if GTEST_OS_MAC +#ifndef GTEST_OS_IOS +#include <crt_externs.h> +#endif +#endif + #if GTEST_HAS_ABSL #include "absl/debugging/failure_signal_handler.h" #include "absl/debugging/stacktrace.h" @@ -5825,6 +5831,17 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) { // other parts of Google Test. void ParseGoogleTestFlagsOnly(int* argc, char** argv) { ParseGoogleTestFlagsOnlyImpl(argc, argv); + + // Fix the value of *_NSGetArgc() on macOS, but iff + // *_NSGetArgv() == argv + // Only applicable to char** version of argv +#if GTEST_OS_MAC +#ifndef GTEST_OS_IOS + if (*_NSGetArgv() == argv) { + *_NSGetArgc() = *argc; + } +#endif +#endif } void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) { ParseGoogleTestFlagsOnlyImpl(argc, argv); |