Skip to content

Commit

Permalink
Attempt to silence warning about deprecated stuff in Boost
Browse files Browse the repository at this point in the history
For some reason, after d7302d6 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.
  • Loading branch information
Vultraz authored and GregoryLundberg committed Nov 30, 2017
1 parent 18d1984 commit 1dbdcff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/server/server_base.hpp
Expand Up @@ -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>
Expand Down
29 changes: 19 additions & 10 deletions src/wesnothd_connection.hpp
Expand Up @@ -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>
Expand Down

0 comments on commit 1dbdcff

Please sign in to comment.