From dfd2660a85e4f0891c63009ee8425b2796586409 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 6 Jan 2018 01:21:59 +0100 Subject: 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 --- src/common/Utilities/AsioHacksFwd.h | 68 ------------------------------------ src/common/Utilities/AsioHacksImpl.h | 32 ----------------- src/common/Utilities/Util.cpp | 4 +-- 3 files changed, 2 insertions(+), 102 deletions(-) delete mode 100644 src/common/Utilities/AsioHacksFwd.h delete mode 100644 src/common/Utilities/AsioHacksImpl.h (limited to 'src/common/Utilities') 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 - * - * 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 . - */ - -#ifndef AsioHacksFwd_h__ -#define AsioHacksFwd_h__ - -namespace boost -{ - namespace posix_time - { - class ptime; - } - - namespace asio - { - namespace ip - { - class address; - - class tcp; - - template - class basic_endpoint; - - typedef basic_endpoint tcp_endpoint; - - template - class resolver_service; - - template - class basic_resolver; - - typedef basic_resolver> tcp_resolver; - } - - template - struct time_traits; - - template - class deadline_timer_service; - - template - class basic_deadline_timer; - - typedef basic_deadline_timer, deadline_timer_service>> 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 - * - * 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 . - */ - -#ifndef AsioHacksImpl_h__ -#define AsioHacksImpl_h__ - -#include - -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 +#include "IpAddress.h" #include #include #include @@ -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; } -- cgit v1.2.3