From 23d97da0147cdef740785370d12164659eed2994 Mon Sep 17 00:00:00 2001 From: whitewalker608 Date: Thu, 24 Dec 2020 13:13:50 +0530 Subject: [PATCH 1/3] replacing experimental::filesystem with boost --- beacon/examples/crawler.cpp | 2 +- beacon/examples/discovery.cpp | 6 +++--- stream/examples/client.cpp | 6 +++--- stream/examples/server.cpp | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/beacon/examples/crawler.cpp b/beacon/examples/crawler.cpp index be9a3825..0c0a33db 100644 --- a/beacon/examples/crawler.cpp +++ b/beacon/examples/crawler.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include "spdlog/fmt/bin_to_hex.h" diff --git a/beacon/examples/discovery.cpp b/beacon/examples/discovery.cpp index a892136a..c20a8f6d 100644 --- a/beacon/examples/discovery.cpp +++ b/beacon/examples/discovery.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include "spdlog/fmt/bin_to_hex.h" @@ -47,7 +47,7 @@ int main() { uint8_t static_sk[crypto_box_SECRETKEYBYTES]; uint8_t static_pk[crypto_box_PUBLICKEYBYTES]; - if(std::experimental::filesystem::exists("./.marlin/keys/static")) { + if(boost::filesystem::exists("./.marlin/keys/static")) { std::ifstream sk("./.marlin/keys/static", std::ios::binary); if(!sk.read((char *)static_sk, crypto_box_SECRETKEYBYTES)) { throw; @@ -56,7 +56,7 @@ int main() { } else { crypto_box_keypair(static_pk, static_sk); - std::experimental::filesystem::create_directories("./.marlin/keys/"); + boost::filesystem::create_directories("./.marlin/keys/"); std::ofstream sk("./.marlin/keys/static", std::ios::binary); sk.write((char *)static_sk, crypto_box_SECRETKEYBYTES); diff --git a/stream/examples/client.cpp b/stream/examples/client.cpp index 1d845df3..58d17484 100644 --- a/stream/examples/client.cpp +++ b/stream/examples/client.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include using namespace marlin::core; using namespace marlin::asyncio; @@ -85,7 +85,7 @@ struct Delegate { }; int main() { - if(std::experimental::filesystem::exists("./.marlin/keys/static")) { + if(boost::filesystem::exists("./.marlin/keys/static")) { std::ifstream sk("./.marlin/keys/static", std::ios::binary); if(!sk.read((char *)static_sk, crypto_box_SECRETKEYBYTES)) { throw; @@ -94,7 +94,7 @@ int main() { } else { crypto_box_keypair(static_pk, static_sk); - std::experimental::filesystem::create_directories("./.marlin/keys/"); + boost::filesystem::create_directories("./.marlin/keys/"); std::ofstream sk("./.marlin/keys/static", std::ios::binary); sk.write((char *)static_sk, crypto_box_SECRETKEYBYTES); diff --git a/stream/examples/server.cpp b/stream/examples/server.cpp index 3d7b238e..053a05ab 100644 --- a/stream/examples/server.cpp +++ b/stream/examples/server.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include using namespace marlin::core; using namespace marlin::asyncio; @@ -85,7 +85,7 @@ struct Delegate { }; int main() { - if(std::experimental::filesystem::exists("./.marlin/keys/static")) { + if(boost::filesystem::exists("./.marlin/keys/static")) { std::ifstream sk("./.marlin/keys/static", std::ios::binary); if(!sk.read((char *)static_sk, crypto_box_SECRETKEYBYTES)) { throw; @@ -94,7 +94,7 @@ int main() { } else { crypto_box_keypair(static_pk, static_sk); - std::experimental::filesystem::create_directories("./.marlin/keys/"); + boost::filesystem::create_directories("./.marlin/keys/"); std::ofstream sk("./.marlin/keys/static", std::ios::binary); sk.write((char *)static_sk, crypto_box_SECRETKEYBYTES); From 9afaf1b11f2e67f24c142c63f869880e276e15ff Mon Sep 17 00:00:00 2001 From: whitewalker608 Date: Thu, 24 Dec 2020 14:56:15 +0530 Subject: [PATCH 2/3] adding boost in cmake --- beacon/CMakeLists.txt | 3 +++ stream/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/beacon/CMakeLists.txt b/beacon/CMakeLists.txt index f90e177d..799d7fee 100644 --- a/beacon/CMakeLists.txt +++ b/beacon/CMakeLists.txt @@ -38,6 +38,9 @@ target_link_libraries(beacon INTERFACE spdlog::spdlog_header_only) # Boost::iterator target_link_libraries(beacon INTERFACE Boost::iterator) +# Boost::filesystem +target_link_libraries(beacon INTERFACE Boost::filesystem) + install(TARGETS beacon EXPORT marlin-beacon-export LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/stream/CMakeLists.txt b/stream/CMakeLists.txt index 8e2481a4..282bca74 100644 --- a/stream/CMakeLists.txt +++ b/stream/CMakeLists.txt @@ -35,6 +35,9 @@ target_link_libraries(stream INTERFACE marlin::asyncio) # spdlog target_link_libraries(stream INTERFACE spdlog::spdlog_header_only) +# Boost::filesystem +target_link_libraries(stream INTERFACE Boost::filesystem) + install(TARGETS stream EXPORT marlin-stream-export LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} From e09df96925c10f8d7dda8d2a97f4bdd97522c236 Mon Sep 17 00:00:00 2001 From: whitewalker608 Date: Fri, 25 Dec 2020 10:32:20 +0530 Subject: [PATCH 3/3] replacing size_t with uint64_t in fun dec to match func def --- pubsub/include/marlin/pubsub/PubSubNode.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubsub/include/marlin/pubsub/PubSubNode.hpp b/pubsub/include/marlin/pubsub/PubSubNode.hpp index ed9fb93c..d24b43ec 100755 --- a/pubsub/include/marlin/pubsub/PubSubNode.hpp +++ b/pubsub/include/marlin/pubsub/PubSubNode.hpp @@ -1226,7 +1226,7 @@ void PUBSUBNODETYPE::send_message_on_channel( uint16_t channel, uint64_t message_id, const uint8_t *data, - size_t size, + uint64_t size, core::SocketAddress const *excluded, MessageHeaderType prev_header ) {