Skip to content

Commit

Permalink
MacOS X build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
avoitenko-logitech committed Jul 26, 2024
1 parent d3a9f29 commit 735d27f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/ipc-client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class client {
protected:
std::string m_app_state_path;
call_on_freeze_t m_freeze_cb = nullptr;

private:
std::atomic_bool m_shutting_down = false;
};
}
8 changes: 5 additions & 3 deletions source/apple/ipc-client-osx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,19 @@ std::vector<ipc::value> ipc::client_osx::call_synchronous_helper(const std::stri
std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();

std::vector<ipc::value> values;
std::chrono::high_resolution_clock::duration obs_call_duration = std::chrono::milliseconds(-2);
} cd;

auto cb = [](void *data, const std::vector<ipc::value> &rval) {
auto cb = [](void *data, const std::vector<ipc::value> &rval, std::chrono::high_resolution_clock::duration obs_call_duration) {
CallData &cd = *static_cast<CallData *>(data);
cd.values.reserve(rval.size());
std::copy(rval.begin(), rval.end(), std::back_inserter(cd.values));
cd.obs_call_duration = obs_call_duration;
cd.called = true;
sem_post(cd.sem);
};

int uniqueId = cname.size() + fname.size() + rand();
const auto uniqueId = cname.size() + fname.size() + rand();
std::string sem_name = "sem-cb" + std::to_string(uniqueId);
std::string path = "/tmp/" + sem_name;
sem_unlink(path.c_str());
Expand Down Expand Up @@ -188,7 +190,7 @@ void ipc::client_osx::read_callback_msg(os::error ec, size_t size)
}

// Call Callback
cb.first(cb.second, fnc_reply_msg.values);
cb.first(cb.second, fnc_reply_msg.values, std::chrono::milliseconds(fnc_reply_msg.obs_call_duration_ms.value_union.ui32));

// Remove cb entry
m_cb.erase(fnc_reply_msg.uid.value_union.ui64);
Expand Down
2 changes: 1 addition & 1 deletion source/windows/ipc-client-win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ std::vector<ipc::value> ipc::client_win::call_synchronous_helper(const std::stri
std::chrono::high_resolution_clock::time_point start = std::chrono::high_resolution_clock::now();

std::vector<ipc::value> values;
std::chrono::high_resolution_clock::duration obs_call_duration = std::chrono::milliseconds(-1);
std::chrono::high_resolution_clock::duration obs_call_duration = std::chrono::milliseconds(-2);
} cd;

auto cb = [](void *data, const std::vector<ipc::value> &rval, std::chrono::high_resolution_clock::duration obs_call_duration) {
Expand Down

0 comments on commit 735d27f

Please sign in to comment.