diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2020-03-13 15:02:52 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2020-03-13 15:02:52 +0300 |
commit | 9bac4699b037471bc113581058a660f66ddf4c5a (patch) | |
tree | 3c0376976fa0d3ef6906a40cc2624b4c40f9d6c6 | |
parent | c43ec836bce574fbd7b11203d021b6ee634cfed4 (diff) |
Fix libc++ issues #52 (outdated <filesystem>) and #49 (char8_t)
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | include/llfio/revision.hpp | 6 | ||||
-rw-r--r-- | include/llfio/v2.0/config.hpp | 7 | ||||
-rw-r--r-- | include/llfio/v2.0/detail/impl/path_view.ipp | 10 | ||||
-rw-r--r-- | release_notes.md | 1 |
5 files changed, 26 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f400628..325a4c62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,6 +196,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") endif() endif() if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) + if(CLANG_VERSION_MAJOR GREATER_EQUAL 9) + # Do nothing, it's built in + elseif(CLANG_VERSION_MAJOR GREATER_EQUAL 7) + find_library(libcxx_cxxfs c++fs) + all_link_libraries(PUBLIC ${libcxx_cxxfs}) + endif() + # Link in experimental always. If library is in C++ 14, or older LLVM, experimental filesystem will be used. + # If libc++fs or built-in filesystem is used, this link will be discarded. find_library(libcxx_cxxexperimental c++experimental) all_link_libraries(PUBLIC ${libcxx_cxxexperimental}) endif() diff --git a/include/llfio/revision.hpp b/include/llfio/revision.hpp index 04cb25f8..521885f8 100644 --- a/include/llfio/revision.hpp +++ b/include/llfio/revision.hpp @@ -1,4 +1,4 @@ // Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time -#define LLFIO_PREVIOUS_COMMIT_REF e07bc7937d16c1cc84d92f7e809f1b37116f5e7f -#define LLFIO_PREVIOUS_COMMIT_DATE "2020-03-11 11:47:51 +00:00" -#define LLFIO_PREVIOUS_COMMIT_UNIQUE e07bc793 +#define LLFIO_PREVIOUS_COMMIT_REF c43ec836bce574fbd7b11203d021b6ee634cfed4 +#define LLFIO_PREVIOUS_COMMIT_DATE "2020-03-13 11:24:11 +00:00" +#define LLFIO_PREVIOUS_COMMIT_UNIQUE c43ec836 diff --git a/include/llfio/v2.0/config.hpp b/include/llfio/v2.0/config.hpp index 3f9eb8d5..14dcc464 100644 --- a/include/llfio/v2.0/config.hpp +++ b/include/llfio/v2.0/config.hpp @@ -224,7 +224,9 @@ LLFIO_V2_NAMESPACE_END LLFIO_V2_NAMESPACE_BEGIN namespace filesystem = std::filesystem; LLFIO_V2_NAMESPACE_END -#elif __has_include(<experimental/filesystem>) && (!defined(_MSC_VER) || _MSC_VER < 1923) // C++ 14 filesystem support was dropped in VS2019 16.3 +// C++ 14 filesystem support was dropped in VS2019 16.3 +// C++ 14 filesystem support was dropped in LLVM 11 +#elif __has_include(<experimental/filesystem>) && (!defined(_MSC_VER) || _MSC_VER < 1923) && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 11000) #include <experimental/filesystem> LLFIO_V2_NAMESPACE_BEGIN namespace filesystem = std::experimental::filesystem; @@ -233,6 +235,9 @@ LLFIO_V2_NAMESPACE_END #if defined(_MSC_VER) && _MSC_VER >= 1923 #error MSVC dropped support for C++ 14 <filesystem> from VS2019 16.3 onwards. Please enable C++ 17 or later. #endif +#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 11000 +#error libc++ dropped support for C++ 14 <filesystem> from LLVM 11 onwards. Please enable C++ 17 or later. +#endif #include <filesystem> LLFIO_V2_NAMESPACE_BEGIN namespace filesystem = std::filesystem; diff --git a/include/llfio/v2.0/detail/impl/path_view.ipp b/include/llfio/v2.0/detail/impl/path_view.ipp index 84ddd40e..4e34b948 100644 --- a/include/llfio/v2.0/detail/impl/path_view.ipp +++ b/include/llfio/v2.0/detail/impl/path_view.ipp @@ -361,8 +361,14 @@ namespace detail #endif #else #if defined(_LIBCPP_VERSION) - // libc++ appears to be missing char8_t to wchar_t codecvt entirely - return _reencode_path_to(toallocate, dest_buffer, dest_buffer_length, (const char *) src_buffer, src_buffer_length); + // libc++ appears to be missing anything to wchar_t codecvt entirely + (void) toallocate; + (void) dest_buffer; + (void) dest_buffer_length; + (void) src_buffer; + (void) src_buffer_length; + LLFIO_LOG_FATAL(nullptr, "path_view_component::c_str reencoding function does not support char8_t to wchar_t conversion on libc++."); + abort(); #else return _reencode_path_to(toallocate, dest_buffer, dest_buffer_length, src_buffer, src_buffer_length); #endif diff --git a/release_notes.md b/release_notes.md index 6b49e866..ad27c3fb 100644 --- a/release_notes.md +++ b/release_notes.md @@ -24,6 +24,7 @@ It is a complete rewrite after a Boost peer review in August 2015. Its github source code repository lives at https://github.com/ned14/llfio. - Portable to any conforming C++ 14 compiler with a working Filesystem TS in its STL. + - Note that VS2019 16.3 and libc++ 11 dropped support for Filesystem in C++ 14. - Will make use of any Concepts TS if you have them. - Provides view adapters into the Ranges TS, so ready for STL2. - Original error code is always preserved, even down to the original NT kernel error code if a NT kernel API was used. |