Make compile with msvc, clang and gcc on Windows

This commit is contained in:
oltolm 2023-07-11 20:40:30 +02:00 committed by GitHub
parent ed75bab7b2
commit 0c94606fcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 519 additions and 4584 deletions

View file

@ -32,6 +32,12 @@
#endif
#endif
#ifdef _WIN32
constexpr SOCKET invalid_socket = INVALID_SOCKET;
#else
constexpr int invalid_socket = -1;
#endif
namespace pine
{
/**
@ -381,7 +387,7 @@ namespace pine
m_msgsock = accept(m_sock, 0, 0);
if (m_msgsock == -1)
if (m_msgsock == invalid_socket)
{
// everything else is non recoverable in our scope
// we also mark as recoverable socket errors where it would block a
@ -541,7 +547,7 @@ namespace pine
}
server.sin_port = htons(Impl::get_port());
if (bind(m_sock, (struct sockaddr*)&server, sizeof(server)) == SOCKET_ERROR)
if (bind(m_sock, reinterpret_cast<struct sockaddr*>(&server), sizeof(server)) == SOCKET_ERROR)
{
Impl::error("IPC: Error while binding to socket! Shutting down...");
return;