Put wcslen() into ::std namespace on OS/2
OS/2 kLIBC has wcslen(), but it is not in ::std namespace. This fixes the following compilation error. ----- [ 1%] Building CXX object googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o In file included from F:/lang/work/googletest/googletest.git/googletest/src/gtest-all.cc:46:0: F:/lang/work/googletest/googletest.git/googletest/src/gtest-printers.cc: In function 'void testing::internal::PrintTo(const wchar_t*, std::ostream*)': F:/lang/work/googletest/googletest.git/googletest/src/gtest-printers.cc:352:34: error: 'wcslen' is not a member of 'std' PrintCharsAsStringTo(s, std::wcslen(s), os); ^~~~~~ F:/lang/work/googletest/googletest.git/googletest/src/gtest-printers.cc:352:34: note: suggested alternative: In file included from f:/lang/gcc/usr/local730/include/c++/7.3.0/cwchar:44:0, from f:/lang/gcc/usr/local730/include/c++/7.3.0/bits/postypes.h:40, from f:/lang/gcc/usr/local730/include/c++/7.3.0/iosfwd:40, from f:/lang/gcc/usr/local730/include/c++/7.3.0/ios:38, from f:/lang/gcc/usr/local730/include/c++/7.3.0/ostream:38, from F:/lang/work/googletest/googletest.git/googletest/include/gtest/gtest.h:55, from F:/lang/work/googletest/googletest.git/googletest/src/gtest-all.cc:39: f:/lang/gcc/usr/include/wchar.h:153:8: note: 'wcslen' size_t wcslen(const wchar_t *) __pure; ^~~~~~ make.exe[2]: *** [googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1 -----
This commit is contained in:
parent
f32511cc80
commit
9f1116c622
|
@ -402,6 +402,13 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||
# include <strings.h>
|
||||
#endif // GTEST_OS_WINDOWS
|
||||
|
||||
#if GTEST_OS_OS2
|
||||
namespace std {
|
||||
// OS/2 kLIBC has wcslen(), but it is not in ::std namespace.
|
||||
using ::wcslen;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if GTEST_OS_LINUX_ANDROID
|
||||
// Used to define __ANDROID_API__ matching the target NDK API level.
|
||||
# include <android/api-level.h> // NOLINT
|
||||
|
|
Loading…
Reference in New Issue
Block a user