| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #ifndef CRASHPAD_UTIL_STDLIB_CXX_H_ | 15 #ifndef CRASHPAD_UTIL_STDLIB_CXX_H_ |
| 16 #define CRASHPAD_UTIL_STDLIB_CXX_H_ | 16 #define CRASHPAD_UTIL_STDLIB_CXX_H_ |
| 17 | 17 |
| 18 #include "build/build_config.h" |
| 19 |
| 20 #if defined(COMPILER_MSVC) |
| 21 |
| 22 #define CXX_LIBRARY_VERSION 2011 |
| 23 #define CXX_LIBRARY_HAS_CONSTEXPR 0 |
| 24 |
| 25 #else // !COMPILER_MSVC |
| 26 |
| 18 // <ciso646> doesn’t do very much, and under libc++, it will cause the | 27 // <ciso646> doesn’t do very much, and under libc++, it will cause the |
| 19 // _LIBCPP_VERSION macro to be defined properly. Under libstdc++, it doesn’t | 28 // _LIBCPP_VERSION macro to be defined properly. Under libstdc++, it doesn’t |
| 20 // cause __GLIBCXX__ to be defined, but if _LIBCPP_VERSION isn’t defined after | 29 // cause __GLIBCXX__ to be defined, but if _LIBCPP_VERSION isn’t defined after |
| 21 // #including <ciso646>, assume libstdc++ and #include libstdc++’s internal | 30 // #including <ciso646>, assume libstdc++ and #include libstdc++’s internal |
| 22 // header that defines __GLIBCXX__. | 31 // header that defines __GLIBCXX__. |
| 23 | 32 |
| 24 #include <ciso646> | 33 #include <ciso646> |
| 25 | 34 |
| 26 #if !defined(_LIBCPP_VERSION) | 35 #if !defined(_LIBCPP_VERSION) |
| 27 #if defined(__has_include) | 36 #if defined(__has_include) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 43 // libc++, identified by _LIBCPP_VERSION, always supports C++11. | 52 // libc++, identified by _LIBCPP_VERSION, always supports C++11. |
| 44 #if __cplusplus >= 201103l && \ | 53 #if __cplusplus >= 201103l && \ |
| 45 ((defined(__GLIBCXX__) && \ | 54 ((defined(__GLIBCXX__) && \ |
| 46 __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \ | 55 __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \ |
| 47 __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \ | 56 __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \ |
| 48 __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \ | 57 __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \ |
| 49 __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \ | 58 __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \ |
| 50 __GLIBCXX__ != 20120702ul) || /* GCC 4.5.4 */ \ | 59 __GLIBCXX__ != 20120702ul) || /* GCC 4.5.4 */ \ |
| 51 (defined(_LIBCPP_VERSION))) | 60 (defined(_LIBCPP_VERSION))) |
| 52 #define CXX_LIBRARY_VERSION 2011 | 61 #define CXX_LIBRARY_VERSION 2011 |
| 62 #define CXX_LIBRARY_HAS_CONSTEXPR 1 |
| 53 #else | 63 #else |
| 54 #define CXX_LIBRARY_VERSION 2003 | 64 #define CXX_LIBRARY_VERSION 2003 |
| 65 #define CXX_LIBRARY_HAS_CONSTEXPR 0 |
| 55 #endif | 66 #endif |
| 56 | 67 |
| 68 #endif // COMPILER_MSVC |
| 69 |
| 57 #endif // CRASHPAD_UTIL_STDLIB_CXX_H_ | 70 #endif // CRASHPAD_UTIL_STDLIB_CXX_H_ |
| OLD | NEW |