updated build system
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...

This commit is contained in:
2024-08-02 19:42:05 -05:00
parent 853aa2784c
commit 34bc3b759e
4 changed files with 27 additions and 6 deletions

View File

@@ -84,11 +84,15 @@ get_next_available_port(std::uint16_t first_port,
[[nodiscard]] auto resolve_variables(std::wstring_view str) -> std::wstring;
// template implementations
template <typename val_t>
[[nodiscard]] inline auto divide_with_ceiling(const val_t &n,
const val_t &d) -> val_t {
return n ? (n / d) + (n % d != 0) : 0;
template <typename result_t, typename data_t>
[[nodiscard]] inline constexpr auto
divide_with_ceiling(result_t numerator, data_t denominator) -> result_t {
static_assert(std::is_integral_v<std::remove_cv_t<data_t>>,
"denominator must be an integral type");
return denominator == 0
? 0
: (numerator / denominator) + (numerator % denominator != 0);
}
#if defined(PROJECT_ENABLE_LIBSODIUM)