diff --git a/include/dpp/export.h b/include/dpp/export.h index e293aafccc..7895e79ec4 100644 --- a/include/dpp/export.h +++ b/include/dpp/export.h @@ -115,12 +115,10 @@ extern bool DPP_EXPORT validate_configuration(); } -#ifndef _WIN32 - #define SOCKET int -#else - #ifndef NOMINMAX - #define NOMINMAX - #endif +#ifdef _WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif #include #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