READY: Resolve "C++17 support"

This MR moves GekkoFS to C++17 with the following replacements:

  • CMake modifications
  • Replacing boost::filesystem and boost::optional with std::filesystem and std::optional, respectively
  • Using nested namespaces
  • Using if constexpr

Depends on merge of !66 (merged).

Closes #134 (closed)

Edited by Marc Vef

Merge request reports

Loading
+1 −1
Changes for CMake/FindLZ4.cmake: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ set(LZ4_LIBRARIES ${LZ4_LIBRARY} )
set(LZ4_INCLUDE_DIRS ${LZ4_INCLUDE_DIR} )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(lz4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR)
find_package_handle_standard_args(LZ4 DEFAULT_MSG LZ4_LIBRARY LZ4_INCLUDE_DIR)

mark_as_advanced(
    LZ4_LIBRARY
+1 −1
Changes for CMake/FindSnappy.cmake: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ set(Snappy_INCLUDE_DIRS ${Snappy_INCLUDE_DIR})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(snappy DEFAULT_MSG Snappy_LIBRARY Snappy_INCLUDE_DIR)
find_package_handle_standard_args(Snappy DEFAULT_MSG Snappy_LIBRARY Snappy_INCLUDE_DIR)

mark_as_advanced(
        Snappy_LIBRARY
+11 −11
Changes for CMake/FindZStd.cmake: 11 added lines, 11 removed lines.
Original line number Diff line number Diff line
#
# - Try to find Facebook zstd library
# This will define
# ZSTD_FOUND
# ZSTD_INCLUDE_DIR
# ZSTD_LIBRARIES
# ZStd_FOUND
# ZStd_INCLUDE_DIR
# ZStd_LIBRARIES
#

find_path(ZSTD_INCLUDE_DIR
find_path(ZStd_INCLUDE_DIR
    NAMES zstd.h
    )

find_library(ZSTD_LIBRARY
find_library(ZStd_LIBRARY
    NAMES zstd
    )

set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
set(ZStd_LIBRARIES ${ZStd_LIBRARY})
set(ZStd_INCLUDE_DIRS ${ZStd_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(ZSTD
    DEFAULT_MSG  ZSTD_LIBRARY ZSTD_INCLUDE_DIR
find_package_handle_standard_args(ZStd
    DEFAULT_MSG ZStd_LIBRARY ZStd_INCLUDE_DIR
    )

mark_as_advanced(
    ZSTD_LIBRARY
    ZSTD_INCLUDE_DIR
    ZStd_LIBRARY
    ZStd_INCLUDE_DIR
)
 No newline at end of file
+2 −4
Changes for include/client/rpc/forward_data.hpp: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -15,8 +15,7 @@
#ifndef GEKKOFS_CLIENT_FORWARD_DATA_HPP
#define GEKKOFS_CLIENT_FORWARD_DATA_HPP

namespace gkfs {
namespace rpc {
namespace gkfs::rpc {

struct ChunkStat {
    unsigned long chunk_size;
@@ -42,7 +41,6 @@ forward_truncate(const std::string& path, size_t current_size, size_t new_size);
std::pair<int, ChunkStat>
forward_get_chunk_stat();

} // namespace rpc
} // namespace gkfs
} // namespace gkfs::rpc

#endif // GEKKOFS_CLIENT_FORWARD_DATA_HPP
+2 −4
Changes for include/client/rpc/forward_management.hpp: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -15,13 +15,11 @@
#ifndef GEKKOFS_CLIENT_FORWARD_MNGMNT_HPP
#define GEKKOFS_CLIENT_FORWARD_MNGMNT_HPP

namespace gkfs {
namespace rpc {
namespace gkfs::rpc {

bool
forward_get_fs_config();

} // namespace rpc
} // namespace gkfs
} // namespace gkfs::rpc

#endif // GEKKOFS_CLIENT_FORWARD_MNGMNT_HPP
Loading
Loading