From 08e17472e4d5434b668dd4c63e3fa5f4b45337b9 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 17 Oct 2011 20:05:10 +0000 Subject: [PATCH] Windows support by Ruben Van Boxem. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142235 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__bit_reference | 2 + include/__config | 99 ++++++++++++++++++++++++++++++-------- include/__functional_03 | 2 + include/__functional_base | 2 + include/__hash_table | 2 + include/__locale | 2 + include/__mutex_base | 2 + include/__split_buffer | 2 + include/__sso_allocator | 2 + include/__std_stream | 2 + include/__tree | 2 + include/__tuple | 2 + include/__tuple_03 | 2 + include/algorithm | 2 + include/array | 2 + include/atomic | 2 + include/bitset | 2 + include/cassert | 2 + include/ccomplex | 2 + include/cctype | 2 + include/cerrno | 2 + include/cfenv | 2 + include/cfloat | 2 + include/chrono | 2 + include/cinttypes | 2 + include/ciso646 | 2 + include/climits | 2 + include/clocale | 2 + include/cmath | 2 + include/codecvt | 2 + include/complex | 2 + include/complex.h | 2 + include/condition_variable | 2 + include/csetjmp | 2 + include/csignal | 2 + include/cstdarg | 2 + include/cstdbool | 2 + include/cstddef | 2 + include/cstdint | 2 + include/cstdio | 2 + include/cstdlib | 2 + include/cstring | 2 + include/ctgmath | 2 + include/ctime | 2 + include/cwchar | 2 + include/cwctype | 2 + include/deque | 2 + include/exception | 2 + include/forward_list | 2 + include/fstream | 2 + include/functional | 2 + include/future | 2 + include/initializer_list | 2 + include/iomanip | 2 + include/ios | 2 + include/iosfwd | 2 + include/iostream | 2 + include/istream | 2 + include/iterator | 2 + include/limits | 2 + include/list | 2 + include/locale | 2 + include/map | 2 + include/memory | 2 + include/mutex | 2 + include/new | 2 + include/numeric | 2 + include/ostream | 2 + include/queue | 2 + include/random | 2 + include/ratio | 2 + include/regex | 2 + include/scoped_allocator | 2 + include/set | 2 + include/sstream | 2 + include/stack | 2 + include/stdexcept | 2 + include/streambuf | 2 + include/string | 2 + include/strstream | 2 + include/system_error | 2 + include/tgmath.h | 2 + include/thread | 2 + include/tuple | 2 + include/type_traits | 15 ++++-- include/typeindex | 2 + include/typeinfo | 2 + include/unordered_map | 2 + include/unordered_set | 2 + include/utility | 2 + include/valarray | 2 + include/vector | 2 + www/results.Windows.html | 32 ++++++------ 93 files changed, 286 insertions(+), 40 deletions(-) diff --git a/include/__bit_reference b/include/__bit_reference index 53d3c860..fa381bb4 100644 --- a/include/__bit_reference +++ b/include/__bit_reference @@ -14,7 +14,9 @@ #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__config b/include/__config index a6f81dbc..35a16636 100644 --- a/include/__config +++ b/include/__config @@ -11,7 +11,9 @@ #ifndef _LIBCPP_CONFIG #define _LIBCPP_CONFIG +#if !_MSC_VER // explicit macro necessary because it is only defined below in this file #pragma GCC system_header +#endif #define _LIBCPP_VERSION 1001 @@ -69,17 +71,45 @@ # endif #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) -#ifndef _LIBCPP_VISIBILITY_TAG -#define _LIBCPP_VISIBILITY_TAG 1 +#if _WIN32 + +// only really useful for a DLL +#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally... +# ifdef cxx_EXPORTS +# define _LIBCPP_HIDDEN +# define _LIBCPP_VISIBLE __declspec(dllexport) +# else +# define _LIBCPP_HIDDEN +# define _LIBCPP_VISIBLE __declspec(dllimport) +# endif +#else +# define _LIBCPP_HIDDEN +# define _LIBCPP_VISIBLE #endif -#if _LIBCPP_VISIBILITY_TAG +#ifndef _LIBCPP_INLINE_VISIBILITY +#define _LIBCPP_INLINE_VISIBILITY __forceinline +#endif + +#ifndef _LIBCPP_EXCEPTION_ABI +#define _LIBCPP_EXCEPTION_ABI _LIBCPP_VISIBLE +#endif + +#ifndef _LIBCPP_ALWAYS_INLINE +# if _MSC_VER +# define _LIBCPP_ALWAYS_INLINE __forceinline +# endif +#endif + +#endif // _WIN32 + +#ifndef _LIBCPP_HIDDEN #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) +#endif + +#ifndef _LIBCPP_VISIBLE #define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default"))) -#else // _LIBCPP_VISIBILITY_TAG -#define _LIBCPP_HIDDEN -#define _LIBCPP_VISIBLE -#endif // _LIBCPP_VISIBILITY_TAG +#endif #ifndef _LIBCPP_INLINE_VISIBILITY #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) @@ -89,12 +119,22 @@ #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) #endif +#ifndef _LIBCPP_CANTTHROW #define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__)) +#endif +#ifndef _LIBCPP_ALWAYS_INLINE #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__)) +#endif #if defined(__clang__) +#if __has_feature(cxx_alignas) +# define _ALIGNAS(x) alignas(x) +#else +# define _ALIGNAS(x) __attribute__((__aligned__(x))) +#endif + #if !__has_feature(cxx_alias_templates) #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES #endif @@ -181,16 +221,6 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_OBJC_ARC_WEAK #endif -// Inline namespaces are available in Clang regardless of C++ dialect. -#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { -#define _LIBCPP_END_NAMESPACE_STD } } -#define _VSTD std::_LIBCPP_NAMESPACE - -namespace std { - inline namespace _LIBCPP_NAMESPACE { - } -} - #if !(__has_feature(cxx_constexpr)) #define _LIBCPP_HAS_NO_CONSTEXPR #endif @@ -207,10 +237,20 @@ namespace std { # define _LIBCXX_UNDERLYING_TYPE(T) __underlying_type(T) #endif -// end defined(__clang__) +// Inline namespaces are available in Clang regardless of C++ dialect. +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { +#define _LIBCPP_END_NAMESPACE_STD } } +#define _VSTD std::_LIBCPP_NAMESPACE + +namespace std { + inline namespace _LIBCPP_NAMESPACE { + } +} #elif defined(__GNUC__) +#define _ALIGNAS(x) __attribute__((__aligned__(x))) + #define _ATTRIBUTE(x) __attribute__((x)) #if !__EXCEPTIONS @@ -275,7 +315,28 @@ namespace _LIBCPP_NAMESPACE { using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); } -#endif // defined(__GNUC__) +#elif defined(_MSC_VER) + +#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER +#define _LIBCPP_HAS_NO_CONSTEXPR +#define _LIBCPP_HAS_NO_UNICODE_CHARS +#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#define __alignof__ __alignof +#define _ATTRIBUTE __declspec +#define _ALIGNAS(x) __declspec(align(x)) +#define _LIBCPP_HAS_NO_VARIADICS + +#define _NOEXCEPT throw() +#define _NOEXCEPT_(x) + +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { +#define _LIBCPP_END_NAMESPACE_STD } +#define _VSTD std + +namespace std { +} + +#endif // __clang__ || __GNUC___ || _MSC_VER #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS typedef unsigned short char16_t; diff --git a/include/__functional_03 b/include/__functional_03 index e48bb685..5d30ce2b 100644 --- a/include/__functional_03 +++ b/include/__functional_03 @@ -13,7 +13,9 @@ // manual variadic expansion for +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif template class __mem_fn diff --git a/include/__functional_base b/include/__functional_base index 441ab4f5..8d8e4b5e 100644 --- a/include/__functional_base +++ b/include/__functional_base @@ -16,7 +16,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__hash_table b/include/__hash_table index f9578fa2..4399caad 100644 --- a/include/__hash_table +++ b/include/__hash_table @@ -18,7 +18,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__locale b/include/__locale index a161af90..28cb3ef6 100644 --- a/include/__locale +++ b/include/__locale @@ -25,7 +25,9 @@ # include #endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD_ +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__mutex_base b/include/__mutex_base index 9e472fcc..55687659 100644 --- a/include/__mutex_base +++ b/include/__mutex_base @@ -16,7 +16,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #ifdef _LIBCPP_SHARED_LOCK diff --git a/include/__split_buffer b/include/__split_buffer index d5b8f0a3..33ce42da 100644 --- a/include/__split_buffer +++ b/include/__split_buffer @@ -6,7 +6,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__sso_allocator b/include/__sso_allocator index d25fc484..16354d83 100644 --- a/include/__sso_allocator +++ b/include/__sso_allocator @@ -15,7 +15,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__std_stream b/include/__std_stream index 6ab0fd60..6df6556d 100644 --- a/include/__std_stream +++ b/include/__std_stream @@ -17,7 +17,9 @@ #include <__locale> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__tree b/include/__tree index 6c4b6e60..ad5d2f4b 100644 --- a/include/__tree +++ b/include/__tree @@ -17,7 +17,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/__tuple b/include/__tuple index 918656ed..15193b4d 100644 --- a/include/__tuple +++ b/include/__tuple @@ -15,7 +15,9 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #ifdef _LIBCPP_HAS_NO_VARIADICS diff --git a/include/__tuple_03 b/include/__tuple_03 index 61049191..a28ac080 100644 --- a/include/__tuple_03 +++ b/include/__tuple_03 @@ -13,7 +13,9 @@ #include <__config> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/algorithm b/include/algorithm index d6906a20..3a47b8d6 100644 --- a/include/algorithm +++ b/include/algorithm @@ -595,7 +595,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/array b/include/array index 3ac4c55b..c11f4bd7 100644 --- a/include/array +++ b/include/array @@ -111,7 +111,9 @@ template T&& get(array&&) noexcept; #include #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/atomic b/include/atomic index 31385a23..244f42d0 100644 --- a/include/atomic +++ b/include/atomic @@ -526,7 +526,9 @@ void atomic_signal_fence(memory_order m); #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/bitset b/include/bitset index 4d9efd93..c970f329 100644 --- a/include/bitset +++ b/include/bitset @@ -113,7 +113,9 @@ template struct hash>; */ +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #include <__config> #include <__bit_reference> diff --git a/include/cassert b/include/cassert index 7337b16e..37759906 100644 --- a/include/cassert +++ b/include/cassert @@ -20,4 +20,6 @@ Macros: #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif diff --git a/include/ccomplex b/include/ccomplex index 0e999a92..6ed11644 100644 --- a/include/ccomplex +++ b/include/ccomplex @@ -20,7 +20,9 @@ #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif // hh 080623 Created diff --git a/include/cctype b/include/cctype index dbdc3e76..5ef32a48 100644 --- a/include/cctype +++ b/include/cctype @@ -38,7 +38,9 @@ int toupper(int c); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cerrno b/include/cerrno index 71084a14..9804e4e3 100644 --- a/include/cerrno +++ b/include/cerrno @@ -26,7 +26,9 @@ Macros: #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) diff --git a/include/cfenv b/include/cfenv index cd86b882..dd7db37f 100644 --- a/include/cfenv +++ b/include/cfenv @@ -56,7 +56,9 @@ int feupdateenv(const fenv_t* envp); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cfloat b/include/cfloat index f0079c23..5fa56550 100644 --- a/include/cfloat +++ b/include/cfloat @@ -63,7 +63,9 @@ Macros: #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #ifndef FLT_EVAL_METHOD #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ diff --git a/include/chrono b/include/chrono index a6cd1945..1c79f4bb 100644 --- a/include/chrono +++ b/include/chrono @@ -255,7 +255,9 @@ typedef steady_clock high_resolution_clock; #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cinttypes b/include/cinttypes index ddf20e89..786692b8 100644 --- a/include/cinttypes +++ b/include/cinttypes @@ -239,7 +239,9 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/ciso646 b/include/ciso646 index 38b3e942..b2efc72a 100644 --- a/include/ciso646 +++ b/include/ciso646 @@ -18,6 +18,8 @@ #include <__config> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #endif // _LIBCPP_CISO646 diff --git a/include/climits b/include/climits index c82becdc..81ffecdf 100644 --- a/include/climits +++ b/include/climits @@ -41,6 +41,8 @@ Macros: #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #endif // _LIBCPP_CLIMITS diff --git a/include/clocale b/include/clocale index 6982f84e..f8b8f0dd 100644 --- a/include/clocale +++ b/include/clocale @@ -38,7 +38,9 @@ lconv* localeconv(); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cmath b/include/cmath index f8bc0dfc..bc3151ba 100644 --- a/include/cmath +++ b/include/cmath @@ -301,7 +301,9 @@ long double truncl(long double x); #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif // signbit diff --git a/include/codecvt b/include/codecvt index 86fdc727..6c44e343 100644 --- a/include/codecvt +++ b/include/codecvt @@ -55,7 +55,9 @@ class codecvt_utf8_utf16 #include <__config> #include <__locale> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/complex b/include/complex index f91b2404..e7f63eac 100644 --- a/include/complex +++ b/include/complex @@ -249,7 +249,9 @@ template #include #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/complex.h b/include/complex.h index e04b2e3e..7003d31a 100644 --- a/include/complex.h +++ b/include/complex.h @@ -28,6 +28,8 @@ #endif // __cplusplus +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #endif // _LIBCPP_COMPLEX_H diff --git a/include/condition_variable b/include/condition_variable index fc3ac3df..b4da556f 100644 --- a/include/condition_variable +++ b/include/condition_variable @@ -111,7 +111,9 @@ public: #include <__mutex_base> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/csetjmp b/include/csetjmp index 2b8b81f9..d0b2c078 100644 --- a/include/csetjmp +++ b/include/csetjmp @@ -34,7 +34,9 @@ void longjmp(jmp_buf env, int val); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #ifndef setjmp #define setjmp(env) setjmp(env) diff --git a/include/csignal b/include/csignal index 93adc599..97282661 100644 --- a/include/csignal +++ b/include/csignal @@ -43,7 +43,9 @@ int raise(int sig); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cstdarg b/include/cstdarg index dbd73cb3..c8b69992 100644 --- a/include/cstdarg +++ b/include/cstdarg @@ -35,7 +35,9 @@ Types: #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cstdbool b/include/cstdbool index 76761fb3..2c764a61 100644 --- a/include/cstdbool +++ b/include/cstdbool @@ -22,7 +22,9 @@ Macros: #include <__config> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #undef __bool_true_false_are_defined #define __bool_true_false_are_defined 1 diff --git a/include/cstddef b/include/cstddef index b851ea00..48317ba0 100644 --- a/include/cstddef +++ b/include/cstddef @@ -43,7 +43,9 @@ Types: #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cstdint b/include/cstdint index 0ded1f16..7a187d3e 100644 --- a/include/cstdint +++ b/include/cstdint @@ -144,7 +144,9 @@ Types: #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cstdio b/include/cstdio index 9af0ed5e..aa891742 100644 --- a/include/cstdio +++ b/include/cstdio @@ -99,7 +99,9 @@ void perror(const char* s); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cstdlib b/include/cstdlib index 26c27ffd..e8726cf6 100644 --- a/include/cstdlib +++ b/include/cstdlib @@ -82,7 +82,9 @@ size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cstring b/include/cstring index 6d2e507c..1a230559 100644 --- a/include/cstring +++ b/include/cstring @@ -60,7 +60,9 @@ size_t strlen(const char* s); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/ctgmath b/include/ctgmath index 9044c6ad..535eb7dc 100644 --- a/include/ctgmath +++ b/include/ctgmath @@ -22,6 +22,8 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #endif // _LIBCPP_CTGMATH diff --git a/include/ctime b/include/ctime index 2cef9585..fc4eb26f 100644 --- a/include/ctime +++ b/include/ctime @@ -47,7 +47,9 @@ size_t strftime(char* restrict s, size_t maxsize, const char* restrict format, #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cwchar b/include/cwchar index 0a67fe8b..6fe48522 100644 --- a/include/cwchar +++ b/include/cwchar @@ -110,7 +110,9 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, #include // pull in *swprintf defines #endif // _WIN32 +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/cwctype b/include/cwctype index f2f4470a..4f89b52d 100644 --- a/include/cwctype +++ b/include/cwctype @@ -54,7 +54,9 @@ wctrans_t wctrans(const char* property); #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/deque b/include/deque index 87cbe599..ab9ba58b 100644 --- a/include/deque +++ b/include/deque @@ -150,7 +150,9 @@ template */ +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #include <__config> #include <__split_buffer> diff --git a/include/exception b/include/exception index f418575c..0a747f50 100644 --- a/include/exception +++ b/include/exception @@ -80,7 +80,9 @@ template void rethrow_if_nested(const E& e); #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif namespace std // purposefully not using versioning namespace { diff --git a/include/forward_list b/include/forward_list index 0dd6bb24..61fe290d 100644 --- a/include/forward_list +++ b/include/forward_list @@ -174,7 +174,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/fstream b/include/fstream index 7034aab1..b6a2ab0e 100644 --- a/include/fstream +++ b/include/fstream @@ -171,7 +171,9 @@ typedef basic_fstream wfstream; #include <__locale> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/functional b/include/functional index 6db7ac48..59b132c4 100644 --- a/include/functional +++ b/include/functional @@ -467,7 +467,9 @@ POLICY: For non-variadic implementations, the number of arguments is limited #include <__functional_base> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/future b/include/future index 62529d97..f6896a3a 100644 --- a/include/future +++ b/include/future @@ -370,7 +370,9 @@ template struct uses_allocator, Alloc>; #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/initializer_list b/include/initializer_list index 745d3bd7..3263906d 100644 --- a/include/initializer_list +++ b/include/initializer_list @@ -46,7 +46,9 @@ template const E* end(initializer_list il) noexcept; #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif namespace std // purposefully not versioned { diff --git a/include/iomanip b/include/iomanip index a407360f..15704046 100644 --- a/include/iomanip +++ b/include/iomanip @@ -33,7 +33,9 @@ template T10 put_time(const struct tm* tmb, const charT* fmt); #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/ios b/include/ios index e2f2b6fd..7ea63a31 100644 --- a/include/ios +++ b/include/ios @@ -216,7 +216,9 @@ storage-class-specifier const error_category& iostream_category; #include <__locale> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/iosfwd b/include/iosfwd index 852d9e5f..7e5ac732 100644 --- a/include/iosfwd +++ b/include/iosfwd @@ -89,7 +89,9 @@ typedef fpos::state_type> wstreampos; #include <__config> #include // for mbstate_t +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/iostream b/include/iostream index e828b54f..53cd146c 100644 --- a/include/iostream +++ b/include/iostream @@ -40,7 +40,9 @@ extern wostream wclog; #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/istream b/include/istream index d2d37768..24d9f3a9 100644 --- a/include/istream +++ b/include/istream @@ -155,7 +155,9 @@ template #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/iterator b/include/iterator index 97ff7872..d6274385 100644 --- a/include/iterator +++ b/include/iterator @@ -321,7 +321,9 @@ template T* end(T (&array)[N]); #include #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/limits b/include/limits index 989964e0..5f31c4fd 100644 --- a/include/limits +++ b/include/limits @@ -102,7 +102,9 @@ template<> class numeric_limits; */ +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #include <__config> #include diff --git a/include/list b/include/list index f2ffcc85..345f24db 100644 --- a/include/list +++ b/include/list @@ -176,7 +176,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/locale b/include/locale index aa99ff7e..b2afbd40 100644 --- a/include/locale +++ b/include/locale @@ -192,7 +192,9 @@ template class messages_byname; #include #endif // !_WIN32 +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/map b/include/map index 886aecf2..8bb75550 100644 --- a/include/map +++ b/include/map @@ -375,7 +375,9 @@ swap(multimap& x, #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/memory b/include/memory index 467d2928..878dda87 100644 --- a/include/memory +++ b/include/memory @@ -600,7 +600,9 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space); #include #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/mutex b/include/mutex index 297baca5..37e74d6d 100644 --- a/include/mutex +++ b/include/mutex @@ -179,7 +179,9 @@ template #include #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/new b/include/new index 81c16bdf..5bcbad0c 100644 --- a/include/new +++ b/include/new @@ -56,7 +56,9 @@ void operator delete[](void* ptr, void*) noexcept; #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif namespace std // purposefully not using versioning namespace { diff --git a/include/numeric b/include/numeric index 31493990..4ca62e8e 100644 --- a/include/numeric +++ b/include/numeric @@ -60,7 +60,9 @@ template #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/ostream b/include/ostream index f1a3de9c..53064961 100644 --- a/include/ostream +++ b/include/ostream @@ -133,7 +133,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/queue b/include/queue index bed5bb7a..e05ab8f8 100644 --- a/include/queue +++ b/include/queue @@ -171,7 +171,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/random b/include/random index 0e0860e7..c5c33c0f 100644 --- a/include/random +++ b/include/random @@ -1646,7 +1646,9 @@ class piecewise_linear_distribution #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/ratio b/include/ratio index 9764014a..4ef66c5b 100644 --- a/include/ratio +++ b/include/ratio @@ -70,7 +70,9 @@ typedef ratio<1000000000000000000000000, 1> yotta; // not supported #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/regex b/include/regex index 760f4eb9..048fbefc 100644 --- a/include/regex +++ b/include/regex @@ -732,7 +732,9 @@ typedef regex_token_iterator wsregex_token_iterator; #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/scoped_allocator b/include/scoped_allocator index 9427a376..cd051020 100644 --- a/include/scoped_allocator +++ b/include/scoped_allocator @@ -106,7 +106,9 @@ template #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/set b/include/set index fe3d3827..36d3dd49 100644 --- a/include/set +++ b/include/set @@ -338,7 +338,9 @@ swap(multiset& x, multiset& y) #include <__tree> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/sstream b/include/sstream index a2a0d31a..1b27195f 100644 --- a/include/sstream +++ b/include/sstream @@ -175,7 +175,9 @@ typedef basic_stringstream wstringstream; #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/stack b/include/stack index 3d72f966..59906bd8 100644 --- a/include/stack +++ b/include/stack @@ -85,7 +85,9 @@ template #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/stdexcept b/include/stdexcept index d31dc8b0..ef5de595 100644 --- a/include/stdexcept +++ b/include/stdexcept @@ -46,7 +46,9 @@ public: #include #include // for string forward decl +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif namespace std // purposefully not using versioning namespace { diff --git a/include/streambuf b/include/streambuf index feb62c7e..5dcb597d 100644 --- a/include/streambuf +++ b/include/streambuf @@ -112,7 +112,9 @@ protected: #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/string b/include/string index 2041510f..4e29e8ae 100644 --- a/include/string +++ b/include/string @@ -446,7 +446,9 @@ template <> struct hash; #include #endif +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/strstream b/include/strstream index 4ff34a55..5eadefd1 100644 --- a/include/strstream +++ b/include/strstream @@ -131,7 +131,9 @@ private: #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/system_error b/include/system_error index 5e1e6fe4..ea96a66c 100644 --- a/include/system_error +++ b/include/system_error @@ -223,7 +223,9 @@ template <> struct hash; #include #include <__functional_base> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/tgmath.h b/include/tgmath.h index 2388b6ee..fbe1e824 100644 --- a/include/tgmath.h +++ b/include/tgmath.h @@ -22,6 +22,8 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #endif // _LIBCPP_TGMATH_H diff --git a/include/thread b/include/thread index ce3ca49e..4366c41d 100644 --- a/include/thread +++ b/include/thread @@ -100,7 +100,9 @@ void sleep_for(const chrono::duration& rel_time); #endif #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif #define __STDCPP_THREADS__ __cplusplus diff --git a/include/tuple b/include/tuple index b3c5c92e..cc679296 100644 --- a/include/tuple +++ b/include/tuple @@ -119,7 +119,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/type_traits b/include/type_traits index c6a20e24..95d3a3fc 100644 --- a/include/type_traits +++ b/include/type_traits @@ -142,7 +142,9 @@ namespace std #include <__config> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD @@ -891,12 +893,12 @@ struct _LIBCPP_VISIBLE aligned_storage #define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \ template \ -struct __attribute__ ((__visibility__("default"))) aligned_storage<_Len, n>\ +struct _LIBCPP_VISIBLE aligned_storage<_Len, n>\ {\ - struct type\ + struct _ALIGNAS(n) type\ {\ unsigned char _[_Len];\ - } __attribute__((__aligned__(n)));\ + };\ } _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1); @@ -913,7 +915,10 @@ _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x400); _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800); _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000); _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000); +// MSDN says that MSVC does not support alignment beyond 8192 (=0x2000) +#if !defined(_MSC_VER) _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000); +#endif // !_MSC_VER #undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION @@ -933,7 +938,7 @@ private: typedef typename __promote<_A2>::type __type2; typedef typename __promote<_A3>::type __type3; public: - typedef __typeof__(__type1() + __type2() + __type3()) type; + typedef decltype(__type1() + __type2() + __type3()) type; }; template @@ -943,7 +948,7 @@ private: typedef typename __promote<_A1>::type __type1; typedef typename __promote<_A2>::type __type2; public: - typedef __typeof__(__type1() + __type2()) type; + typedef decltype(__type1() + __type2()) type; }; template diff --git a/include/typeindex b/include/typeindex index 7fb1513c..398b5288 100644 --- a/include/typeindex +++ b/include/typeindex @@ -49,7 +49,9 @@ struct hash #include #include <__functional_base> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/typeinfo b/include/typeinfo index 310c482c..6ffee0f8 100644 --- a/include/typeinfo +++ b/include/typeinfo @@ -61,7 +61,9 @@ public: #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif namespace std // purposefully not using versioning namespace { diff --git a/include/unordered_map b/include/unordered_map index cb30fc87..56645e09 100644 --- a/include/unordered_map +++ b/include/unordered_map @@ -319,7 +319,9 @@ template #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/unordered_set b/include/unordered_set index d7615fa0..279e9072 100644 --- a/include/unordered_set +++ b/include/unordered_set @@ -305,7 +305,9 @@ template #include <__hash_table> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/utility b/include/utility index 358fe765..dd9ff33d 100644 --- a/include/utility +++ b/include/utility @@ -125,7 +125,9 @@ template #include <__tuple> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/valarray b/include/valarray index 62c1c66c..5d3154cc 100644 --- a/include/valarray +++ b/include/valarray @@ -346,7 +346,9 @@ template unspecified2 end(const valarray& v); #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/include/vector b/include/vector index b334074d..5f47180c 100644 --- a/include/vector +++ b/include/vector @@ -270,7 +270,9 @@ void swap(vector& x, vector& y) #include <__split_buffer> #include <__functional_base> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header +#endif _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/www/results.Windows.html b/www/results.Windows.html index 0569abcd..b548ab7c 100644 --- a/www/results.Windows.html +++ b/www/results.Windows.html @@ -157,7 +157,8 @@ input.output/ copy.pass.cpp: Windows locale names don't follow UNIX convention. default.pass.cpp: idem. streambuf.members/ - locales.pass.cpp: Windows locale names don't follow UNIX convention. + streambuf.locales/ + locales.pass.cpp: Windows locale names don't follow UNIX convention. streambuf.protected/ streambuf.assign/ assign.pass.cpp: Windows locale names don't follow UNIX convention. @@ -223,21 +224,20 @@ localization/ wchar_t_unshift.pass.cpp: idem. locale.codecvt.byname/ ctor_wchar_t.pass.cpp: Windows locale names don't follow UNIX convention. - locale.ctype/ - locale.ctype.byname/ - is_1.pass.cpp: Windows locale names don't follow UNIX convention. - is_many.pass.cpp: idem. - narrow_1.pass.cpp: idem. - narrow_many.pass.cpp: idem. - scan_is.pass.cpp: idem. - scan_not.pass.cpp: idem. - tolower_1.pass.cpp: idem. - tolower_many.pass.cpp: idem. - toupper_1.pass.cpp: idem. - toupper_many.pass.cpp: idem. - types.pass.cpp: idem. - widen_1.pass.cpp: idem. - widen_many.pass.cpp: idem. + locale.ctype.byname/ + is_1.pass.cpp: Windows locale names don't follow UNIX convention. + is_many.pass.cpp: idem. + narrow_1.pass.cpp: idem. + narrow_many.pass.cpp: idem. + scan_is.pass.cpp: idem. + scan_not.pass.cpp: idem. + tolower_1.pass.cpp: idem. + tolower_many.pass.cpp: idem. + toupper_1.pass.cpp: idem. + toupper_many.pass.cpp: idem. + types.pass.cpp: idem. + widen_1.pass.cpp: idem. + widen_many.pass.cpp: idem. category.monetary/ locale.money.get/ locale.money.get.members/