< prev index next >

test/fmw/gtest/include/gtest/internal/gtest-port.h

Print this page
rev 2251 : 8166483: gtest fmw should be updated to support null detection on SS >= 12u4
Reviewed-by: duke


1569   explicit ThreadLocal(const T& value) : value_(value) {}
1570   T* pointer() { return &value_; }
1571   const T* pointer() const { return &value_; }
1572   const T& get() const { return value_; }
1573   void set(const T& value) { value_ = value; }
1574  private:
1575   T value_;
1576 };
1577 
1578 // The above synchronization primitives have dummy implementations.
1579 // Therefore Google Test is not thread-safe.
1580 # define GTEST_IS_THREADSAFE 0
1581 
1582 #endif  // GTEST_HAS_PTHREAD
1583 
1584 // Returns the number of threads running in the process, or 0 to indicate that
1585 // we cannot detect it.
1586 GTEST_API_ size_t GetThreadCount();
1587 
1588 // Passing non-POD classes through ellipsis (...) crashes the ARM
1589 // compiler and generates a warning in Sun Studio.  The Nokia Symbian
1590 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
1591 // for objects passed through ellipsis (...), failing for uncopyable
1592 // objects.  We define this to ensure that only POD is passed through
1593 // ellipsis on these systems.
1594 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)

1595 // We lose support for NULL detection where the compiler doesn't like
1596 // passing non-POD classes through ellipsis (...).
1597 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
1598 #else
1599 # define GTEST_CAN_COMPARE_NULL 1
1600 #endif
1601 
1602 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
1603 // const T& and const T* in a function template.  These compilers
1604 // _can_ decide between class template specializations for T and T*,
1605 // so a tr1::type_traits-like is_pointer works.
1606 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
1607 # define GTEST_NEEDS_IS_POINTER_ 1
1608 #endif
1609 
1610 template <bool bool_value>
1611 struct bool_constant {
1612   typedef bool_constant<bool_value> type;
1613   static const bool value = bool_value;
1614 };




1569   explicit ThreadLocal(const T& value) : value_(value) {}
1570   T* pointer() { return &value_; }
1571   const T* pointer() const { return &value_; }
1572   const T& get() const { return value_; }
1573   void set(const T& value) { value_ = value; }
1574  private:
1575   T value_;
1576 };
1577 
1578 // The above synchronization primitives have dummy implementations.
1579 // Therefore Google Test is not thread-safe.
1580 # define GTEST_IS_THREADSAFE 0
1581 
1582 #endif  // GTEST_HAS_PTHREAD
1583 
1584 // Returns the number of threads running in the process, or 0 to indicate that
1585 // we cannot detect it.
1586 GTEST_API_ size_t GetThreadCount();
1587 
1588 // Passing non-POD classes through ellipsis (...) crashes the ARM
1589 // compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian
1590 // and the IBM XL C/C++ compiler try to instantiate a copy constructor
1591 // for objects passed through ellipsis (...), failing for uncopyable
1592 // objects.  We define this to ensure that only POD is passed through
1593 // ellipsis on these systems.
1594 #if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \
1595      (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)
1596 // We lose support for NULL detection where the compiler doesn't like
1597 // passing non-POD classes through ellipsis (...).
1598 # define GTEST_ELLIPSIS_NEEDS_POD_ 1
1599 #else
1600 # define GTEST_CAN_COMPARE_NULL 1
1601 #endif
1602 
1603 // The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
1604 // const T& and const T* in a function template.  These compilers
1605 // _can_ decide between class template specializations for T and T*,
1606 // so a tr1::type_traits-like is_pointer works.
1607 #if defined(__SYMBIAN32__) || defined(__IBMCPP__)
1608 # define GTEST_NEEDS_IS_POINTER_ 1
1609 #endif
1610 
1611 template <bool bool_value>
1612 struct bool_constant {
1613   typedef bool_constant<bool_value> type;
1614   static const bool value = bool_value;
1615 };


< prev index next >