diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-11-10 18:27:46 +0000 |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-11-10 18:27:46 +0000 |
commit | d2849f573052ba8431a887e0034b1be353a0d9b4 (patch) | |
tree | eaf19543ad06eba0c37e371b56d135d73eeff9f9 /src/gtest-filepath.cc | |
parent | cea25099b5c826e183a56462abc86a8b3b1f9722 (diff) | |
download | googletest-d2849f573052ba8431a887e0034b1be353a0d9b4.tar.gz googletest-d2849f573052ba8431a887e0034b1be353a0d9b4.tar.bz2 googletest-d2849f573052ba8431a887e0034b1be353a0d9b4.zip |
Makes Google Test compile on Solaris and z/OS. By Rainer Klaffenboeck.
Diffstat (limited to 'src/gtest-filepath.cc')
-rw-r--r-- | src/gtest-filepath.cc | 16 |
1 files changed, 13 insertions, 3 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 } |