Attempt to silence warning about deprecated stuff in Boost

For some reason, after d7302d684d9d a warning about Boost's use of gethostbyaddr and appeared
when compiling wesnothd_connection.cpp on Windows. No idea what change in the above commit caused
it, but it seems moving the _WINSOCK_DEPRECATED_NO_WARNINGS define to wesnothd_connection.hpp silences it.
This commit is contained in:
Charles Dang 2017-11-08 16:56:18 +11:00
parent 6a92a0fdcd
commit f1749c8d9b
2 changed files with 19 additions and 15 deletions

View File

@ -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 <boost/asio.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/shared_array.hpp>

View File

@ -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 <boost/asio.hpp>
#include <deque>
#include <list>