Googletest export
Remove the #ifs for old, unsupported and buggy compilers: * old versions of GCC & MSVC * Symbian PiperOrigin-RevId: 227116941
This commit is contained in:
		
				
					committed by
					
						
						Gennadiy Civil
					
				
			
			
				
	
			
			
			
						parent
						
							933e5df283
						
					
				
				
					commit
					f8b1c1af17
				
			@@ -43,6 +43,7 @@
 | 
			
		||||
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
 | 
			
		||||
 | 
			
		||||
#include "gmock/internal/gmock-port.h"
 | 
			
		||||
#include "gtest/gtest.h"
 | 
			
		||||
 | 
			
		||||
namespace testing {
 | 
			
		||||
 | 
			
		||||
@@ -51,19 +52,6 @@ class Matcher;
 | 
			
		||||
 | 
			
		||||
namespace internal {
 | 
			
		||||
 | 
			
		||||
// An IgnoredValue object can be implicitly constructed from ANY value.
 | 
			
		||||
// This is used in implementing the IgnoreResult(a) action.
 | 
			
		||||
class IgnoredValue {
 | 
			
		||||
 public:
 | 
			
		||||
  // This constructor template allows any value to be implicitly
 | 
			
		||||
  // converted to IgnoredValue.  The object has no data member and
 | 
			
		||||
  // doesn't try to remember anything about the argument.  We
 | 
			
		||||
  // deliberately omit the 'explicit' keyword in order to allow the
 | 
			
		||||
  // conversion to be implicit.
 | 
			
		||||
  template <typename T>
 | 
			
		||||
  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// MatcherTuple<T>::type is a tuple type where each field is a Matcher
 | 
			
		||||
// for the corresponding field in tuple type T.
 | 
			
		||||
template <typename Tuple>
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,7 @@ $var n = 10  $$ The maximum arity we support.
 | 
			
		||||
#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
 | 
			
		||||
 | 
			
		||||
#include "gmock/internal/gmock-port.h"
 | 
			
		||||
#include "gtest/gtest.h"
 | 
			
		||||
 | 
			
		||||
namespace testing {
 | 
			
		||||
 | 
			
		||||
@@ -52,19 +53,6 @@ class Matcher;
 | 
			
		||||
 | 
			
		||||
namespace internal {
 | 
			
		||||
 | 
			
		||||
// An IgnoredValue object can be implicitly constructed from ANY value.
 | 
			
		||||
// This is used in implementing the IgnoreResult(a) action.
 | 
			
		||||
class IgnoredValue {
 | 
			
		||||
 public:
 | 
			
		||||
  // This constructor template allows any value to be implicitly
 | 
			
		||||
  // converted to IgnoredValue.  The object has no data member and
 | 
			
		||||
  // doesn't try to remember anything about the argument.  We
 | 
			
		||||
  // deliberately omit the 'explicit' keyword in order to allow the
 | 
			
		||||
  // conversion to be implicit.
 | 
			
		||||
  template <typename T>
 | 
			
		||||
  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// MatcherTuple<T>::type is a tuple type where each field is a Matcher
 | 
			
		||||
// for the corresponding field in tuple type T.
 | 
			
		||||
template <typename Tuple>
 | 
			
		||||
 
 | 
			
		||||
@@ -92,16 +92,11 @@ inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
 | 
			
		||||
template <typename Element>
 | 
			
		||||
inline Element* GetRawPointer(Element* p) { return p; }
 | 
			
		||||
 | 
			
		||||
// Symbian compilation can be done with wchar_t being either a native
 | 
			
		||||
// type or a typedef.  Using Google Mock with OpenC without wchar_t
 | 
			
		||||
// should require the definition of _STLP_NO_WCHAR_T.
 | 
			
		||||
//
 | 
			
		||||
// MSVC treats wchar_t as a native type usually, but treats it as the
 | 
			
		||||
// same as unsigned short when the compiler option /Zc:wchar_t- is
 | 
			
		||||
// specified.  It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
 | 
			
		||||
// is a native type.
 | 
			
		||||
#if (GTEST_OS_SYMBIAN && defined(_STLP_NO_WCHAR_T)) || \
 | 
			
		||||
    (defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED))
 | 
			
		||||
#if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
 | 
			
		||||
// wchar_t is a typedef.
 | 
			
		||||
#else
 | 
			
		||||
# define GMOCK_WCHAR_T_IS_NATIVE_ 1
 | 
			
		||||
@@ -452,32 +447,10 @@ class StlContainerView<Element[N]> {
 | 
			
		||||
  static const_reference ConstReference(const Element (&array)[N]) {
 | 
			
		||||
    // Ensures that Element is not a const type.
 | 
			
		||||
    testing::StaticAssertTypeEq<Element, RawElement>();
 | 
			
		||||
#if GTEST_OS_SYMBIAN
 | 
			
		||||
    // The Nokia Symbian compiler confuses itself in template instantiation
 | 
			
		||||
    // for this call without the cast to Element*:
 | 
			
		||||
    // function call '[testing::internal::NativeArray<char *>].NativeArray(
 | 
			
		||||
    //     {lval} const char *[4], long, testing::internal::RelationToSource)'
 | 
			
		||||
    //     does not match
 | 
			
		||||
    // 'testing::internal::NativeArray<char *>::NativeArray(
 | 
			
		||||
    //     char *const *, unsigned int, testing::internal::RelationToSource)'
 | 
			
		||||
    // (instantiating: 'testing::internal::ContainsMatcherImpl
 | 
			
		||||
    //     <const char * (&)[4]>::Matches(const char * (&)[4]) const')
 | 
			
		||||
    // (instantiating: 'testing::internal::StlContainerView<char *[4]>::
 | 
			
		||||
    //     ConstReference(const char * (&)[4])')
 | 
			
		||||
    // (and though the N parameter type is mismatched in the above explicit
 | 
			
		||||
    // conversion of it doesn't help - only the conversion of the array).
 | 
			
		||||
    return type(const_cast<Element*>(&array[0]), N,
 | 
			
		||||
                RelationToSourceReference());
 | 
			
		||||
#else
 | 
			
		||||
    return type(array, N, RelationToSourceReference());
 | 
			
		||||
#endif  // GTEST_OS_SYMBIAN
 | 
			
		||||
  }
 | 
			
		||||
  static type Copy(const Element (&array)[N]) {
 | 
			
		||||
#if GTEST_OS_SYMBIAN
 | 
			
		||||
    return type(const_cast<Element*>(&array[0]), N, RelationToSourceCopy());
 | 
			
		||||
#else
 | 
			
		||||
    return type(array, N, RelationToSourceCopy());
 | 
			
		||||
#endif  // GTEST_OS_SYMBIAN
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user