diff --git a/src/server/server_base.hpp b/src/server/server_base.hpp index 8e11cdccf24b9..451dd1fc9cdf7 100644 --- a/src/server/server_base.hpp +++ b/src/server/server_base.hpp @@ -21,11 +21,6 @@ #include "exceptions.hpp" -// MSVC compilation throws deprecation warnings on boost's use of gethostbyaddr and gethostbyname in socket_ops.ipp -#ifdef _WIN32 -#define _WINSOCK_DEPRECATED_NO_WARNINGS -#endif - #include #include #include diff --git a/src/wesnothd_connection.hpp b/src/wesnothd_connection.hpp index 9486f7c25e7ef..b42aba6472ae5 100644 --- a/src/wesnothd_connection.hpp +++ b/src/wesnothd_connection.hpp @@ -15,18 +15,27 @@ #pragma once #ifdef _WIN32 -# define BOOST_ASIO_DISABLE_IOCP -# ifdef INADDR_ANY -# undef INADDR_ANY -# endif -# ifdef INADDR_BROADCAST -# undef INADDR_BROADCAST -# endif -# ifdef INADDR_NONE -# undef INADDR_NONE -# endif + +// MSVC compilation throws deprecation warnings on boost's use of gethostbyaddr and +// gethostbyname in socket_ops.ipp. This define silences that. +#define _WINSOCK_DEPRECATED_NO_WARNINGS + +#define BOOST_ASIO_DISABLE_IOCP + +#ifdef INADDR_ANY +#undef INADDR_ANY +#endif + +#ifdef INADDR_BROADCAST +#undef INADDR_BROADCAST +#endif + +#ifdef INADDR_NONE +#undef INADDR_NONE #endif +#endif // endif _WIN32 + #include #include #include