Skip to content

Commit

Permalink
Reflect changes in boost::asio released in Boost 1.66.
Browse files Browse the repository at this point in the history
The service template parameters are disabled by default for now.
Use BOOST_ASIO_ENABLE_OLD_SERVICES macro to enable the old interface.
  • Loading branch information
Raphnalor committed Mar 10, 2018
1 parent b2faf30 commit 75276d5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/serializer/Connection.cpp
Expand Up @@ -14,6 +14,9 @@
#include "../mapping/CMap.h"
#include "../CGameState.h"

#if BOOST_VERSION >= 106600
#define BOOST_ASIO_ENABLE_OLD_SERVICES
#endif
#include <boost/asio.hpp>

using namespace boost;
Expand Down
8 changes: 8 additions & 0 deletions lib/serializer/Connection.h
Expand Up @@ -12,6 +12,8 @@
#include "BinaryDeserializer.h"
#include "BinarySerializer.h"

#include <boost/version.hpp>

struct CPack;

namespace boost
Expand All @@ -22,7 +24,13 @@ namespace boost
{
class tcp;
}

#if BOOST_VERSION >= 106600 // Boost version >= 1.66
class io_context;
typedef io_context io_service;
#else
class io_service;
#endif

template <typename Protocol> class stream_socket_service;
template <typename Protocol,typename StreamSocketService>
Expand Down
3 changes: 3 additions & 0 deletions server/CVCMIServer.cpp
Expand Up @@ -9,6 +9,9 @@
*/
#include "StdInc.h"

#if BOOST_VERSION >= 106600
#define BOOST_ASIO_ENABLE_OLD_SERVICES
#endif
#include <boost/asio.hpp>

#include "../lib/filesystem/Filesystem.h"
Expand Down
9 changes: 8 additions & 1 deletion server/CVCMIServer.h
Expand Up @@ -10,6 +10,7 @@
#pragma once

#include <boost/program_options.hpp>
#include <boost/version.hpp>

class CMapInfo;

Expand All @@ -26,7 +27,13 @@ namespace boost
{
class tcp;
}
class io_service;

#if BOOST_VERSION >= 106600 // Boost version >= 1.66
class io_context;
typedef io_context io_service;
#else
class io_service;
#endif

template <typename Protocol> class stream_socket_service;
template <typename Protocol,typename StreamSocketService>
Expand Down

0 comments on commit 75276d5

Please sign in to comment.