From 6d1b31b24db382dae9a26f66294293cf3d7c1cdd Mon Sep 17 00:00:00 2001 From: Takashi Mori Date: Thu, 11 Apr 2024 21:20:08 +0900 Subject: [PATCH] bug fixed for win --- src/hako/core/rpc/hako_internal_rpc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hako/core/rpc/hako_internal_rpc.cpp b/src/hako/core/rpc/hako_internal_rpc.cpp index 063eafc..ea1a0ec 100644 --- a/src/hako/core/rpc/hako_internal_rpc.cpp +++ b/src/hako/core/rpc/hako_internal_rpc.cpp @@ -1,7 +1,9 @@ #include "core/rpc/hako_internal_rpc.hpp" #include "core/context/hako_context.hpp" #include "utils/hako_share/hako_sem_flock.hpp" +#ifndef WIN32 #include "utils/hako_share/hako_sem.hpp" +#endif #include "utils/hako_config_loader.hpp" typedef struct { @@ -15,8 +17,13 @@ void hako::core::rpc::HakoInternalRpc::register_callback(hako::data::HakoAssetEv HakoConfigType config; hako_config_load(config); if ((config.param == nullptr) || (config.param["shm_type"] == "shm")) { +#ifndef WIN32 my_sem.asset_up = utils::sem::asset_up; my_sem.asset_down = utils::sem::asset_down; +#else + my_sem.asset_up = utils::sem::flock::asset_up; + my_sem.asset_down = utils::sem::flock::asset_down; +#endif } else { my_sem.asset_up = utils::sem::flock::asset_up; @@ -83,8 +90,13 @@ void hako::core::rpc::notify(std::shared_ptr master_data, HakoConfigType config; hako_config_load(config); if ((config.param == nullptr) || (config.param["shm_type"] == "shm")) { +#ifndef WIN32 my_sem.asset_up = utils::sem::asset_up; my_sem.asset_down = utils::sem::asset_down; +#else + my_sem.asset_up = utils::sem::flock::asset_up; + my_sem.asset_down = utils::sem::flock::asset_down; +#endif } else { my_sem.asset_up = utils::sem::flock::asset_up;