[cfe-dev] Which version of libc++ provides C++14 shared_mutex header

Edward Diener eldlistmailingz at tropicsoft.com
Tue Jun 9 10:41:00 PDT 2015


On 6/9/2015 12:03 PM, Eric Fiselier wrote:
> There currently no useful versioning information provided by the
> libc++ headers. I hope to change this before 3.7 so that
> `_LIBCPP_VERSION` matches the major and minor release version numbers.

Please do. Having to guess what a C++ standard library implementation 
supports at compile time is not the way to do things. I am a bit 
surprised that none of the libc++ developers even thought of this unless 
the intention of libc++ is that it should always be coupled with clang 
and never used by any other compiler implementation.

Thanks !

>
> /Eric
>
> On Tue, Jun 9, 2015 at 1:15 AM, Edward Diener
> <eldlistmailingz at tropicsoft.com> wrote:
>> I asked this question about libc++ on the LLVM developers mailing list but
>> since no one had any informatory answer there they suggested I come here.
>>
>> I want to determine, for a given _LIBCPP_VERSION of libc++, whether the
>> C++14 header file shared_mutex is supported/provided at compile time through
>> some sort of predefined macro or combination of macros.
>>
>> Since libc++ appears to be independent of clang, gcc, or whatever compiler
>> might want to use it as its C++ standard library, I would have expected that
>> the optimum way of doing this was to find libc++ documentation that
>> explained that for a particular _LIBCPP_VERSION a particular set of header
>> files were supported. Or, at the very least, for a particular
>> _LIBCPP_VERSION C++03 header files only were supported, for another
>> particular _LIBCPP_VERSION C++03 and C++11 header files were supported, for
>> another particular _LIBCPP_VERSION C++03, C++11, and C++14 header files were
>> supported etc. Or something like that.
>>
>> I do know about the clang include file checking macros but I don't know with
>> what version of clang I can expect this to work. But given that the include
>> file checking macros were introduced in gcc with version 5.1, and given that
>> other compilers could potentially be using libc++, I am hoping that there is
>> a strictly libc++ solution to my problem.
>>
>> If there is not I would like to recommed to the libc++ developers that there
>> should be.
>>
>> I am working to potentially add support in Boost.config to shared_mutex
>> header file detection, and libc++ is one of the standard libraries supported
>> by Boost.config. Unfortunately the detection of standard header files for
>> Boost.config in libc++ is pretty primitive. Is there any documentation about
>> the predefined macros in libc++ which could help us at Boost come up with a
>> much better way to determine what libc++ supports and does not support for
>> any given release of the library ? If I have missed a discussion or
>> discussions about this regarding libc++ please feel free to point me in the
>> right direction. My google search regarding libc++ and how to tell what is
>> supports for any given release yields almost nothing of value and its
>> documentation page at http://libcxx.llvm.org/ does not tell me anything like
>> what I want to know either.





More information about the cfe-dev mailing list