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

Aaron Ballman aaron at aaronballman.com
Sun Oct 16 12:57:34 PDT 2011


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?

Everything else looks great!  Thanks!

~Aaron



More information about the cfe-dev mailing list