Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2019 21:01:46 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Yuri <yuri@rawbw.com>
Cc:        "ports\@freebsd.org" <ports@freebsd.org>
Subject:   Re: 12.0-RELEASE-p7 doesn't contain std::filesystem that has been added to 12.0-STABLE some time later
Message-ID:  <a7dl-lnmt-wny@FreeBSD.org>
In-Reply-To: <9080c5f5-9d0c-2086-bd2c-57c409fffe3a@rawbw.com> (yuri@rawbw.com's message of "Wed, 10 Jul 2019 11:23:15 -0700")
References:  <1eac89d9-babe-7069-8c4b-2fbe53234fcd@rawbw.com> <sgre-m0pg-wny@FreeBSD.org> <9080c5f5-9d0c-2086-bd2c-57c409fffe3a@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Yuri <yuri@rawbw.com> writes:

> On 2019-07-10 07:19, Jan Beich wrote:
>
>> C++ example:
>>
>>    #if __cplusplus >= 201703L && __has_include(<filesystem>)
>>    #include <filesystem>
>>    #else
>>    #include <experimental/filesystem>
>>    namespace std {
>>      namespace filesystem = experimental::filesystem;
>>    }
>>    #endif
>>
>> Makefile example:
>>
>>    .if exists(/usr/lib/libc++fs.a)
>>    LIBS+=	-lc++fs
>>    .elif exists(/usr/lib/libc++experimental.a)
>>    # XXX Remove after FreeBSD 12.0 EOL
>>    LIBS+=	-lc++experimental
>>    .else
>>    # XXX Remove after FreeBSD 11.2 EOL
>>    USE_GCC=	yes
>>    LIBS+=	-lstdc++fs
>>    .endif
>
>
> This helps with locating the header/library, but it fails to compile
> in poudriere on 12.0-RELEASE-p7:
>
> x.cpp:213:15: error: no member named 'is_symlink' in
> 'std::experimental::filesystem::v1::directory_entry'
>     if (entry.is_symlink())
>         ~~~~~ ^

Convert "entry.is_symlink()" to "std::filesystem::is_symlink(entry)"

> It looks like 12.0-RELEASE-p7 is technically broken, because it
> doesn't include is_symlink().

is_symlink() exists but not as a member function of directory_entry
under std::experimental namespace. Same is true even for newer versions
of libc++ or libstdc++.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a7dl-lnmt-wny>