Lines 1-211
Link Here
|
1 |
https://github.com/MusicPlayerDaemon/ncmpc/commit/b6c25f3b5fa5 |
|
|
2 |
https://github.com/MusicPlayerDaemon/ncmpc/commit/4f767b38e527 |
3 |
|
4 |
--- src/LyricsPage.cxx.orig 2018-10-22 17:04:35 UTC |
5 |
+++ src/LyricsPage.cxx |
6 |
@@ -75,7 +75,7 @@ class LyricsPage final : public TextPage { (public) |
7 |
} |
8 |
|
9 |
auto &get_io_service() noexcept { |
10 |
- return loader_timeout.get_io_service(); |
11 |
+ return screen.get_io_service(); |
12 |
} |
13 |
|
14 |
private: |
15 |
--- src/aconnect.cxx.orig 2018-10-22 17:04:35 UTC |
16 |
+++ src/aconnect.cxx |
17 |
@@ -125,7 +125,7 @@ aconnect_start(boost::asio::io_service &io_service, |
18 |
|
19 |
*acp = ac; |
20 |
|
21 |
- ac->rconnect.Start(host, port); |
22 |
+ ac->rconnect.Start(io_service, host, port); |
23 |
} |
24 |
|
25 |
void |
26 |
--- src/keyboard.cxx.orig 2018-10-22 17:04:35 UTC |
27 |
+++ src/keyboard.cxx |
28 |
@@ -43,7 +43,7 @@ void |
29 |
UserInput::OnReadable(const boost::system::error_code &error) |
30 |
{ |
31 |
if (error) { |
32 |
- d.get_io_service().stop(); |
33 |
+ get_io_context().stop(); |
34 |
return; |
35 |
} |
36 |
|
37 |
@@ -81,7 +81,7 @@ UserInput::OnReadable(const boost::system::error_code |
38 |
|
39 |
begin_input_event(); |
40 |
|
41 |
- if (!do_input_event(d.get_io_service(), cmd)) |
42 |
+ if (!do_input_event(get_io_context(), cmd)) |
43 |
return; |
44 |
|
45 |
end_input_event(); |
46 |
@@ -89,7 +89,11 @@ UserInput::OnReadable(const boost::system::error_code |
47 |
} |
48 |
|
49 |
UserInput::UserInput(boost::asio::io_service &io_service, WINDOW &_w) |
50 |
- :d(io_service), w(_w) |
51 |
+ :d(io_service), |
52 |
+#if BOOST_VERSION >= 107000 |
53 |
+ io_context(io_service), |
54 |
+#endif |
55 |
+ w(_w) |
56 |
{ |
57 |
d.assign(STDIN_FILENO); |
58 |
AsyncWait(); |
59 |
--- src/keyboard.hxx.orig 2018-10-22 17:04:35 UTC |
60 |
+++ src/keyboard.hxx |
61 |
@@ -28,10 +28,23 @@ |
62 |
|
63 |
class UserInput { |
64 |
boost::asio::posix::stream_descriptor d; |
65 |
+ |
66 |
+#if BOOST_VERSION >= 107000 |
67 |
+ boost::asio::io_context &io_context; |
68 |
+#endif |
69 |
+ |
70 |
WINDOW &w; |
71 |
|
72 |
public: |
73 |
UserInput(boost::asio::io_service &io_service, WINDOW &_w); |
74 |
+ |
75 |
+ auto &get_io_context() noexcept { |
76 |
+#if BOOST_VERSION >= 107000 |
77 |
+ return io_context; |
78 |
+#else |
79 |
+ return d.get_io_service(); |
80 |
+#endif |
81 |
+ } |
82 |
|
83 |
private: |
84 |
void AsyncWait() { |
85 |
--- src/lirc.cxx.orig 2018-10-22 17:04:35 UTC |
86 |
+++ src/lirc.cxx |
87 |
@@ -37,7 +37,7 @@ LircInput::OnReadable(const boost::system::error_code |
88 |
if (lirc_nextcode(&code) == 0) { |
89 |
while (lirc_code2char(lc, code, &txt) == 0 && txt != nullptr) { |
90 |
const auto cmd = get_key_command_from_name(txt); |
91 |
- if (!do_input_event(d.get_io_service(), cmd)) |
92 |
+ if (!do_input_event(get_io_context(), cmd)) |
93 |
return; |
94 |
} |
95 |
} |
96 |
@@ -48,6 +48,9 @@ LircInput::OnReadable(const boost::system::error_code |
97 |
|
98 |
LircInput::LircInput(boost::asio::io_service &io_service) |
99 |
:d(io_service) |
100 |
+#if BOOST_VERSION >= 107000 |
101 |
+ , io_context(io_service) |
102 |
+#endif |
103 |
{ |
104 |
int lirc_socket = 0; |
105 |
|
106 |
--- src/lirc.hxx.orig 2018-10-22 17:04:35 UTC |
107 |
+++ src/lirc.hxx |
108 |
@@ -26,11 +26,24 @@ |
109 |
|
110 |
class LircInput { |
111 |
boost::asio::posix::stream_descriptor d; |
112 |
+ |
113 |
+#if BOOST_VERSION >= 107000 |
114 |
+ boost::asio::io_context &io_context; |
115 |
+#endif |
116 |
+ |
117 |
struct lirc_config *lc = nullptr; |
118 |
|
119 |
public: |
120 |
explicit LircInput(boost::asio::io_service &io_service); |
121 |
~LircInput(); |
122 |
+ |
123 |
+ auto &get_io_context() noexcept { |
124 |
+#if BOOST_VERSION >= 107000 |
125 |
+ return io_context; |
126 |
+#else |
127 |
+ return d.get_io_service(); |
128 |
+#endif |
129 |
+ } |
130 |
|
131 |
private: |
132 |
void AsyncWait() { |
133 |
--- src/mpdclient.cxx.orig 2018-10-22 17:04:35 UTC |
134 |
+++ src/mpdclient.cxx |
135 |
@@ -156,6 +156,9 @@ mpdclient::mpdclient(boost::asio::io_service &io_servi |
136 |
const char *_host, unsigned _port, |
137 |
unsigned _timeout_ms, const char *_password) |
138 |
:timeout_ms(_timeout_ms), password(_password), |
139 |
+#if BOOST_VERSION >= 107000 |
140 |
+ io_context(io_service), |
141 |
+#endif |
142 |
enter_idle_timer(io_service) |
143 |
{ |
144 |
#ifdef ENABLE_ASYNC_CONNECT |
145 |
--- src/mpdclient.hxx.orig 2018-10-22 17:04:35 UTC |
146 |
+++ src/mpdclient.hxx |
147 |
@@ -71,6 +71,10 @@ struct mpdclient final |
148 |
struct mpd_status *status = nullptr; |
149 |
const struct mpd_song *current_song = nullptr; |
150 |
|
151 |
+#if BOOST_VERSION >= 107000 |
152 |
+ boost::asio::io_context &io_context; |
153 |
+#endif |
154 |
+ |
155 |
/** |
156 |
* A timer which re-enters MPD idle mode before the next main |
157 |
* loop iteration. |
158 |
@@ -130,7 +134,11 @@ struct mpdclient final |
159 |
} |
160 |
|
161 |
auto &get_io_service() noexcept { |
162 |
+#if BOOST_VERSION >= 107000 |
163 |
+ return io_context; |
164 |
+#else |
165 |
return enter_idle_timer.get_io_service(); |
166 |
+#endif |
167 |
} |
168 |
|
169 |
#ifdef ENABLE_ASYNC_CONNECT |
170 |
--- src/net/AsyncResolveConnect.cxx.orig 2018-10-22 17:04:35 UTC |
171 |
+++ src/net/AsyncResolveConnect.cxx |
172 |
@@ -54,7 +54,8 @@ AsyncResolveConnect::OnResolved(const boost::system::e |
173 |
} |
174 |
|
175 |
void |
176 |
-AsyncResolveConnect::Start(const char *host, unsigned port) noexcept |
177 |
+AsyncResolveConnect::Start(boost::asio::io_service &io_service, |
178 |
+ const char *host, unsigned port) noexcept |
179 |
{ |
180 |
#ifndef _WIN32 |
181 |
if (host[0] == '/' || host[0] == '@') { |
182 |
@@ -64,7 +65,7 @@ AsyncResolveConnect::Start(const char *host, unsigned |
183 |
s.front() = 0; |
184 |
|
185 |
boost::asio::local::stream_protocol::endpoint ep(std::move(s)); |
186 |
- boost::asio::local::stream_protocol::socket socket(resolver.get_io_service()); |
187 |
+ boost::asio::local::stream_protocol::socket socket(io_service); |
188 |
|
189 |
boost::system::error_code error; |
190 |
socket.connect(ep, error); |
191 |
@@ -76,6 +77,8 @@ AsyncResolveConnect::Start(const char *host, unsigned |
192 |
handler.OnConnect(std::move(socket)); |
193 |
return; |
194 |
} |
195 |
+#else |
196 |
+ (void)io_service; |
197 |
#endif /* _WIN32 */ |
198 |
|
199 |
char service[20]; |
200 |
--- src/net/AsyncResolveConnect.hxx.orig 2018-10-22 17:04:35 UTC |
201 |
+++ src/net/AsyncResolveConnect.hxx |
202 |
@@ -47,7 +47,8 @@ class AsyncResolveConnect { (public) |
203 |
/** |
204 |
* Resolve a host name and connect to it asynchronously. |
205 |
*/ |
206 |
- void Start(const char *host, unsigned port) noexcept; |
207 |
+ void Start(boost::asio::io_service &io_service, |
208 |
+ const char *host, unsigned port) noexcept; |
209 |
|
210 |
private: |
211 |
void OnResolved(const boost::system::error_code &error, |