diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2019-09-10 22:21:18 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2019-09-10 22:21:18 +0300 |
commit | a302c5ab2f601c0116fb62c6b21dec4a143550e9 (patch) | |
tree | a0fe7ab98be1bca3de524e969f340eaf030fb2f0 | |
parent | 4b5fae64a3230290cc7784fddef706ca2ceb5eaf (diff) |
Fix PR #26 was not compiling on MSVC with /fpermissive- due to MSVC parser bug
-rw-r--r-- | CMakeLists.txt | 27 | ||||
-rw-r--r-- | include/llfio/revision.hpp | 6 | ||||
-rw-r--r-- | include/llfio/v2.0/async_file_handle.hpp | 10 | ||||
-rw-r--r-- | include/llfio/v2.0/config.hpp | 2 |
4 files changed, 37 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d7d6f688..e04a3638 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,26 @@ +# LLFIO cmake +# (C) 2016-2019 Niall Douglas <http://www.nedproductions.biz/> +# File Created: June 2016 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License in the accompanying file +# Licence.txt or at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file Licence.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + cmake_minimum_required(VERSION 3.1 FATAL_ERROR) include(cmake/QuickCppLibBootstrap.cmake) include(QuickCppLibRequireOutOfSourceBuild) @@ -192,7 +215,9 @@ endforeach() if(MSVC) foreach(test_target ${llfio_TEST_TARGETS}) target_compile_options(${test_target} PRIVATE /wd4503) ## decorated name length exceeded - #target_compile_options(${test_target} PRIVATE /permissive-) ## future parsing + if(NOT CLANG) + target_compile_options(${test_target} PRIVATE /permissive-) ## future parsing + endif() endforeach() endif() diff --git a/include/llfio/revision.hpp b/include/llfio/revision.hpp index ffa73e7c..4fc7ee5f 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 5b884bb795260a0f2275adad758e5bbf1ea21536 -#define LLFIO_PREVIOUS_COMMIT_DATE "2019-09-08 19:20:18 +00:00" -#define LLFIO_PREVIOUS_COMMIT_UNIQUE 5b884bb7 +#define LLFIO_PREVIOUS_COMMIT_REF 4b5fae64a3230290cc7784fddef706ca2ceb5eaf +#define LLFIO_PREVIOUS_COMMIT_DATE "2019-09-08 21:57:16 +00:00" +#define LLFIO_PREVIOUS_COMMIT_UNIQUE 4b5fae64 diff --git a/include/llfio/v2.0/async_file_handle.hpp b/include/llfio/v2.0/async_file_handle.hpp index 5b60b3fa..eea3288d 100644 --- a/include/llfio/v2.0/async_file_handle.hpp +++ b/include/llfio/v2.0/async_file_handle.hpp @@ -385,6 +385,7 @@ public: struct completion_handler : _erased_completion_handler { CompletionRoutine completion; + explicit completion_handler(CompletionRoutine c) : completion(std::move(c)) { @@ -393,7 +394,8 @@ public: void move(_erased_completion_handler *_dest) final { auto *dest = reinterpret_cast<void *>(_dest); - new(dest) completion_handler(std::move(*this)); + using msvc_workaround = std::decay_t<decltype(*this)>; + new(dest) msvc_workaround(std::move(*this)); } void operator()(_erased_io_state_type *state) final { completion(state->parent, std::move(state->result.write)); } void *address() noexcept final { return &completion; } @@ -448,7 +450,8 @@ public: void move(_erased_completion_handler *_dest) final { auto *dest = reinterpret_cast<void *>(_dest); - new(dest) completion_handler(std::move(*this)); + using msvc_workaround = std::decay_t<decltype(*this)>; + new(dest) msvc_workaround(std::move(*this)); } void operator()(_erased_io_state_type *state) final { completion(state->parent, std::move(state->result.read)); } void *address() noexcept final { return &completion; } @@ -491,7 +494,8 @@ public: void move(_erased_completion_handler *_dest) final { auto *dest = reinterpret_cast<void *>(_dest); - new(dest) completion_handler(std::move(*this)); + using msvc_workaround = std::decay_t<decltype(*this)>; + new(dest) msvc_workaround(std::move(*this)); } void operator()(_erased_io_state_type *state) final { completion(state->parent, std::move(state->result.write)); } void *address() noexcept final { return &completion; } diff --git a/include/llfio/v2.0/config.hpp b/include/llfio/v2.0/config.hpp index 959be4e9..692127e0 100644 --- a/include/llfio/v2.0/config.hpp +++ b/include/llfio/v2.0/config.hpp @@ -222,7 +222,7 @@ LLFIO_V2_NAMESPACE_END // Bring in filesystem #if defined(__has_include) // clang-format off -#if __has_include(<filesystem>) && __cplusplus >= 202000 +#if __has_include(<filesystem>) && __cplusplus >= 201700 #include <filesystem> LLFIO_V2_NAMESPACE_BEGIN namespace filesystem = std::filesystem; |