Skip to content

Commit a677227

Browse files
Unbreak building gtest with -std=c++11 on Mac OS X 10.6. Also, better support for death tests in iOS simulator.
git-svn-id: http://googletest.googlecode.com/svn/trunk@629 861a406c-534a-0410-8894-cb66d6ee9925
1 parent 03c3149 commit a677227

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

include/gtest/internal/gtest-port.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
// GTEST_OS_LINUX_ANDROID - Google Android
9494
// GTEST_OS_MAC - Mac OS X
9595
// GTEST_OS_IOS - iOS
96+
// GTEST_OS_IOS_SIMULATOR - iOS simulator
9697
// GTEST_OS_NACL - Google Native Client (NaCl)
9798
// GTEST_OS_OPENBSD - OpenBSD
9899
// GTEST_OS_QNX - QNX
@@ -240,7 +241,7 @@
240241
# if TARGET_OS_IPHONE
241242
# define GTEST_OS_IOS 1
242243
# if TARGET_IPHONE_SIMULATOR
243-
# define GEST_OS_IOS_SIMULATOR 1
244+
# define GTEST_OS_IOS_SIMULATOR 1
244245
# endif
245246
# endif
246247
#elif defined __linux__
@@ -517,10 +518,10 @@
517518
# define GTEST_ENV_HAS_TR1_TUPLE_ 1
518519
# endif
519520

520-
// C++11 specifies that <tuple> provides std::tuple. Users can't use
521-
// gtest in C++11 mode until their standard library is at least that
522-
// compliant.
523-
# if GTEST_LANG_CXX11
521+
// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
522+
// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
523+
// can build with clang but need to use gcc4.2's libstdc++).
524+
# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
524525
# define GTEST_ENV_HAS_STD_TUPLE_ 1
525526
# endif
526527

@@ -638,7 +639,7 @@ using ::std::tuple_size;
638639
// abort() in a VC 7.1 application compiled as GUI in debug config
639640
// pops up a dialog window that cannot be suppressed programmatically.
640641
#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
641-
(GTEST_OS_MAC && (!GTEST_OS_IOS || GEST_OS_IOS_SIMULATOR)) || \
642+
(GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
642643
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
643644
GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
644645
GTEST_OS_OPENBSD || GTEST_OS_QNX)

0 commit comments

Comments
 (0)