From e7a895c82a385a0edcbb3cc876de69360adae10d Mon Sep 17 00:00:00 2001 From: Tracer <43095317+TracerDS@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:50:31 +0200 Subject: [PATCH] Updated socket --- include/dpp/export.h | 7 +------ include/dpp/socket.h | 12 +++++------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/include/dpp/export.h b/include/dpp/export.h index 5ece08ef36..7895e79ec4 100644 --- a/include/dpp/export.h +++ b/include/dpp/export.h @@ -46,7 +46,6 @@ #else /* Including the library */ #ifdef _WIN32 - #include #define DPP_EXPORT __declspec(dllimport) #else #define DPP_EXPORT @@ -116,11 +115,7 @@ extern bool DPP_EXPORT validate_configuration(); } -#ifndef _WIN32 - #ifndef SOCKET - #define SOCKET int - #endif -#else +#ifdef _WIN32 #ifndef NOMINMAX #define NOMINMAX #endif diff --git a/include/dpp/socket.h b/include/dpp/socket.h index 04d1080035..d94914b35a 100644 --- a/include/dpp/socket.h +++ b/include/dpp/socket.h @@ -1,18 +1,16 @@ #pragma once -#ifndef _WIN32 -#ifndef SOCKET -#define SOCKET int -#endif -#endif - namespace dpp { /** * @brief Represents a socket file descriptor. * This is used to ensure parity between windows and unix-like systems. */ - typedef SOCKET socket; +#ifndef _WIN32 + using socket = int; +#else + using socket = SOCKET; +#endif } // namespace dpp #ifndef SOCKET_ERROR