From 54ed20a9d32f16f7ad802beef7bf3352fc0c1c95 Mon Sep 17 00:00:00 2001 From: MFransen69 Date: Tue, 2 Jul 2024 20:53:27 +0200 Subject: [PATCH 1/2] [Core] Fix windows build --- Source/core/SocketPort.cpp | 4 ++-- Source/core/Thread.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/core/SocketPort.cpp b/Source/core/SocketPort.cpp index 88cd6f114..a8ae1e55d 100644 --- a/Source/core/SocketPort.cpp +++ b/Source/core/SocketPort.cpp @@ -63,14 +63,14 @@ #define __ERROR_CONNRESET__ WSAECONNRESET #define __ERROR_NETWORK_UNREACHABLE__ WSAENETUNREACH PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) -#else +#endif #ifdef __APPLE__ #define IPV6_PACKAGE_TYPE IPV6_RECVPKTINFO #else #define IPV6_PACKAGE_TYPE IPV6_PKTINFO #endif -#endif + namespace Thunder { namespace Core { diff --git a/Source/core/Thread.cpp b/Source/core/Thread.cpp index 56a659661..690a43af7 100644 --- a/Source/core/Thread.cpp +++ b/Source/core/Thread.cpp @@ -74,10 +74,6 @@ namespace Core { // then it is up to us. if (m_hThreadInstance == nullptr) #endif - std::string convertedName; - if (threadName != nullptr) { - Core::ToString(threadName, convertedName); - } #ifdef __POSIX__ int err; @@ -93,7 +89,6 @@ namespace Core { ASSERT(err == 0); } - m_threadName = convertedName; // If there is no thread, the "new" thread can also not free the destructor, // then it is up to us. @@ -105,10 +100,16 @@ namespace Core { m_sigExit.SetEvent(); } + std::string convertedName; + if (threadName != nullptr) { + Core::ToString(threadName, convertedName); + } + #ifdef __POSIX__ err = pthread_attr_destroy(&attr); ASSERT(err == 0); m_ThreadId = m_hThreadInstance; + m_threadName = convertedName; #else if (convertedName.empty() != true) { ThreadName(convertedName.c_str()); From daa9c34ca5f2ccb894a78406a6d439ee87a7d7c5 Mon Sep 17 00:00:00 2001 From: MFransen69 Date: Tue, 2 Jul 2024 21:36:25 +0200 Subject: [PATCH 2/2] [com] Fix for Windows Compiler bug (finally I found one :) ) --- Source/Thunder/PluginServer.cpp | 2 +- Source/plugins/IController.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Thunder/PluginServer.cpp b/Source/Thunder/PluginServer.cpp index 677016362..5d6a97fee 100644 --- a/Source/Thunder/PluginServer.cpp +++ b/Source/Thunder/PluginServer.cpp @@ -1211,7 +1211,7 @@ namespace PluginHost { ASSERT(callsign.empty() == false); if (jsonrpc_event.empty() == false) { - JsonData::Events::ForwardMessageParamsData::EventData message({ jsonrpc_event, parameters, callsign }); + JsonData::Events::ForwardMessageParamsData::EventInfoData message({ jsonrpc_event, parameters, callsign }); controller->Notify(_T("all"), message); } else { diff --git a/Source/plugins/IController.h b/Source/plugins/IController.h index 2c947b2d9..8da043981 100644 --- a/Source/plugins/IController.h +++ b/Source/plugins/IController.h @@ -196,7 +196,7 @@ namespace Controller { struct EXTERNAL IEvents : virtual public Core::IUnknown { enum { ID = RPC::ID_CONTROLLER_EVENTS }; - struct Event { + struct EventInfo { string Event; string Params /* @opaque @optional */; string CallSign /* @optional */; @@ -212,7 +212,7 @@ namespace Controller { // All notifications send by any plugin are forwarded over the Controller socket as an event. // @param callsign: Origin of the message // @param data: Contents of the message - virtual void ForwardMessage(const Event& data) = 0; + virtual void ForwardMessage(const EventInfo& data) = 0; }; };