diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-07-14 23:40:31 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2017-07-14 23:40:31 +0300 |
commit | a7bc876322994d2bd76e95b2c61ec1b1241e4738 (patch) | |
tree | 9cc95beb4b84229155c7c05a9ee1ad5bb022ef2f /programs | |
parent | 3a16fa3e45b940a221ceb41a6c86ebe214318c02 (diff) |
First attempt at a port to QuickCppLib and Outcome v2 (it's not working yet)
Diffstat (limited to 'programs')
-rw-r--r-- | programs/CMakeLists.txt | 6 | ||||
-rw-r--r-- | programs/benchmark-locking/main.cpp | 12 | ||||
-rw-r--r-- | programs/fs-probe/main.cpp | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt index 0c023e02..98331165 100644 --- a/programs/CMakeLists.txt +++ b/programs/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -if(NOT TARGET boost::afio::hl) +if(NOT TARGET AFIO_V2_NAMESPACE::hl) add_subdirectory(.. afio EXCLUDE_FROM_ALL) endif() @@ -16,5 +16,5 @@ function(make_program program) ) endfunction() -make_program(benchmark-locking boost::afio::hl) -make_program(fs-probe boost::afio::hl) +make_program(benchmark-locking AFIO_V2_NAMESPACE::hl) +make_program(fs-probe AFIO_V2_NAMESPACE::hl) diff --git a/programs/benchmark-locking/main.cpp b/programs/benchmark-locking/main.cpp index d0210c1f..fb581f12 100644 --- a/programs/benchmark-locking/main.cpp +++ b/programs/benchmark-locking/main.cpp @@ -43,8 +43,8 @@ Distributed under the Boost Software License, Version 1.0. #include <conio.h> // for kbhit() #endif -namespace afio = BOOST_AFIO_V2_NAMESPACE; -namespace child_process = BOOST_KERNELTEST_V1_NAMESPACE::child_process; +namespace afio = AFIO_V2_NAMESPACE; +namespace child_process = KERNELTEST_V1_NAMESPACE::child_process; #ifdef _WIN32 // TODO FIXME Replace with mapped_file_handle once implemented as that is portable unlike this @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) std::vector<child_process::child_process> children; auto mypath = child_process::current_process_path(); #ifdef UNICODE - std::vector<afio::stl1z::filesystem::path::string_type> args = {L"spawned", L"", L"", L"", L"00"}; + std::vector<afio::filesystem::path::string_type> args = {L"spawned", L"", L"", L"", L"00"}; args[1].resize(strlen(argv[1])); for(size_t n = 0; n < args[1].size(); n++) args[1][n] = argv[1][n]; @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) for(size_t n = 0; n < args[3].size(); n++) args[3][n] = argv[3][n]; #else - std::vector<afio::stl1z::filesystem::path::string_type> args = {"spawned", argv[1], argv[2], argv[3], "00"}; + std::vector<afio::filesystem::path::string_type> args = {"spawned", argv[1], argv[2], argv[3], "00"}; #endif auto env = child_process::current_process_env(); std::cout << "Launching " << waiters << " copies of myself as a child process ..." << std::endl; @@ -313,13 +313,13 @@ int main(int argc, char *argv[]) } case lock_algorithm::memory_map: { - auto v = afio::algorithm::shared_fs_mutex::memory_map<boost_lite::algorithm::hash::passthru_hash>::fs_mutex_map("lockfile"); + auto v = afio::algorithm::shared_fs_mutex::memory_map<QUICKCPPLIB_NAMESPACE::algorithm::hash::passthru_hash>::fs_mutex_map("lockfile"); if(v.has_error()) { std::cerr << "ERROR: Creation of lock algorithm returns " << v.get_error().message() << std::endl; return; } - algorithm = std::make_unique<afio::algorithm::shared_fs_mutex::memory_map<boost_lite::algorithm::hash::passthru_hash>>(std::move(v.get())); + algorithm = std::make_unique<afio::algorithm::shared_fs_mutex::memory_map<QUICKCPPLIB_NAMESPACE::algorithm::hash::passthru_hash>>(std::move(v.get())); break; } case lock_algorithm::unknown: diff --git a/programs/fs-probe/main.cpp b/programs/fs-probe/main.cpp index fa023690..4765e14b 100644 --- a/programs/fs-probe/main.cpp +++ b/programs/fs-probe/main.cpp @@ -31,13 +31,13 @@ Distributed under the Boost Software License, Version 1.0. #include <iostream> #ifdef __linux__ -#define file_handle BOOST_AFIO_V2_NAMESPACE::file_handle +#define file_handle AFIO_V2_NAMESPACE::file_handle #endif constexpr unsigned permute_flags_max = 4; static const std::regex sp_preamble{"(system|storage).*"}; -static BOOST_AFIO_V2_NAMESPACE::storage_profile::storage_profile profile[permute_flags_max]; +static AFIO_V2_NAMESPACE::storage_profile::storage_profile profile[permute_flags_max]; #define RETCHECK(expr) \ { \ @@ -51,8 +51,8 @@ static BOOST_AFIO_V2_NAMESPACE::storage_profile::storage_profile profile[permute int main(int argc, char *argv[]) { - using namespace BOOST_AFIO_V2_NAMESPACE; - namespace stl11 = BOOST_AFIO_V2_NAMESPACE::stl11; + using namespace AFIO_V2_NAMESPACE; + namespace stl11 = AFIO_V2_NAMESPACE::stl11; std::regex torun(".*"); bool regexvalid = false; unsigned torunflags = permute_flags_max - 1; @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) } // File closes, as it was opened with O_SYNC it forces extent allocation // Pause as Windows still takes a while - stl11::this_thread::sleep_for(stl11::chrono::seconds(3)); + std::this_thread::sleep_for(std::chrono::seconds(3)); std::ofstream results("fs_probe_results.yaml", std::ios::app); { auto put_time = [](const std::tm *tmb, const char *fmt) { |