[llvm] r258190 - Fix undefined behavior in llvm's local changes to googletest.
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 13:22:36 PST 2016
Author: nico
Date: Tue Jan 19 15:22:36 2016
New Revision: 258190
URL: http://llvm.org/viewvc/llvm-project?rev=258190&view=rev
Log:
Fix undefined behavior in llvm's local changes to googletest.
r100895 landed an llvm-only change to add minix support to googletest.
It did that by putting "defined()" in a macro, which has undefined
behavior. Slightly reshuffle things to remove that undefined behavior.
Also mention in README.LLVM that minix support is a local change.
Modified:
llvm/trunk/utils/unittest/googletest/README.LLVM
llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h
Modified: llvm/trunk/utils/unittest/googletest/README.LLVM
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/README.LLVM?rev=258190&r1=258189&r2=258190&view=diff
==============================================================================
--- llvm/trunk/utils/unittest/googletest/README.LLVM (original)
+++ llvm/trunk/utils/unittest/googletest/README.LLVM Tue Jan 19 15:22:36 2016
@@ -17,6 +17,7 @@ $ mv COPYING LICENSE.TXT
Modified as follows:
* Added support for FreeBSD.
+* Added support for Minix (PR6797).
* To GTestStreamToHelper in include/gtest/internal/gtest-internal.h,
added the ability to stream with raw_os_ostream.
* To refresh Haiku support in include/gtest/internal/gtest-port.h,
Modified: llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h?rev=258190&r1=258189&r2=258190&view=diff
==============================================================================
--- llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h (original)
+++ llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h Tue Jan 19 15:22:36 2016
@@ -92,6 +92,7 @@
// GTEST_OS_LINUX - Linux
// GTEST_OS_LINUX_ANDROID - Google Android
// GTEST_OS_MAC - Mac OS X
+// GTEST_OS_MINIX - Minix
// GTEST_OS_NACL - Google Native Client (NaCl)
// GTEST_OS_SOLARIS - Sun Solaris
// GTEST_OS_SYMBIAN - Symbian
@@ -248,6 +249,8 @@
# define GTEST_OS_NACL 1
#elif defined(__HAIKU__)
# define GTEST_OS_HAIKU 1
+#elif defined(_MINIX)
+# define GTEST_OS_MINIX 1
#endif // __CYGWIN__
// Brings in definitions for functions used in the testing::internal::posix
@@ -359,7 +362,7 @@
// no support for it at least as recent as Froyo (2.2).
// Minix currently doesn't support it either.
# define GTEST_HAS_STD_WSTRING \
- (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || GTEST_OS_HAIKU || defined(_MINIX)))
+ (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || GTEST_OS_HAIKU || GTEST_OS_MINIX))
#endif // GTEST_HAS_STD_WSTRING
More information about the llvm-commits
mailing list