diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-06-08 15:56:47 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-06-08 15:56:47 +0300 |
commit | bb8e0486b65586cb22e81ef12c088eef1dc34c1b (patch) | |
tree | c9061c260524c22e2505c40b61ad5235d27ae866 | |
parent | bdcaed8b63fc6f95096d1684038109190da83b09 (diff) |
Fix AFIO programs, which had got broke once again.
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | programs/key-value-store/main.cpp | 4 | ||||
-rw-r--r-- | release_notes.md | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml index fba93eb8..2bb87201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,8 +47,8 @@ matrix: - os: osx env: __="Documentation" NAME=TravisDocumentation - os: osx - env: __="cmake tests (error_code)" NAME=TravisLinuxWorker - env: __="cmake tests (status_code)" NAME=TravisLinuxWorker + env: __="cmake tests (error_code)" NAME=TravisLinuxWorker CMAKE_CONFIGURE_OPTIONS= + env: __="cmake tests (status_code)" NAME=TravisLinuxWorker CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON - os: linux compiler: g++ env: __="Documentation" NAME=TravisDocumentation diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f1cf68f..f8349bc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ include(QuickCppLibRequireOutOfSourceBuild) include(QuickCppLibUtils) include(QuickCppLibPolicies) -option(AFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE "Whether to use SG14 status_code for failure handling" ON) +option(AFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE "Whether to use SG14 status_code for failure handling" OFF) # Parse the version we tell cmake directly from the version header file ParseProjectVersionFromHpp("${CMAKE_CURRENT_SOURCE_DIR}/include/afio/version.hpp" VERSIONSTRING) diff --git a/programs/key-value-store/main.cpp b/programs/key-value-store/main.cpp index 0675c38c..96a4eb17 100644 --- a/programs/key-value-store/main.cpp +++ b/programs/key-value-store/main.cpp @@ -46,7 +46,7 @@ namespace stackoverflow if(!_fh) { // Fetch the error code - std::error_code ec = _fh.error().ec; + std::error_code ec = make_error_code(_fh.error()); // Did we fail due to file not found? // It is *very* important to note that ec contains the *original* error code which could // be POSIX, or Win32 or NT kernel error code domains. However we can always compare, @@ -70,7 +70,7 @@ namespace stackoverflow file_handle::io_result<file_handle::buffers_type> _buffers_read = read(fh, {reqs, 0}); if(!_buffers_read) { - std::error_code ec = _fh.error().ec; + std::error_code ec = make_error_code(_fh.error()); std::cerr << "Reading the file " << path << " failed with " << ec.message() << std::endl; } // Same as before, either throw any error or unpack the value returned diff --git a/release_notes.md b/release_notes.md index 7c88f0d9..08669382 100644 --- a/release_notes.md +++ b/release_notes.md @@ -28,6 +28,8 @@ source code repository lives at https://github.com/ned14/boost.afio. - `async_file_handle` supports `co_await` (Coroutines TS). - 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. + - Optional configuration based on [P1028](https://wg21.link/P1028) *SG14 status_code and standard error object + for P0709 Zero-overhead deterministic exceptions*. - Race free filesystem design used throughout (i.e. no TOCTOU). - Zero malloc, zero exception throw and zero whole system memory copy design used throughout, even down to paths (which can hit 64Kb!). - Works very well with the C++ standard library, and is intended to be proposed for standardisation into C++ in Summer 2018. |