Commit b644b4fb authored by Copybara-Service's avatar Copybara-Service
Browse files

Merge pull request #3866 from eidosmontreal:simplify_shouldusecolor

PiperOrigin-RevId: 454616721
Change-Id: I33b5671646ec027da48cc941baf84b4ddc722e07
parents b1f84bf1 3727a900
...@@ -1965,7 +1965,8 @@ inline int StrCaseCmp(const char* s1, const char* s2) { ...@@ -1965,7 +1965,8 @@ inline int StrCaseCmp(const char* s1, const char* s2) {
} }
inline char* StrDup(const char* src) { return strdup(src); } inline char* StrDup(const char* src) { return strdup(src); }
#else // !__BORLANDC__ #else // !__BORLANDC__
#if GTEST_OS_WINDOWS_MOBILE #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM)
inline int DoIsATTY(int /* fd */) { return 0; } inline int DoIsATTY(int /* fd */) { return 0; }
#else #else
inline int DoIsATTY(int fd) { return _isatty(fd); } inline int DoIsATTY(int fd) { return _isatty(fd); }
......
...@@ -3278,14 +3278,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) { ...@@ -3278,14 +3278,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM)
const bool use_color = AlwaysFalse();
#else
static const bool in_color_mode = static const bool in_color_mode =
ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0); ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
const bool use_color = in_color_mode && (color != GTestColor::kDefault); const bool use_color = in_color_mode && (color != GTestColor::kDefault);
#endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS
if (!use_color) { if (!use_color) {
vprintf(fmt, args); vprintf(fmt, args);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment