[cfe-dev] [PATCH] Libc++ Windows fixes

Ruben Van Boxem vanboxem.ruben at gmail.com
Sun Oct 16 13:34:18 PDT 2011


2011/10/16 Aaron Ballman <aaron at aaronballman.com>

> On Sun, Oct 16, 2011 at 2:26 PM, Ruben Van Boxem
> <vanboxem.ruben at gmail.com> wrote:
> > Fresh patch attached.
> >
> > --- include/__config  (revision 141003)
> > +++ include/__config  (working copy)
> >
> > @@ -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 __cdecl(dllexport)
> > +# else
> > +#  define _LIBCPP_HIDDEN
> > +#  define _LIBCPP_VISIBLE __cdecl(dllimport)
> > +# endif
> > +#else
> > +# define _LIBCPP_HIDDEN
> > +# define _LIBCPP_VISIBLE
> >  #endif
>
> I hadn't noticed this previously, but I'm unfamiliar with being able
> to use the calling convention in place of __declspec.  Is that
> documented somewhere on MSDN?
>

Wow, crap. those two are just too similar. My mistake. Compiler didn't
complain though. Probably does not do what it should... Fixed patch
attached. I'll blame it on the fact that today is sunday :/

Ruben

>
> Everything else looks great!  Thanks!
>
> ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111016/6a99b072/attachment.html>
-------------- next part --------------
Index: include/iostream
===================================================================
--- include/iostream	(revision 141003)
+++ include/iostream	(working copy)
@@ -40,7 +40,9 @@
 #include <istream>
 #include <ostream>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cstdio
===================================================================
--- include/cstdio	(revision 141003)
+++ include/cstdio	(working copy)
@@ -99,7 +99,9 @@
 #include <__config>
 #include <stdio.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cstdarg
===================================================================
--- include/cstdarg	(revision 141003)
+++ include/cstdarg	(working copy)
@@ -35,7 +35,9 @@
 #include <__config>
 #include <stdarg.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__hash_table
===================================================================
--- include/__hash_table	(revision 141003)
+++ include/__hash_table	(working copy)
@@ -18,7 +18,9 @@
 #include <algorithm>
 #include <cmath>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/tuple
===================================================================
--- include/tuple	(revision 141003)
+++ include/tuple	(working copy)
@@ -119,7 +119,9 @@
 #include <memory>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__mutex_base
===================================================================
--- include/__mutex_base	(revision 141003)
+++ include/__mutex_base	(working copy)
@@ -16,7 +16,9 @@
 #include <system_error>
 #include <pthread.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #ifdef _LIBCPP_SHARED_LOCK
 
Index: include/iomanip
===================================================================
--- include/iomanip	(revision 141003)
+++ include/iomanip	(working copy)
@@ -33,7 +33,9 @@
 #include <__config>
 #include <istream>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/system_error
===================================================================
--- include/system_error	(revision 141003)
+++ include/system_error	(working copy)
@@ -223,7 +223,9 @@
 #include <stdexcept>
 #include <__functional_base>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/complex.h
===================================================================
--- include/complex.h	(revision 141003)
+++ include/complex.h	(working copy)
@@ -28,6 +28,8 @@
 
 #endif  // __cplusplus
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #endif  // _LIBCPP_COMPLEX_H
Index: include/numeric
===================================================================
--- include/numeric	(revision 141003)
+++ include/numeric	(working copy)
@@ -60,7 +60,9 @@
 #include <__config>
 #include <iterator>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/utility
===================================================================
--- include/utility	(revision 141003)
+++ include/utility	(working copy)
@@ -125,7 +125,9 @@
 #include <__tuple>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cwchar
===================================================================
--- include/cwchar	(revision 141003)
+++ include/cwchar	(working copy)
@@ -110,7 +110,9 @@
 #include <support/win32/support.h> // pull in *swprintf defines
 #endif // _WIN32
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/type_traits
===================================================================
--- include/type_traits	(revision 141003)
+++ include/type_traits	(working copy)
@@ -142,7 +142,9 @@
 #include <__config>
 #include <cstddef>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
@@ -891,12 +893,12 @@
 
 #define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
 template <size_t _Len>\
-struct __attribute__ ((__visibility__("default"))) aligned_storage<_Len, n>\
+struct _LIBCPP_VISIBLE aligned_storage<_Len, n>\
 {\
     struct type\
     {\
         unsigned char _[_Len];\
-    } __attribute__((__aligned__(n)));\
+    } _ATTRIBUTE(__aligned__(n));\
 }
 
 _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1);
@@ -913,7 +915,10 @@
 _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 @@
     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 <class _A1, class _A2>
@@ -943,7 +948,7 @@
     typedef typename __promote<_A1>::type __type1;
     typedef typename __promote<_A2>::type __type2;
 public:
-    typedef __typeof__(__type1() + __type2()) type;
+    typedef decltype(__type1() + __type2()) type;
 };
 
 template <class _A1>
Index: include/thread
===================================================================
--- include/thread	(revision 141003)
+++ include/thread	(working copy)
@@ -100,7 +100,9 @@
 #endif
 #include <pthread.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #define __STDCPP_THREADS__ __cplusplus
 
Index: include/cstdint
===================================================================
--- include/cstdint	(revision 141003)
+++ include/cstdint	(working copy)
@@ -144,7 +144,9 @@
 #include <__config>
 #include <stdint.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/memory
===================================================================
--- include/memory	(revision 141003)
+++ include/memory	(working copy)
@@ -600,7 +600,9 @@
     #include <cassert>
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cstdbool
===================================================================
--- include/cstdbool	(revision 141003)
+++ include/cstdbool	(working copy)
@@ -22,7 +22,9 @@
 
 #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
Index: include/cstddef
===================================================================
--- include/cstddef	(revision 141003)
+++ include/cstddef	(working copy)
@@ -43,7 +43,9 @@
 
 #include <stddef.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/atomic
===================================================================
--- include/atomic	(revision 141003)
+++ include/atomic	(working copy)
@@ -526,7 +526,9 @@
 #include <cstdint>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/map
===================================================================
--- include/map	(revision 141003)
+++ include/map	(working copy)
@@ -375,7 +375,9 @@
 #include <functional>
 #include <initializer_list>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/ratio
===================================================================
--- include/ratio	(revision 141003)
+++ include/ratio	(working copy)
@@ -70,7 +70,9 @@
 #include <climits>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__split_buffer
===================================================================
--- include/__split_buffer	(revision 141003)
+++ include/__split_buffer	(working copy)
@@ -6,7 +6,9 @@
 #include <type_traits>
 #include <algorithm>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cstdlib
===================================================================
--- include/cstdlib	(revision 141003)
+++ include/cstdlib	(working copy)
@@ -82,7 +82,9 @@
 #include <__config>
 #include <stdlib.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/unordered_map
===================================================================
--- include/unordered_map	(revision 141003)
+++ include/unordered_map	(working copy)
@@ -319,7 +319,9 @@
 #include <functional>
 #include <stdexcept>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cctype
===================================================================
--- include/cctype	(revision 141003)
+++ include/cctype	(working copy)
@@ -38,7 +38,9 @@
 #include <__config>
 #include <ctype.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/chrono
===================================================================
--- include/chrono	(revision 141003)
+++ include/chrono	(working copy)
@@ -255,7 +255,9 @@
 #include <ratio>
 #include <limits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/iterator
===================================================================
--- include/iterator	(revision 141003)
+++ include/iterator	(working copy)
@@ -321,7 +321,9 @@
 #include <cassert>
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__bit_reference
===================================================================
--- include/__bit_reference	(revision 141003)
+++ include/__bit_reference	(working copy)
@@ -14,7 +14,9 @@
 #include <__config>
 #include <algorithm>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/bitset
===================================================================
--- include/bitset	(revision 141003)
+++ include/bitset	(working copy)
@@ -113,7 +113,9 @@
 
 */
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #include <__config>
 #include <__bit_reference>
Index: include/set
===================================================================
--- include/set	(revision 141003)
+++ include/set	(working copy)
@@ -338,7 +338,9 @@
 #include <__tree>
 #include <functional>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/iosfwd
===================================================================
--- include/iosfwd	(revision 141003)
+++ include/iosfwd	(working copy)
@@ -89,7 +89,9 @@
 #include <__config>
 #include <wchar.h>  // for mbstate_t
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/condition_variable
===================================================================
--- include/condition_variable	(revision 141003)
+++ include/condition_variable	(working copy)
@@ -111,7 +111,9 @@
 #include <__mutex_base>
 #include <memory>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cmath
===================================================================
--- include/cmath	(revision 141003)
+++ include/cmath	(working copy)
@@ -301,7 +301,9 @@
 #include <math.h>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 // signbit
 
Index: include/limits
===================================================================
--- include/limits	(revision 141003)
+++ include/limits	(working copy)
@@ -102,7 +102,9 @@
 
 */
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #include <__config>
 #include <type_traits>
Index: include/unordered_set
===================================================================
--- include/unordered_set	(revision 141003)
+++ include/unordered_set	(working copy)
@@ -305,7 +305,9 @@
 #include <__hash_table>
 #include <functional>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/mutex
===================================================================
--- include/mutex	(revision 141003)
+++ include/mutex	(working copy)
@@ -179,7 +179,9 @@
 #include <tuple>
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__functional_03
===================================================================
--- include/__functional_03	(revision 141003)
+++ include/__functional_03	(working copy)
@@ -13,7 +13,9 @@
 
 // manual variadic expansion for <functional>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 template <class _Tp>
 class __mem_fn
Index: include/__sso_allocator
===================================================================
--- include/__sso_allocator	(revision 141003)
+++ include/__sso_allocator	(working copy)
@@ -15,7 +15,9 @@
 #include <type_traits>
 #include <new>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/functional
===================================================================
--- include/functional	(revision 141003)
+++ include/functional	(working copy)
@@ -467,7 +467,9 @@
 
 #include <__functional_base>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/istream
===================================================================
--- include/istream	(revision 141003)
+++ include/istream	(working copy)
@@ -155,7 +155,9 @@
 #include <__config>
 #include <ostream>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/stack
===================================================================
--- include/stack	(revision 141003)
+++ include/stack	(working copy)
@@ -85,7 +85,9 @@
 #include <__config>
 #include <deque>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/csetjmp
===================================================================
--- include/csetjmp	(revision 141003)
+++ include/csetjmp	(working copy)
@@ -34,7 +34,9 @@
 #include <__config>
 #include <setjmp.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #ifndef setjmp
 #define setjmp(env) setjmp(env)
Index: include/string
===================================================================
--- include/string	(revision 141003)
+++ include/string	(working copy)
@@ -446,7 +446,9 @@
 #include <cassert>
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/complex
===================================================================
--- include/complex	(revision 141003)
+++ include/complex	(working copy)
@@ -249,7 +249,9 @@
     #include <cassert>
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cfloat
===================================================================
--- include/cfloat	(revision 141003)
+++ include/cfloat	(working copy)
@@ -63,7 +63,9 @@
 #include <__config>
 #include <float.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #ifndef FLT_EVAL_METHOD
 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
Index: include/typeindex
===================================================================
--- include/typeindex	(revision 141003)
+++ include/typeindex	(working copy)
@@ -49,7 +49,9 @@
 #include <typeinfo>
 #include <__functional_base>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/tgmath.h
===================================================================
--- include/tgmath.h	(revision 141003)
+++ include/tgmath.h	(working copy)
@@ -22,6 +22,8 @@
 #include <complex.h>
 #include <math.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #endif  // _LIBCPP_TGMATH_H
Index: include/ostream
===================================================================
--- include/ostream	(revision 141003)
+++ include/ostream	(working copy)
@@ -133,7 +133,9 @@
 #include <iterator>
 #include <bitset>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/ccomplex
===================================================================
--- include/ccomplex	(revision 141003)
+++ include/ccomplex	(working copy)
@@ -20,7 +20,9 @@
 
 #include <complex>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 // hh 080623 Created
 
Index: include/scoped_allocator
===================================================================
--- include/scoped_allocator	(revision 141003)
+++ include/scoped_allocator	(working copy)
@@ -106,7 +106,9 @@
 #include <__config>
 #include <memory>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/sstream
===================================================================
--- include/sstream	(revision 141003)
+++ include/sstream	(working copy)
@@ -175,7 +175,9 @@
 #include <istream>
 #include <string>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/initializer_list
===================================================================
--- include/initializer_list	(revision 141003)
+++ include/initializer_list	(working copy)
@@ -46,7 +46,9 @@
 #include <__config>
 #include <cstddef>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 namespace std  // purposefully not versioned
 {
Index: include/csignal
===================================================================
--- include/csignal	(revision 141003)
+++ include/csignal	(working copy)
@@ -43,7 +43,9 @@
 #include <__config>
 #include <signal.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/valarray
===================================================================
--- include/valarray	(revision 141003)
+++ include/valarray	(working copy)
@@ -346,7 +346,9 @@
 #include <algorithm>
 #include <functional>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cinttypes
===================================================================
--- include/cinttypes	(revision 141003)
+++ include/cinttypes	(working copy)
@@ -239,7 +239,9 @@
 #include <cstdint>
 #include <inttypes.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/algorithm
===================================================================
--- include/algorithm	(revision 141003)
+++ include/algorithm	(working copy)
@@ -595,7 +595,9 @@
 #include <iterator>
 #include <cstdlib>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/ctgmath
===================================================================
--- include/ctgmath	(revision 141003)
+++ include/ctgmath	(working copy)
@@ -22,6 +22,8 @@
 #include <ccomplex>
 #include <cmath>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #endif  // _LIBCPP_CTGMATH
Index: include/__functional_base
===================================================================
--- include/__functional_base	(revision 141003)
+++ include/__functional_base	(working copy)
@@ -16,7 +16,9 @@
 #include <typeinfo>
 #include <exception>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/typeinfo
===================================================================
--- include/typeinfo	(revision 141003)
+++ include/typeinfo	(working copy)
@@ -61,7 +61,9 @@
 #include <exception>
 #include <cstddef>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 namespace std  // purposefully not using versioning namespace
 {
Index: include/ciso646
===================================================================
--- include/ciso646	(revision 141003)
+++ include/ciso646	(working copy)
@@ -18,6 +18,8 @@
 
 #include <__config>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #endif  // _LIBCPP_CISO646
Index: include/exception
===================================================================
--- include/exception	(revision 141003)
+++ include/exception	(working copy)
@@ -80,7 +80,9 @@
 #include <cstddef>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 namespace std  // purposefully not using versioning namespace
 {
Index: include/locale
===================================================================
--- include/locale	(revision 141003)
+++ include/locale	(working copy)
@@ -192,7 +192,9 @@
 #include <nl_types.h>
 #endif  // !_WIN32
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/forward_list
===================================================================
--- include/forward_list	(revision 141003)
+++ include/forward_list	(working copy)
@@ -174,7 +174,9 @@
 #include <iterator>
 #include <algorithm>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cfenv
===================================================================
--- include/cfenv	(revision 141003)
+++ include/cfenv	(working copy)
@@ -56,7 +56,9 @@
 #include <__config>
 #include <fenv.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/vector
===================================================================
--- include/vector	(revision 141003)
+++ include/vector	(working copy)
@@ -270,7 +270,9 @@
 #include <__split_buffer>
 #include <__functional_base>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/deque
===================================================================
--- include/deque	(revision 141003)
+++ include/deque	(working copy)
@@ -150,7 +150,9 @@
 
 */
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #include <__config>
 #include <__split_buffer>
Index: include/__config
===================================================================
--- include/__config	(revision 141003)
+++ include/__config	(working copy)
@@ -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,9 +119,13 @@
 #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__)
 
@@ -181,16 +215,6 @@
 #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,7 +231,15 @@
 #  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
+#warning AAAAAH
+namespace std {
+  inline namespace _LIBCPP_NAMESPACE {
+  }
+}
 
 #elif defined(__GNUC__)
 
@@ -275,8 +307,29 @@
 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 __aligned__ align
+#define _ATTRIBUTE __declspec
+#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;
 typedef unsigned int   char32_t;
Index: include/stdexcept
===================================================================
--- include/stdexcept	(revision 141003)
+++ include/stdexcept	(working copy)
@@ -46,7 +46,9 @@
 #include <exception>
 #include <iosfwd>  // for string forward decl
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 namespace std  // purposefully not using versioning namespace
 {
Index: include/climits
===================================================================
--- include/climits	(revision 141003)
+++ include/climits	(working copy)
@@ -41,6 +41,8 @@
 #include <__config>
 #include <limits.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #endif  // _LIBCPP_CLIMITS
Index: include/cstring
===================================================================
--- include/cstring	(revision 141003)
+++ include/cstring	(working copy)
@@ -60,7 +60,9 @@
 #include <__config>
 #include <string.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/future
===================================================================
--- include/future	(revision 141003)
+++ include/future	(working copy)
@@ -370,7 +370,9 @@
 #include <mutex>
 #include <thread>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/regex
===================================================================
--- include/regex	(revision 141003)
+++ include/regex	(working copy)
@@ -732,7 +732,9 @@
 #include <vector>
 #include <deque>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/list
===================================================================
--- include/list	(revision 141003)
+++ include/list	(working copy)
@@ -176,7 +176,9 @@
 #include <iterator>
 #include <algorithm>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cwctype
===================================================================
--- include/cwctype	(revision 141003)
+++ include/cwctype	(working copy)
@@ -54,7 +54,9 @@
 #include <cctype>
 #include <wctype.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/random
===================================================================
--- include/random	(revision 141003)
+++ include/random	(working copy)
@@ -1646,7 +1646,9 @@
 #include <ostream>
 #include <cmath>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/queue
===================================================================
--- include/queue	(revision 141003)
+++ include/queue	(working copy)
@@ -171,7 +171,9 @@
 #include <functional>
 #include <algorithm>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/strstream
===================================================================
--- include/strstream	(revision 141003)
+++ include/strstream	(working copy)
@@ -131,7 +131,9 @@
 #include <ostream>
 #include <istream>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__tuple
===================================================================
--- include/__tuple	(revision 141003)
+++ include/__tuple	(working copy)
@@ -15,7 +15,9 @@
 #include <cstddef>
 #include <type_traits>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #ifdef _LIBCPP_HAS_NO_VARIADICS
 
Index: include/codecvt
===================================================================
--- include/codecvt	(revision 141003)
+++ include/codecvt	(working copy)
@@ -55,7 +55,9 @@
 #include <__config>
 #include <__locale>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cerrno
===================================================================
--- include/cerrno	(revision 141003)
+++ include/cerrno	(working copy)
@@ -26,7 +26,9 @@
 #include <__config>
 #include <errno.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
 
Index: include/streambuf
===================================================================
--- include/streambuf	(revision 141003)
+++ include/streambuf	(working copy)
@@ -112,7 +112,9 @@
 #include <iosfwd>
 #include <ios>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__tuple_03
===================================================================
--- include/__tuple_03	(revision 141003)
+++ include/__tuple_03	(working copy)
@@ -13,7 +13,9 @@
 
 #include <__config>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/new
===================================================================
--- include/new	(revision 141003)
+++ include/new	(working copy)
@@ -56,7 +56,9 @@
 #include <exception>
 #include <cstddef>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 namespace std  // purposefully not using versioning namespace
 {
Index: include/ios
===================================================================
--- include/ios	(revision 141003)
+++ include/ios	(working copy)
@@ -216,7 +216,9 @@
 #include <__locale>
 #include <system_error>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__tree
===================================================================
--- include/__tree	(revision 141003)
+++ include/__tree	(working copy)
@@ -17,7 +17,9 @@
 #include <stdexcept>
 #include <algorithm>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__locale
===================================================================
--- include/__locale	(revision 141003)
+++ include/__locale	(working copy)
@@ -25,7 +25,9 @@
 # include <xlocale.h>
 #endif  // _WIN32
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/fstream
===================================================================
--- include/fstream	(revision 141003)
+++ include/fstream	(working copy)
@@ -171,7 +171,9 @@
 #include <__locale>
 #include <cstdio>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/ctime
===================================================================
--- include/ctime	(revision 141003)
+++ include/ctime	(working copy)
@@ -47,7 +47,9 @@
 #include <__config>
 #include <time.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/clocale
===================================================================
--- include/clocale	(revision 141003)
+++ include/clocale	(working copy)
@@ -38,7 +38,9 @@
 #include <__config>
 #include <locale.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/__std_stream
===================================================================
--- include/__std_stream	(revision 141003)
+++ include/__std_stream	(working copy)
@@ -17,7 +17,9 @@
 #include <__locale>
 #include <cstdio>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: include/cassert
===================================================================
--- include/cassert	(revision 141003)
+++ include/cassert	(working copy)
@@ -20,4 +20,6 @@
 #include <__config>
 #include <assert.h>
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
Index: include/array
===================================================================
--- include/array	(revision 141003)
+++ include/array	(working copy)
@@ -111,7 +111,9 @@
     #include <cassert>
 #endif
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
Index: www/results.Windows.html
===================================================================
--- www/results.Windows.html	(revision 141003)
+++ www/results.Windows.html	(working copy)
@@ -157,7 +157,8 @@
     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 @@
      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/


More information about the cfe-dev mailing list