Ticket #40910: tuple.patch

File tuple.patch, 1.4 KB (added by venabled@…, 11 years ago)

Patch that fixes the tr1/tuple errors from c++11

  • include/gtest/internal/gtest-port.h

    old new  
    221221#define GTEST_OS_AIX 1
    222222#endif  // __CYGWIN__
    223223
     224#if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
     225// Compiling in at least C++11 mode.
     226# define GTEST_LANG_CXX11 1
     227#endif
     228
    224229#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_SYMBIAN || \
    225230    GTEST_OS_SOLARIS || GTEST_OS_AIX
    226231
     
    400405// implementation.  MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
    401406// Feature Pack download, which we cannot assume the user has.
    402407#if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
     408    && !GTEST_OS_QNX && (GTEST_LANG_CXX11 || !defined(_LIBCPP_VERSION)) \
    403409    || _MSC_VER >= 1600
    404410#define GTEST_USE_OWN_TR1_TUPLE 0
    405411#else
     
    415421
    416422#if GTEST_USE_OWN_TR1_TUPLE
    417423#include <gtest/internal/gtest-tuple.h>
     424# elif GTEST_LANG_CXX11
     425#  include <tuple>
     426// C++11 puts its tuple into the ::std namespace rather than
     427// ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
     428namespace std {
     429namespace tr1 {
     430using ::std::get;
     431using ::std::make_tuple;
     432using ::std::tuple;
     433using ::std::tuple_element;
     434using ::std::tuple_size;
     435}
     436}
     437
    418438#elif GTEST_OS_SYMBIAN
    419439
    420440// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to