This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit b90407d5c3da5882b022f7731ee4352fa26244f8 Author: Adam Debreceni <[email protected]> AuthorDate: Tue Dec 6 17:21:25 2022 +0100 MINIFICPP-2005 Use gsl::span instead of std::span Due to a compilation error when using clang/libc++ Closes #1468 Signed-off-by: Marton Szasz <[email protected]> --- extensions/rocksdb-repos/FlowFileLoader.cpp | 3 ++- libminifi/test/unit/SwapTestController.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/rocksdb-repos/FlowFileLoader.cpp b/extensions/rocksdb-repos/FlowFileLoader.cpp index f2a13f7bc..983cae449 100644 --- a/extensions/rocksdb-repos/FlowFileLoader.cpp +++ b/extensions/rocksdb-repos/FlowFileLoader.cpp @@ -25,6 +25,7 @@ #include "logging/LoggerConfiguration.h" #include "FlowFileRecord.h" +#include "utils/gsl.h" namespace org::apache::nifi::minifi { @@ -93,7 +94,7 @@ utils::TaskRescheduleInfo FlowFileLoader::loadImpl(const std::vector<SwappedFlow } utils::Identifier container_id; auto flow_file = FlowFileRecord::DeSerialize( - std::as_bytes(std::span(serialized_items[idx])), content_repo_, container_id); + gsl::make_span(serialized_items[idx]).as_span<const std::byte>(), content_repo_, container_id); if (!flow_file) { // corrupted flow file logger_->log_error("Failed to deserialize flow file \"%s\"", serialized_keys[idx]); diff --git a/libminifi/test/unit/SwapTestController.h b/libminifi/test/unit/SwapTestController.h index 002e87d61..954746664 100644 --- a/libminifi/test/unit/SwapTestController.h +++ b/libminifi/test/unit/SwapTestController.h @@ -29,6 +29,7 @@ #include "../Utils.h" #include "../Catch.h" #include "../unit/ProvenanceTestHelper.h" +#include "../utils/gsl.h" namespace org::apache::nifi::minifi::test { @@ -77,7 +78,7 @@ class SwappingFlowFileTestRepo : public TestFlowRepository, public minifi::SwapM std::string value; Get(ff_id.id.to_string().c_str(), value); minifi::utils::Identifier container_id; - auto ff = minifi::FlowFileRecord::DeSerialize(std::as_bytes(std::span(value)), content_repo_, container_id); + auto ff = minifi::FlowFileRecord::DeSerialize(gsl::make_span(value).as_span<const std::byte>(), content_repo_, container_id); ff->setPenaltyExpiration(ff_id.to_be_processed_after); load_task.result.push_back(std::move(ff)); }
