diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gtest-filepath.cc | 16 | ||||
-rw-r--r-- | src/gtest.cc | 6 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/gtest-filepath.cc b/src/gtest-filepath.cc index fc4b7873..640c27c3 100644 --- a/src/gtest-filepath.cc +++ b/src/gtest-filepath.cc @@ -48,7 +48,17 @@ #include <limits.h> #include <sys/stat.h> #include <unistd.h> -#endif // _WIN32_WCE or _WIN32 +#endif // _WIN32_WCE or _WIN32 + +#ifdef GTEST_OS_WINDOWS +#define GTEST_PATH_MAX_ _MAX_PATH +#elif defined(PATH_MAX) +#define GTEST_PATH_MAX_ PATH_MAX +#elif defined(_XOPEN_PATH_MAX) +#define GTEST_PATH_MAX_ _XOPEN_PATH_MAX +#else +#define GTEST_PATH_MAX_ _POSIX_PATH_MAX +#endif // GTEST_OS_WINDOWS #include <gtest/internal/gtest-string.h> @@ -81,10 +91,10 @@ FilePath FilePath::GetCurrentDir() { // something reasonable. return FilePath(kCurrentDirectoryString); #elif defined(GTEST_OS_WINDOWS) - char cwd[_MAX_PATH + 1] = {}; + char cwd[GTEST_PATH_MAX_ + 1] = {}; return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd); #else - char cwd[PATH_MAX + 1] = {}; + char cwd[GTEST_PATH_MAX_ + 1] = {}; return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd); #endif } diff --git a/src/gtest.cc b/src/gtest.cc index 9cc50e05..b5c3d077 100644 --- a/src/gtest.cc +++ b/src/gtest.cc @@ -65,6 +65,10 @@ #define GTEST_HAS_GETTIMEOFDAY #include <sys/time.h> // NOLINT +#elif defined(GTEST_OS_ZOS) +// On z/OS we additionally need strings.h for strcasecmp. +#include <strings.h> + #elif defined(_WIN32_WCE) // We are on Windows CE. #include <windows.h> // NOLINT @@ -2445,7 +2449,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) { va_list args; va_start(args, fmt); -#if defined(_WIN32_WCE) || defined(GTEST_OS_SYMBIAN) +#if defined(_WIN32_WCE) || defined(GTEST_OS_SYMBIAN) || defined(GTEST_OS_ZOS) static const bool use_color = false; #else static const bool use_color = ShouldUseColor(isatty(fileno(stdout)) != 0); |