OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TEMPLATE_UTIL_H_ | 5 #ifndef BASE_TEMPLATE_UTIL_H_ |
6 #define BASE_TEMPLATE_UTIL_H_ | 6 #define BASE_TEMPLATE_UTIL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <type_traits> | 10 #include <type_traits> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 | 14 |
15 // This hacks around libstdc++ 4.6 missing stuff in type_traits, while we need | 15 // This hacks around libstdc++ 4.6 missing stuff in type_traits, while we need |
16 // to support it. | 16 // to support it. |
17 #define CR_GLIBCXX_4_7_0 20120322 | 17 #define CR_GLIBCXX_4_7_0 20120322 |
18 #define CR_GLIBCXX_4_5_4 20120702 | 18 #define CR_GLIBCXX_4_5_4 20120702 |
19 #define CR_GLIBCXX_4_6_4 20121127 | 19 #define CR_GLIBCXX_4_6_4 20121127 |
20 #if defined(__GLIBCXX__) && \ | 20 #if defined(__GLIBCXX__) && \ |
21 (__GLIBCXX__ < CR_GLIBCXX_4_7_0 || __GLIBCXX__ == CR_GLIBCXX_4_5_4 || \ | 21 (__GLIBCXX__ < CR_GLIBCXX_4_7_0 || __GLIBCXX__ == CR_GLIBCXX_4_5_4 || \ |
22 __GLIBCXX__ == CR_GLIBCXX_4_6_4) | 22 __GLIBCXX__ == CR_GLIBCXX_4_6_4) |
23 #define CR_USE_FALLBACKS_FOR_OLD_GLIBCXX | 23 #define CR_USE_FALLBACKS_FOR_OLD_GLIBCXX |
24 #endif | 24 #endif |
25 | 25 |
26 // Some chromeos bots are using experimental 5.0 for some reason | 26 // Some versions of libstdc++ have partial support for type_traits, but misses |
27 // which has partial support for type_traits, but misses a smaller subset | 27 // a smaller subset while removing some of the older non-standard stuff. |
28 // while removing some of the older non-standard stuff. | 28 #define CR_GLIBCXX_4_8_4 20141219 |
| 29 #define CR_GLIBCXX_4_9_2 20150426 |
29 #define CR_GLIBCXX_5_0_0 20150123 | 30 #define CR_GLIBCXX_5_0_0 20150123 |
30 #if defined(__GLIBCXX__) && (__GLIBCXX__ == CR_GLIBCXX_5_0_0) | 31 #if defined(__GLIBCXX__) && \ |
| 32 (__GLIBCXX__ == CR_GLIBCXX_4_8_4 || __GLIBCXX__ == CR_GLIBCXX_4_9_2 || \ |
| 33 __GLIBCXX__ == CR_GLIBCXX_5_0_0) |
31 #define CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX | 34 #define CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX |
32 #endif | 35 #endif |
33 | 36 |
34 // This hacks around using gcc with libc++ which has some incompatibilies. | 37 // This hacks around using gcc with libc++ which has some incompatibilies. |
35 // - is_trivially_* doesn't work: https://llvm.org/bugs/show_bug.cgi?id=27538 | 38 // - is_trivially_* doesn't work: https://llvm.org/bugs/show_bug.cgi?id=27538 |
36 // TODO(danakj): Remove this when android builders are all using a newer version | 39 // TODO(danakj): Remove this when android builders are all using a newer version |
37 // of gcc, or the android ndk is updated to a newer libc++ that works with older | 40 // of gcc, or the android ndk is updated to a newer libc++ that works with older |
38 // gcc versions. | 41 // gcc versions. |
39 #if !defined(__clang__) && defined(_LIBCPP_VERSION) | 42 #if !defined(__clang__) && defined(_LIBCPP_VERSION) |
40 #define CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX | 43 #define CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 using is_trivially_copyable = std::is_trivially_copyable<T>; | 189 using is_trivially_copyable = std::is_trivially_copyable<T>; |
187 #endif | 190 #endif |
188 | 191 |
189 } // namespace base | 192 } // namespace base |
190 | 193 |
191 #undef CR_USE_FALLBACKS_FOR_OLD_GLIBCXX | 194 #undef CR_USE_FALLBACKS_FOR_OLD_GLIBCXX |
192 #undef CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX | 195 #undef CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX |
193 #undef CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX | 196 #undef CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX |
194 | 197 |
195 #endif // BASE_TEMPLATE_UTIL_H_ | 198 #endif // BASE_TEMPLATE_UTIL_H_ |
OLD | NEW |