aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-01-06 01:21:59 +0100
committerShauren <shauren.trinity@gmail.com>2018-01-06 01:21:59 +0100
commitdfd2660a85e4f0891c63009ee8425b2796586409 (patch)
tree26704dff3840402765ada5e6e4549a48b95ed82b /src/common/Utilities
parent76577ddc3ca4edd5943777443d9cf5a4c5314e10 (diff)
Core/Misc: Added compatibility layer for boost 1.66 and future std:: networking stuff
* Based on work done by @dimiandre in PR #21173 Closes #21171 Closes #21173
Diffstat (limited to 'src/common/Utilities')
-rw-r--r--src/common/Utilities/AsioHacksFwd.h68
-rw-r--r--src/common/Utilities/AsioHacksImpl.h32
-rw-r--r--src/common/Utilities/Util.cpp4
3 files changed, 2 insertions, 102 deletions
diff --git a/src/common/Utilities/AsioHacksFwd.h b/src/common/Utilities/AsioHacksFwd.h
deleted file mode 100644
index 113e41ac585..00000000000
--- a/src/common/Utilities/AsioHacksFwd.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef AsioHacksFwd_h__
-#define AsioHacksFwd_h__
-
-namespace boost
-{
- namespace posix_time
- {
- class ptime;
- }
-
- namespace asio
- {
- namespace ip
- {
- class address;
-
- class tcp;
-
- template <typename InternetProtocol>
- class basic_endpoint;
-
- typedef basic_endpoint<tcp> tcp_endpoint;
-
- template <typename InternetProtocol>
- class resolver_service;
-
- template <typename InternetProtocol, typename ResolverService>
- class basic_resolver;
-
- typedef basic_resolver<tcp, resolver_service<tcp>> tcp_resolver;
- }
-
- template <typename Time>
- struct time_traits;
-
- template <typename TimeType, typename TimeTraits>
- class deadline_timer_service;
-
- template <typename Time, typename TimeTraits, typename TimerService>
- class basic_deadline_timer;
-
- typedef basic_deadline_timer<posix_time::ptime, time_traits<posix_time::ptime>, deadline_timer_service<posix_time::ptime, time_traits<posix_time::ptime>>> deadline_timer;
- }
-}
-
-namespace Trinity
-{
- class AsioStrand;
-}
-
-#endif // AsioHacksFwd_h__
diff --git a/src/common/Utilities/AsioHacksImpl.h b/src/common/Utilities/AsioHacksImpl.h
deleted file mode 100644
index 458c6f76c2b..00000000000
--- a/src/common/Utilities/AsioHacksImpl.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef AsioHacksImpl_h__
-#define AsioHacksImpl_h__
-
-#include <boost/asio/strand.hpp>
-
-namespace Trinity
-{
- class AsioStrand : public boost::asio::io_service::strand
- {
- public:
- AsioStrand(boost::asio::io_service& io_service) : boost::asio::io_service::strand(io_service) { }
- };
-}
-
-#endif // AsioHacksImpl_h__
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp
index b316db31bfd..f34989c8546 100644
--- a/src/common/Utilities/Util.cpp
+++ b/src/common/Utilities/Util.cpp
@@ -18,7 +18,7 @@
#include "Util.h"
#include "Common.h"
-#include <boost/asio/ip/address.hpp>
+#include "IpAddress.h"
#include <utf8.h>
#include <algorithm>
#include <sstream>
@@ -216,7 +216,7 @@ bool IsIPAddress(char const* ipaddress)
return false;
boost::system::error_code error;
- boost::asio::ip::address::from_string(ipaddress, error);
+ Trinity::Net::make_address(ipaddress, error);
return !error;
}