summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/__config
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-13 22:05:54 +0000
committerdim <dim@FreeBSD.org>2015-02-13 22:05:54 +0000
commit3678f64ad386927abc67f2fa9c29e9d841865db8 (patch)
tree3f1fe901534b9de961c0c7ea660ae37c69fea14b /contrib/libc++/include/__config
parentd8b2164f70a462483fbb9be8e8edadf15b5c13a3 (diff)
downloadFreeBSD-src-3678f64ad386927abc67f2fa9c29e9d841865db8.zip
FreeBSD-src-3678f64ad386927abc67f2fa9c29e9d841865db8.tar.gz
Synchronize the default C++ stack in stable/10 with head, by merging
almost all recent changes to libc++ and libcxxrt. MFC r256642: Since C++ typeinfo objects are currently not guaranteed to be merged at runtime by the dynamic linker, check for their equality in libcxxrt by not only comparing the typeinfo's name pointers, but also comparing the full names, if necessary. (This is similar to what GNU libstdc++ does in its default configuration.) The 'deep' check can be turned off again by defining LIBCXXRT_MERGED_TYPEINFO, and recompiling libcxxrt. Reviewed by: theraven MFC r270522 (by rdivacky): The standard we compile libc++ with is called c++11 not c++0x. MFC r273066 (by bapt): Import patch from libc++ r197313 which allows using libc++ headers with gcc Differential Revision: https://reviews.freebsd.org/D942 Reviewed by: imp MFC r273381 (by bapt): Add support for __cxa_throw_bad_array_new_length in libcxxrt It is required for use with newer g++49 Differential Revision: https://reviews.freebsd.org/D982 Reviewed by: theraven Approved by: theraven MFC r273382 (by bapt): Fix build by marking the new functions as weak This is a temporary fix MFC r273407 (by bapt): When using an external gcc 4.8+ and not building libstdc++ then create in the objectdir a fake libstdc++.so and libstdc++.a which is a symlink on libc++ that allow g++ to satisfy its links dependencies in the least hackish way. Please note that this hacky libstds++ never get installed on the final system Reviewed by: imp MFC r273434 (by bapt): Do not define bad_array_new_length::bad_array_new_length in libc++ anymore when used in combinaison with libcxxrt since it is now defined there already. This fixes building world MFC r276417: Import libcxxrt master 00bc29eb6513624824a6d7db2ebc768a4216a604. Interesting fixes: 76584a0 Reorganize code to use only 32bit atomic ops for 32bit platforms 30d2ae5 Implement __cxa_throw_bad_array_new_length Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D1390 MFC r277217: Import libc++ trunk r224926. This fixes a number of bugs, completes C++14 support[1], adds more C++1z features[2], and fixes the following LWG issues[3]: 1450: Contradiction in regex_constants 2003: String exception inconsistency in erase. 2075: Progress guarantees, lock-free property, and scheduling assumptions 2104: unique_lock move-assignment should not be noexcept 2112: User-defined classes that cannot be derived from 2132: std::function ambiguity 2135: Unclear requirement for exceptions thrown in condition_variable::wait() 2142: packaged_task::operator() synchronization too broad? 2182: Container::[const_]reference types are misleadingly specified 2186: Incomplete action on async/launch::deferred 2188: Reverse iterator does not fully support targets that overload operator& 2193: Default constructors for standard library containers are explicit 2205: Problematic postconditions of regex_match and regex_search 2213: Return value of std::regex_replace 2240: Probable misuse of term "function scope" in [thread.condition] 2252: Strong guarantee on vector::push_back() still broken with C++11? 2257: Simplify container requirements with the new algorithms 2258: a.erase(q1, q2) unable to directly return q2 2263: Comparing iterators and allocator pointers with different const-character 2268: Setting a default argument in the declaration of a member function assign of std::basic_string 2271: regex_traits::lookup_classname specification unclear 2272: quoted should use char_traits::eq for character comparison 2278: User-defined literals for Standard Library types 2280: begin / end for arrays should be constexpr and noexcept 2285: make_reverse_iterator 2288: Inconsistent requirements for shared mutexes 2291: std::hash is vulnerable to collision DoS attack 2293: Wrong facet used by num_put::do_put 2299: Effects of inaccessible key_compare::is_transparent type are not clear 2301: Why is std::tie not constexpr? 2304: Complexity of count in unordered associative containers 2306: match_results::reference should be value_type&, not const value_type& 2308: Clarify container destructor requirements w.r.t. std::array 2313: tuple_size should always derive from integral_constant<size_t, N> 2314: apply() should return decltype(auto) and use decay_t before tuple_size 2315: weak_ptr should be movable 2316: weak_ptr::lock() should be atomic 2317: The type property queries should be UnaryTypeTraits returning size_t 2320: select_on_container_copy_construction() takes allocators, not containers 2322: Associative(initializer_list, stuff) constructors are underspecified 2323: vector::resize(n, t)'s specification should be simplified 2324: Insert iterator constructors should use addressof() 2329: regex_match()/regex_search() with match_results should forbid temporary strings 2330: regex("meow", regex::icase) is technically forbidden but should be permitted 2332: regex_iterator/regex_token_iterator should forbid temporary regexes 2339: Wording issue in nth_element 2341: Inconsistency between basic_ostream::seekp(pos) and basic_ostream::seekp(off, dir) 2344: quoted()'s interaction with padding is unclear 2346: integral_constant's member functions should be marked noexcept 2350: min, max, and minmax should be constexpr 2356: Stability of erasure in unordered associative containers 2357: Remaining "Assignable" requirement 2359: How does regex_constants::nosubs affect basic_regex::mark_count()? 2360: reverse_iterator::operator*() is unimplementable [1] http://libcxx.llvm.org/cxx1y_status.html [2] http://libcxx.llvm.org/cxx1z_status.html [3] http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html Exp-run: antoine MFC r277944: Partially revert r273382, to reduce diffs against upstream. This was a temporary fix to solve a conflict with an older version of libc++, and it is no longer relevant. MFC r278010: Revert r256642, not only to reduce diffs against upstream libcxxrt, but also because it is the wrong approach: comparing typeinfo names deeply causes trouble if two loaded DSOs use independent types of the same name. In addition, this particular change was never merged to FreeBSD 10.x and 9.x, so let's get rid of it before it ends up in an 11.x release. Discussed with: theraven, joerg@netbsd MFC r278016: Import libcxxrt master 1cb607e89f6135bbc10f3d3b6fba1f983e258dcc. Interesting fixes: 1cb607e Correct gcc version check for __cxa_begin_catch() declaration with or without throw()
Diffstat (limited to 'contrib/libc++/include/__config')
-rw-r--r--contrib/libc++/include/__config162
1 files changed, 138 insertions, 24 deletions
diff --git a/contrib/libc++/include/__config b/contrib/libc++/include/__config
index a8c3498..c5b9a6b 100644
--- a/contrib/libc++/include/__config
+++ b/contrib/libc++/include/__config
@@ -19,6 +19,11 @@
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
#endif
+#if !_WIN32
+#include <unistd.h>
+#include <errno.h> // for ELAST on FreeBSD
+#endif
+
#define _LIBCPP_VERSION 1101
#define _LIBCPP_ABI_VERSION 1
@@ -106,6 +111,13 @@
# endif
#endif // __sun__
+#if defined(__native_client__)
+ // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
+ // including accesses to the special files under /dev. C++11's
+ // std::random_device is instead exposed through a NaCl syscall.
+# define _LIBCPP_USING_NACL_RANDOM
+#endif // defined(__native_client__)
+
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
# include <endian.h>
# if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -194,7 +206,7 @@
#endif
#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
+#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
#endif
#ifndef _LIBCPP_ALWAYS_INLINE
@@ -203,6 +215,11 @@
#if defined(__clang__)
+#if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
+ !defined(__arm__)
+#define _LIBCPP_ALTERNATE_STRING_LAYOUT
+#endif
+
#if __has_feature(cxx_alignas)
# define _ALIGNAS_TYPE(x) alignas(x)
# define _ALIGNAS(x) alignas(x)
@@ -215,14 +232,10 @@
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#endif
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
-#ifdef __linux__
-#define _LIBCPP_HAS_NO_UNICODE_CHARS
-#else
+#if __cplusplus < 201103L
typedef __char16_t char16_t;
typedef __char32_t char32_t;
#endif
-#endif
#if !(__has_feature(cxx_exceptions))
#define _LIBCPP_NO_EXCEPTIONS
@@ -246,6 +259,8 @@ typedef __char32_t char32_t;
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
#endif
+#define _LIBCPP_UNUSED __attribute__((__unused__))
+
#if !(__has_feature(cxx_defaulted_functions))
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#endif // !(__has_feature(cxx_defaulted_functions))
@@ -308,10 +323,16 @@ typedef __char32_t char32_t;
#define _LIBCPP_HAS_NO_CONSTEXPR
#endif
+#if !(__has_feature(cxx_relaxed_constexpr))
+#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#endif
+
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
#if defined(__FreeBSD__)
#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
+#elif defined(__ANDROID__)
+#define _LIBCPP_HAS_QUICK_EXIT
#elif defined(__linux__)
#include <features.h>
#if __GLIBC_PREREQ(2, 15)
@@ -326,13 +347,19 @@ typedef __char32_t char32_t;
#if (__has_feature(cxx_noexcept))
# define _NOEXCEPT noexcept
# define _NOEXCEPT_(x) noexcept(x)
+# define _NOEXCEPT_OR_FALSE(x) noexcept(x)
#else
# define _NOEXCEPT throw()
# define _NOEXCEPT_(x)
+# define _NOEXCEPT_OR_FALSE(x) false
#endif
#if __has_feature(underlying_type)
-# define _LIBCXX_UNDERLYING_TYPE(T) __underlying_type(T)
+# define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
+#endif
+
+#if __has_feature(is_literal)
+# define _LIBCPP_IS_LITERAL(T) __is_literal(T)
#endif
// Inline namespaces are available in Clang regardless of C++ dialect.
@@ -345,6 +372,10 @@ namespace std {
}
}
+#if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
+#define _LIBCPP_HAS_NO_ASAN
+#endif
+
#elif defined(__GNUC__)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
@@ -352,15 +383,33 @@ namespace std {
#define _LIBCPP_NORETURN __attribute__((noreturn))
+#define _LIBCPP_UNUSED __attribute__((__unused__))
+
+#if _GNUC_VER >= 407
+#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
+#define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
+#endif
+
#if !__EXCEPTIONS
#define _LIBCPP_NO_EXCEPTIONS
#endif
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+
+// constexpr was added to GCC in 4.6.
+#if _GNUC_VER < 406
#define _LIBCPP_HAS_NO_CONSTEXPR
+// Can only use constexpr in c++11 mode.
+#elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
+#define _LIBCPP_HAS_NO_CONSTEXPR
+#endif
+
+// No version of GCC supports relaxed constexpr rules
+#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _NOEXCEPT throw()
#define _NOEXCEPT_(x)
+#define _NOEXCEPT_OR_FALSE(x) false
#ifndef __GXX_EXPERIMENTAL_CXX0X__
@@ -374,6 +423,7 @@ namespace std {
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
+#define _LIBCPP_HAS_NO_STRONG_ENUMS
#else // __GXX_EXPERIMENTAL_CXX0X__
@@ -389,9 +439,7 @@ namespace std {
#endif
#if _GNUC_VER < 404
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DECLTYPE
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
@@ -402,6 +450,11 @@ namespace std {
#define _LIBCPP_HAS_NO_NULLPTR
#endif
+#if _GNUC_VER < 407
+#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif
+
#endif // __GXX_EXPERIMENTAL_CXX0X__
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
@@ -414,21 +467,28 @@ namespace _LIBCPP_NAMESPACE {
using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
}
+#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__)
+#define _LIBCPP_HAS_NO_ASAN
+#endif
+
#elif defined(_LIBCPP_MSVC)
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#define _LIBCPP_HAS_NO_CONSTEXPR
+#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#define __alignof__ __alignof
#define _LIBCPP_NORETURN __declspec(noreturn)
+#define _LIBCPP_UNUSED
#define _ALIGNAS(x) __declspec(align(x))
#define _LIBCPP_HAS_NO_VARIADICS
-#define _NOEXCEPT throw()
+#define _NOEXCEPT throw ()
#define _NOEXCEPT_(x)
+#define _NOEXCEPT_OR_FALSE(x) false
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
#define _LIBCPP_END_NAMESPACE_STD }
@@ -438,15 +498,19 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
namespace std {
}
+#define _LIBCPP_HAS_NO_ASAN
+
#elif defined(__IBMCPP__)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
#define _ATTRIBUTE(x) __attribute__((x))
#define _LIBCPP_NORETURN __attribute__((noreturn))
+#define _LIBCPP_UNUSED
#define _NOEXCEPT throw()
#define _NOEXCEPT_(x)
+#define _NOEXCEPT_OR_FALSE(x) false
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
@@ -454,7 +518,6 @@ namespace std {
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#define _LIBCPP_HAS_NO_NULLPTR
#define _LIBCPP_HAS_NO_UNICODE_CHARS
-#define _LIBCPP_HAS_NO_STRONG_ENUMS
#define _LIBCPP_HAS_IS_BASE_OF
#if defined(_AIX)
@@ -470,13 +533,19 @@ namespace std {
}
}
-#endif // __clang__ || __GNUC___ || _MSC_VER || __IBMCPP__
+#define _LIBCPP_HAS_NO_ASAN
+
+#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef unsigned short char16_t;
typedef unsigned int char32_t;
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+#ifndef __SIZEOF_INT128__
+#define _LIBCPP_HAS_NO_INT128
+#endif
+
#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
template <bool> struct __static_assert_test;
@@ -514,12 +583,20 @@ template <unsigned> struct __static_assert_check {};
#define __has_feature(__x) 0
#endif
-#if __has_feature(cxx_explicit_conversions)
+#ifndef __has_builtin
+#define __has_builtin(__x) 0
+#endif
+
+#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
# define _LIBCPP_EXPLICIT explicit
#else
# define _LIBCPP_EXPLICIT
#endif
+#if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
+# define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
+#endif
+
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
@@ -545,16 +622,21 @@ template <unsigned> struct __static_assert_check {};
#endif
#ifndef _LIBCPP_EXTERN_TEMPLATE
-#define _LIBCPP_EXTERN_TEMPLATE(...)
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif
#ifndef _LIBCPP_EXTERN_TEMPLATE2
#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
#endif
+#if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
+#define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63)
+#endif
+
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
+
#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
@@ -567,21 +649,39 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_WCTYPE_IS_MASK
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__)
-#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
-# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0
-#endif
+#if defined(ELAST)
+#define _LIBCPP_ELAST ELAST
+#elif defined(__linux__)
+#define _LIBCPP_ELAST 4095
+#elif defined(_NEWLIB_VERSION)
+#define _LIBCPP_ELAST __ELASTERROR
+#elif defined(__APPLE__)
+// Not _LIBCPP_ELAST needed on Apple
+#elif defined(__sun__)
+#define _LIBCPP_ELAST ESTALE
+#else
+// Warn here so that the person doing the libcxx port has an easier time:
+#warning This platform's ELAST hasn't been ported yet
#endif
#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
-# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
+# if defined(__FreeBSD__)
+// Making the std::pair copy constructor trivial breaks ABI compatibility with
+// earlier versions of libc++ shipped by FreeBSD, so turn it off by default.
+// See also http://svnweb.freebsd.org/changeset/base/261801
+# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0
+# else
+# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
+# endif
#endif
#ifndef _LIBCPP_STD_VER
# if __cplusplus <= 201103L
# define _LIBCPP_STD_VER 11
+# elif __cplusplus <= 201402L
+# define _LIBCPP_STD_VER 14
# else
-# define _LIBCPP_STD_VER 13 // current year, or date of c++14 ratification
+# define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification
# endif
#endif // _LIBCPP_STD_VER
@@ -592,21 +692,30 @@ template <unsigned> struct __static_assert_check {};
#endif
#if _LIBCPP_STD_VER <= 11
-#define _LIBCPP_CONSTEXPR_AFTER_CXX11
#define _LIBCPP_EXPLICIT_AFTER_CXX11
#define _LIBCPP_DEPRECATED_AFTER_CXX11
#else
-#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
#endif
+#if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
+#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
+#else
+#define _LIBCPP_CONSTEXPR_AFTER_CXX11
+#endif
+
+#ifndef _LIBCPP_HAS_NO_ASAN
+extern "C" void __sanitizer_annotate_contiguous_container(
+ const void *, const void *, const void *, const void *);
+#endif
+
// Try to find out if RTTI is disabled.
// g++ and cl.exe have RTTI on by default and define a macro when it is.
// g++ only defines the macro in 4.3.2 and onwards.
#if !defined(_LIBCPP_NO_RTTI)
-# if defined(__GNUG__) && (__GNUC__ >= 4 && \
- (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2)) && !defined(__GXX_RTTI)
+# if defined(__GNUG__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
+ (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
# define _LIBCPP_NO_RTTI
# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
# define _LIBCPP_NO_RTTI
@@ -617,4 +726,9 @@ template <unsigned> struct __static_assert_check {};
# define _LIBCPP_WEAK __attribute__((__weak__))
#endif
+#if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
+# error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
+ _LIBCPP_HAS_NO_THREADS is defined.
+#endif
+
#endif // _LIBCPP_CONFIG
OpenPOWER on IntegriCloud