Skip to content

Commit

Permalink
Only define BOOST_ASIO_DISABLE_IOCP on Windows XP
Browse files Browse the repository at this point in the history
That define allows boost::asio::ip::tcp::socket::cancel to work on Windows XP, but there's no
reason to have it enabled on other Windows versions.
  • Loading branch information
Vultraz committed Nov 16, 2017
1 parent bc3c79a commit f626a2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/network_asio.hpp
Expand Up @@ -16,7 +16,9 @@

#ifdef _WIN32

#if _WIN32_WINNT == _WIN32_WINNT_WINXP
#define BOOST_ASIO_DISABLE_IOCP
#endif

#ifdef INADDR_ANY
#undef INADDR_ANY
Expand Down
2 changes: 2 additions & 0 deletions src/wesnothd_connection.hpp
Expand Up @@ -20,7 +20,9 @@
// gethostbyname in socket_ops.ipp. This define silences that.
#define _WINSOCK_DEPRECATED_NO_WARNINGS

#if _WIN32_WINNT == _WIN32_WINNT_WINXP
#define BOOST_ASIO_DISABLE_IOCP
#endif

#ifdef INADDR_ANY
#undef INADDR_ANY
Expand Down

5 comments on commit f626a2d

@jyrkive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not at all sure whether this will work correctly. There is no guarantee that @loonycyborg would set _WIN32_WINNT to exactly 0x0501 while compiling the Windows build.

@Vultraz
Copy link
Member Author

@Vultraz Vultraz commented on f626a2d Nov 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I should use < _WIN32_WINNT_VISTA then?

@jyrkive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean < _WIN32_WINNT_VISTA?

Yes, I think that would be reliable.

@GregoryLundberg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a #error and declare the platform unsupported. Quick .. raise a hand .. does anyone other than I even have an XT VM laying around for regression testing in case a user actually tries running on XT and hits a problem?

@Vultraz
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not "officially" dropping XP support until after 1.14, but we also aren't advertising it as supported anymore either.

Please sign in to comment.