Update to NazaraUtils 2023.12.28
This commit is contained in:
parent
3d21401569
commit
08eaf396ed
|
|
@ -118,7 +118,7 @@ namespace Nz::PlatformImpl
|
||||||
static SetThreadDescriptionFunc SetThreadDescription = reinterpret_cast<SetThreadDescriptionFunc>(::GetProcAddress(::GetModuleHandleW(L"Kernel32.dll"), "SetThreadDescription"));
|
static SetThreadDescriptionFunc SetThreadDescription = reinterpret_cast<SetThreadDescriptionFunc>(::GetProcAddress(::GetModuleHandleW(L"Kernel32.dll"), "SetThreadDescription"));
|
||||||
if (SetThreadDescription)
|
if (SetThreadDescription)
|
||||||
SetThreadDescription(threadHandle, ToWideString(threadName).data());
|
SetThreadDescription(threadHandle, ToWideString(threadName).data());
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
else
|
else
|
||||||
RaiseThreadNameException(::GetThreadId(threadHandle), threadName);
|
RaiseThreadNameException(::GetThreadId(threadHandle), threadName);
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Nz
|
||||||
|
|
||||||
Time GetElapsedMillisecondsImpl()
|
Time GetElapsedMillisecondsImpl()
|
||||||
{
|
{
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
return Time::Milliseconds(GetTickCount64());
|
return Time::Milliseconds(GetTickCount64());
|
||||||
#else
|
#else
|
||||||
return Time::Milliseconds(GetTickCount());
|
return Time::Milliseconds(GetTickCount());
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
namespace Detail
|
namespace Detail
|
||||||
{
|
{
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
using addrinfoImpl = addrinfoW;
|
using addrinfoImpl = addrinfoW;
|
||||||
|
|
||||||
int GetAddressInfo(const std::string& hostname, const std::string& service, const addrinfoImpl* hints, addrinfoImpl** results)
|
int GetAddressInfo(const std::string& hostname, const std::string& service, const addrinfoImpl* hints, addrinfoImpl** results)
|
||||||
|
|
@ -119,7 +119,7 @@ namespace Nz
|
||||||
return IpAddress::Invalid;
|
return IpAddress::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
IpAddress IpAddressImpl::FromAddrinfo(const addrinfoW* info)
|
IpAddress IpAddressImpl::FromAddrinfo(const addrinfoW* info)
|
||||||
{
|
{
|
||||||
switch (info->ai_family)
|
switch (info->ai_family)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Nz
|
||||||
~IpAddressImpl() = delete;
|
~IpAddressImpl() = delete;
|
||||||
|
|
||||||
static IpAddress FromAddrinfo(const addrinfo* info);
|
static IpAddress FromAddrinfo(const addrinfo* info);
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
static IpAddress FromAddrinfo(const addrinfoW* info);
|
static IpAddress FromAddrinfo(const addrinfoW* info);
|
||||||
#endif
|
#endif
|
||||||
static IpAddress FromSockAddr(const sockaddr* address);
|
static IpAddress FromSockAddr(const sockaddr* address);
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ namespace Nz
|
||||||
SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& /*address*/, UInt64 msTimeout, SocketError* error)
|
SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& /*address*/, UInt64 msTimeout, SocketError* error)
|
||||||
{
|
{
|
||||||
// Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails)
|
// Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails)
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
WSAPOLLFD descriptor;
|
WSAPOLLFD descriptor;
|
||||||
descriptor.events = POLLWRNORM;
|
descriptor.events = POLLWRNORM;
|
||||||
descriptor.fd = handle;
|
descriptor.fd = handle;
|
||||||
|
|
@ -480,7 +480,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
else if (ret > 0)
|
else if (ret > 0)
|
||||||
{
|
{
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
if (descriptor.revents & (POLLERR | POLLHUP))
|
if (descriptor.revents & (POLLERR | POLLHUP))
|
||||||
#else
|
#else
|
||||||
if (FD_ISSET(handle, &errSet))
|
if (FD_ISSET(handle, &errSet))
|
||||||
|
|
@ -491,7 +491,7 @@ namespace Nz
|
||||||
|
|
||||||
return SocketState::NotConnected;
|
return SocketState::NotConnected;
|
||||||
}
|
}
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
else if (descriptor.revents & POLLWRNORM)
|
else if (descriptor.revents & POLLWRNORM)
|
||||||
#else
|
#else
|
||||||
else if (FD_ISSET(handle, &writeSet))
|
else if (FD_ISSET(handle, &writeSet))
|
||||||
|
|
@ -499,7 +499,7 @@ namespace Nz
|
||||||
return SocketState::Connected;
|
return SocketState::Connected;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
NazaraWarningFmt("Socket {0} was returned by poll without POLLOUT nor error events (events: {1:#x})", handle, descriptor.revents);
|
NazaraWarningFmt("Socket {0} was returned by poll without POLLOUT nor error events (events: {1:#x})", handle, descriptor.revents);
|
||||||
#else
|
#else
|
||||||
NazaraWarningFmt("Socket {0} was returned by select but is not part of the write nor exception set", handle);
|
NazaraWarningFmt("Socket {0} was returned by select but is not part of the write nor exception set", handle);
|
||||||
|
|
@ -851,7 +851,7 @@ namespace Nz
|
||||||
|
|
||||||
bool SocketImpl::SetIPv6Only(SocketHandle handle, bool ipv6Only, SocketError* error)
|
bool SocketImpl::SetIPv6Only(SocketHandle handle, bool ipv6Only, SocketError* error)
|
||||||
{
|
{
|
||||||
#if NAZARA_UTILS_WINDOWS_NT6
|
#if NAZARAUTILS_WINDOWS_NT6
|
||||||
NazaraAssert(handle != InvalidHandle, "Invalid handle");
|
NazaraAssert(handle != InvalidHandle, "Invalid handle");
|
||||||
|
|
||||||
DWORD option = ipv6Only;
|
DWORD option = ipv6Only;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
#include <Nazara/Network/SocketHandle.hpp>
|
#include <Nazara/Network/SocketHandle.hpp>
|
||||||
#include <WinSock2.h>
|
#include <WinSock2.h>
|
||||||
|
|
||||||
#define NAZARA_NETWORK_POLL_SUPPORT NAZARA_UTILS_WINDOWS_NT6
|
#define NAZARA_NETWORK_POLL_SUPPORT NAZARAUTILS_WINDOWS_NT6
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ end
|
||||||
|
|
||||||
add_repositories("nazara-engine-repo https://github.com/NazaraEngine/xmake-repo")
|
add_repositories("nazara-engine-repo https://github.com/NazaraEngine/xmake-repo")
|
||||||
|
|
||||||
add_requires("entt 3.12.2", "fmt", "frozen", "nazarautils >=2023.11.12")
|
add_requires("entt 3.12.2", "fmt", "frozen", "nazarautils >=2023.12.28")
|
||||||
|
|
||||||
-- Module dependencies
|
-- Module dependencies
|
||||||
if has_config("audio") then
|
if has_config("audio") then
|
||||||
|
|
@ -555,7 +555,7 @@ for name, module in pairs(modules) do
|
||||||
end
|
end
|
||||||
|
|
||||||
if is_plat("windows", "mingw") then
|
if is_plat("windows", "mingw") then
|
||||||
add_defines("NAZARA_UTILS_WINDOWS_NT6=1")
|
add_defines("NAZARAUTILS_WINDOWS_NT6=1")
|
||||||
end
|
end
|
||||||
|
|
||||||
ModuleTargetConfig(name, module)
|
ModuleTargetConfig(name, module)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue