summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorConor Burgess <Burgess.Conor@gmail.com>2017-12-07 11:49:33 (GMT)
committerGitHub <noreply@github.com>2017-12-07 11:49:33 (GMT)
commit4d50715c2bf9c727573a397cfb02bd551d4aa3b0 (patch)
treef932233500e31a61c15ec56c3cc84e50641d802c /googletest
parentad383b274db2696cf2d4bdea9d477c463992f2fc (diff)
downloadgoogletest-4d50715c2bf9c727573a397cfb02bd551d4aa3b0.zip
googletest-4d50715c2bf9c727573a397cfb02bd551d4aa3b0.tar.gz
googletest-4d50715c2bf9c727573a397cfb02bd551d4aa3b0.tar.bz2
Fix location of `_NSGetArgv` correction.
Diffstat (limited to 'googletest')
-rw-r--r--googletest/src/gtest.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 41ed48b..3c94381 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -5347,16 +5347,6 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
}
}
-// Fix the value of *_NSGetArgc() on macOS, but iff
-// *_NSGetArgv() == argv
-#if GTEST_OS_MAC
-# ifndef GTEST_OS_IOS
- if (*_NSGetArgv() == argv) {
- *_NSGetArgc() = *argc;
- }
-# endif
-#endif
-
if (g_help_flag) {
// We print the help here instead of in RUN_ALL_TESTS(), as the
// latter may not be called at all if the user is using Google
@@ -5369,6 +5359,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);