Skip to content

Commit b644b4f

Browse files
Merge pull request #3866 from eidosmontreal:simplify_shouldusecolor
PiperOrigin-RevId: 454616721 Change-Id: I33b5671646ec027da48cc941baf84b4ddc722e07
2 parents b1f84bf + 3727a90 commit b644b4f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

googletest/include/gtest/internal/gtest-port.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,8 @@ inline int StrCaseCmp(const char* s1, const char* s2) {
19651965
}
19661966
inline char* StrDup(const char* src) { return strdup(src); }
19671967
#else // !__BORLANDC__
1968-
#if GTEST_OS_WINDOWS_MOBILE
1968+
#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
1969+
GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM)
19691970
inline int DoIsATTY(int /* fd */) { return 0; }
19701971
#else
19711972
inline int DoIsATTY(int fd) { return _isatty(fd); }

googletest/src/gtest.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3278,14 +3278,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
32783278
va_list args;
32793279
va_start(args, fmt);
32803280

3281-
#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
3282-
GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM)
3283-
const bool use_color = AlwaysFalse();
3284-
#else
32853281
static const bool in_color_mode =
32863282
ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
32873283
const bool use_color = in_color_mode && (color != GTestColor::kDefault);
3288-
#endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS
32893284

32903285
if (!use_color) {
32913286
vprintf(fmt, args);

0 commit comments

Comments
 (0)