Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
ad383b27
Unverified
Commit
ad383b27
authored
Dec 07, 2017
by
Conor Burgess
Committed by
GitHub
Dec 07, 2017
Browse files
Fix value pointed to by `_NSGetArgc()` on macOS
parent
a868e618
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
googletest/src/gtest.cc
googletest/src/gtest.cc
+16
-0
No files found.
googletest/src/gtest.cc
View file @
ad383b27
...
...
@@ -146,6 +146,12 @@
# define vsnprintf _vsnprintf
#endif // GTEST_OS_WINDOWS
#if GTEST_OS_MAC
# ifndef GTEST_OS_IOS
# include <crt_externs.h>
# endif
#endif
namespace
testing
{
using
internal
::
CountIf
;
...
...
@@ -5341,6 +5347,16 @@ 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment