From 963f1da1d8fba61c374ec5b20fd79cfac0820463 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Thu, 7 Nov 2024 16:32:35 +0800 Subject: [PATCH] [fix] fix redefinition error on MacOSX --- src/device_controller/device_controller.h | 7 ++++++- src/single_window/render_callback_func.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/device_controller/device_controller.h b/src/device_controller/device_controller.h index 37f1762..d68a6ff 100644 --- a/src/device_controller/device_controller.h +++ b/src/device_controller/device_controller.h @@ -9,7 +9,12 @@ #include -typedef enum { mouse = 0, keyboard, audio_capture, host_info } ControlType; +typedef enum { + mouse = 0, + keyboard, + audio_capture, + host_infomation +} ControlType; typedef enum { move = 0, left_down, left_up, right_down, right_up } MouseFlag; typedef enum { key_down = 0, key_up } KeyFlag; typedef struct { diff --git a/src/single_window/render_callback_func.cpp b/src/single_window/render_callback_func.cpp index bdc825f..4bad822 100644 --- a/src/single_window/render_callback_func.cpp +++ b/src/single_window/render_callback_func.cpp @@ -211,7 +211,7 @@ void Render::OnReceiveDataBufferCb(const char *data, size_t size, render->StopSpeakerCapture(); } } else if (ControlType::keyboard == remote_action.type) { - } else if (ControlType::host_info == remote_action.type) { + } else if (ControlType::host_infomation == remote_action.type) { render->host_name_ = std::string(remote_action.i.host_name, remote_action.i.host_name_size); LOG_INFO("Remote hostname: [{}]", render->host_name_); @@ -270,7 +270,7 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, const char *user_id, if (!render->hostname_sent_) { std::string host_name = GetHostName(); RemoteAction remote_action; - remote_action.type = ControlType::host_info; + remote_action.type = ControlType::host_infomation; memcpy(&remote_action.i.host_name, host_name.data(), host_name.size()); remote_action.i.host_name_size = host_name.size(); int ret = SendData(render->peer_, DATA_TYPE::DATA,