updated build system
All checks were successful
Public/monitarr/pipeline/head This commit looks good
All checks were successful
Public/monitarr/pipeline/head This commit looks good
This commit is contained in:
2
support/3rd_party/json-3.12.0.tar.gz.sha256
vendored
2
support/3rd_party/json-3.12.0.tar.gz.sha256
vendored
@@ -1 +1 @@
|
||||
4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187 json-3.12.0.tar.gz
|
||||
4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187 *json-3.12.0.tar.gz
|
||||
|
||||
BIN
support/3rd_party/mingw64/innosetup-6.4.3.exe
vendored
Normal file
BIN
support/3rd_party/mingw64/innosetup-6.4.3.exe
vendored
Normal file
Binary file not shown.
1
support/3rd_party/mingw64/innosetup-6.4.3.exe.sha256
vendored
Normal file
1
support/3rd_party/mingw64/innosetup-6.4.3.exe.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
||||
f3c42116542c4cc57263c5ba6c4feabfc49fe771f2f98a79d2f7628b8762723b *innosetup-6.4.3.exe
|
||||
@@ -55,7 +55,8 @@ auto change_to_process_directory() -> bool {
|
||||
std::string path;
|
||||
path.resize(PATH_MAX + 1);
|
||||
#if defined(__APPLE__)
|
||||
proc_pidpath(getpid(), path.c_str(), path.size());
|
||||
auto res =proc_pidpath(getpid(), reinterpret_cast<void *>(path.data()),
|
||||
static_cast<uint32_t>(path.size()));
|
||||
#else // !defined(__APPLE__)
|
||||
auto res = readlink("/proc/self/exe", path.data(), path.size());
|
||||
if (res == -1) {
|
||||
@@ -148,7 +149,7 @@ auto get_free_drive_space(std::string_view path)
|
||||
|
||||
#if defined(__APPLE__)
|
||||
struct statvfs st{};
|
||||
if (statvfs(path.c_str(), &st) != 0) {
|
||||
if (statvfs(std::string{path}.c_str(), &st) != 0) {
|
||||
throw utils::error::create_exception(
|
||||
function_name, {
|
||||
"failed to get free disk space",
|
||||
@@ -240,6 +241,20 @@ auto get_times(std::string_view path) -> std::optional<file_times> {
|
||||
});
|
||||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
ret.accessed = static_cast<std::uint64_t>(st.st_atimespec.tv_nsec) +
|
||||
static_cast<std::uint64_t>(st.st_atimespec.tv_sec) *
|
||||
utils::time::NANOS_PER_SECOND;
|
||||
ret.created = static_cast<std::uint64_t>(st.st_ctimespec.tv_nsec) +
|
||||
static_cast<std::uint64_t>(st.st_ctimespec.tv_sec) *
|
||||
utils::time::NANOS_PER_SECOND;
|
||||
ret.modified = static_cast<std::uint64_t>(st.st_mtimespec.tv_nsec) +
|
||||
static_cast<std::uint64_t>(st.st_mtimespec.tv_sec) *
|
||||
utils::time::NANOS_PER_SECOND;
|
||||
ret.written = static_cast<std::uint64_t>(st.st_mtimespec.tv_nsec) +
|
||||
static_cast<std::uint64_t>(st.st_mtimespec.tv_sec) *
|
||||
utils::time::NANOS_PER_SECOND;
|
||||
#else // !defined(__APPLE__)
|
||||
ret.accessed = static_cast<std::uint64_t>(st.st_atim.tv_nsec) +
|
||||
static_cast<std::uint64_t>(st.st_atim.tv_sec) *
|
||||
utils::time::NANOS_PER_SECOND;
|
||||
@@ -252,7 +267,7 @@ auto get_times(std::string_view path) -> std::optional<file_times> {
|
||||
ret.written = static_cast<std::uint64_t>(st.st_mtim.tv_nsec) +
|
||||
static_cast<std::uint64_t>(st.st_mtim.tv_sec) *
|
||||
utils::time::NANOS_PER_SECOND;
|
||||
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
return ret;
|
||||
@@ -305,7 +320,7 @@ auto get_total_drive_space(std::string_view path)
|
||||
|
||||
#if defined(__APPLE__)
|
||||
struct statvfs st{};
|
||||
if (statvfs(path.c_str(), &st) != 0) {
|
||||
if (statvfs(std::string{path}.c_str(), &st) != 0) {
|
||||
throw utils::error::create_exception(
|
||||
function_name, {
|
||||
"failed to get total disk space",
|
||||
@@ -498,8 +513,7 @@ auto write_json_file(std::wstring_view path, const nlohmann::json &data)
|
||||
#endif // defined(PROJECT_ENABLE_JSON)
|
||||
|
||||
#if defined(PROJECT_ENABLE_LIBDSM)
|
||||
static constexpr auto validate_smb_path =
|
||||
[](std::string_view path) -> bool {
|
||||
static constexpr auto validate_smb_path = [](std::string_view path) -> bool {
|
||||
return (not utils::string::begins_with(path, "///") &&
|
||||
utils::string::begins_with(path, "//") &&
|
||||
// not utils::string::contains(path, " ") &&
|
||||
|
||||
@@ -25,11 +25,15 @@
|
||||
#include "utils/collection.hpp"
|
||||
|
||||
namespace monitarr::utils {
|
||||
#if !defined(__APPLE__)
|
||||
#if defined(__APPLE__)
|
||||
auto convert_to_uint64(pthread_t thread) -> std::uint64_t {
|
||||
return reinterpret_cast<std::uintptr_t>(thread);
|
||||
}
|
||||
#else // defined(__APPLE__)
|
||||
auto convert_to_uint64(const pthread_t &thread) -> std::uint64_t {
|
||||
return static_cast<std::uint64_t>(thread);
|
||||
}
|
||||
#endif // !defined(__APPLE__)
|
||||
#endif // defined(__APPLE__)
|
||||
|
||||
auto get_last_error_code() -> int { return errno; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user