| Index: webrtc/base/template_util.h
|
| diff --git a/webrtc/base/template_util.h b/webrtc/base/template_util.h
|
| index 31464cf35db5d4047a7b8d95cb50246b8a23c0df..e416799857a840f9e61ed1b9b4ecc8852456c72c 100644
|
| --- a/webrtc/base/template_util.h
|
| +++ b/webrtc/base/template_util.h
|
| @@ -13,6 +13,7 @@
|
| #ifndef WEBRTC_BASE_TEMPLATE_UTIL_H_
|
| #define WEBRTC_BASE_TEMPLATE_UTIL_H_
|
|
|
| +#include <type_traits> // For is_trivially_destructible
|
| #include <stddef.h> // For size_t.
|
|
|
| namespace rtc {
|
| @@ -122,6 +123,27 @@ struct is_class
|
| sizeof(internal::YesType)> {
|
| };
|
|
|
| +// This hacks around libstdc++ 4.6 missing stuff in type_traits, while we need
|
| +// to support it.
|
| +#define CR_GLIBCXX_4_7_0 20120322
|
| +#define CR_GLIBCXX_4_5_4 20120702
|
| +#define CR_GLIBCXX_4_6_4 20121127
|
| +#if defined(__GLIBCXX__) && \
|
| + (__GLIBCXX__ < CR_GLIBCXX_4_7_0 || __GLIBCXX__ == CR_GLIBCXX_4_5_4 || \
|
| + __GLIBCXX__ == CR_GLIBCXX_4_6_4)
|
| +#define CR_USE_FALLBACKS_FOR_OLD_GLIBCXX
|
| +#endif
|
| +
|
| +// TODO(crbug.com/554293): Remove this when all platforms have this in the std
|
| +// namespace.
|
| +#if defined(CR_USE_FALLBACKS_FOR_OLD_GLIBCXX)
|
| +template <class T>
|
| +using is_trivially_destructible = std::has_trivial_destructor<T>;
|
| +#else
|
| +template <class T>
|
| +using is_trivially_destructible = std::is_trivially_destructible<T>;
|
| +#endif
|
| +
|
| } // namespace rtc
|
|
|
| #endif // WEBRTC_BASE_TEMPLATE_UTIL_H_
|
|
|