|
25 | 25 | #include <boost/uuid/uuid.hpp>
|
26 | 26 | #include <boost/uuid/uuid_io.hpp>
|
27 | 27 |
|
| 28 | +#include "restc-cpp/boost_compatibility.h" |
28 | 29 | #include "restc-cpp/helper.h"
|
29 | 30 | #include "restc-cpp/Connection.h"
|
30 | 31 |
|
|
52 | 53 | # define RESTC_CPP_IO_BUFFER_SIZE (1024 * 16)
|
53 | 54 | #endif
|
54 | 55 |
|
55 |
| -#define RESTC_CPP_IN_COROUTINE_CATCH_ALL \ |
56 |
| - catch (boost::coroutines::detail::forced_unwind const&) { \ |
57 |
| - throw; /* required for Boost Coroutine! */ \ |
58 |
| - } catch (...) |
59 |
| - |
60 |
| -#if BOOST_VERSION >= 108100 |
61 |
| -// They changed the function signature. In boost 1.86 it broke the build. |
62 |
| -#define RESTC_CPP_SPAWN_TRAILER \ |
63 |
| - , boost::asio::detached |
64 |
| -#else |
65 |
| -#define RESTC_CPP_SPAWN_TRAILER |
66 |
| -#endif |
67 |
| - |
68 | 56 | namespace restc_cpp {
|
69 | 57 |
|
70 | 58 | class RestClient;
|
@@ -285,7 +273,7 @@ class Reply {
|
285 | 273 | * be fetched from the server. The data is safe to use until
|
286 | 274 | * the method is called again.
|
287 | 275 | */
|
288 |
| - virtual boost::asio::const_buffers_1 GetSomeData() = 0; |
| 276 | + virtual boost_const_buffer GetSomeData() = 0; |
289 | 277 |
|
290 | 278 | /*! Returns true as long as you have not yet pulled all
|
291 | 279 | * the data from the response.
|
@@ -350,15 +338,15 @@ class Context {
|
350 | 338 | const auto microseconds =
|
351 | 339 | std::chrono::duration_cast<std::chrono::microseconds>(
|
352 | 340 | duration).count();
|
353 |
| - boost::posix_time::microseconds ms(microseconds); |
| 341 | + ::boost::posix_time::microseconds ms(microseconds); |
354 | 342 | Sleep(ms);
|
355 | 343 | }
|
356 | 344 |
|
357 | 345 | /*! Asynchronously sleep for a period */
|
358 |
| - virtual void Sleep(const boost::posix_time::microseconds& ms) = 0; |
| 346 | + virtual void Sleep(const ::boost::posix_time::microseconds& ms) = 0; |
359 | 347 |
|
360 | 348 | static std::unique_ptr<Context>
|
361 |
| - Create(boost::asio::yield_context& yield, |
| 349 | + Create(::boost::asio::yield_context& yield, |
362 | 350 | RestClient& rc);
|
363 | 351 | };
|
364 | 352 |
|
@@ -442,7 +430,7 @@ class RestClient {
|
442 | 430 | }
|
443 | 431 |
|
444 | 432 | virtual std::shared_ptr<ConnectionPool> GetConnectionPool() = 0;
|
445 |
| - virtual boost::asio::io_service& GetIoService() = 0; |
| 433 | + virtual boost_io_service& GetIoService() = 0; |
446 | 434 |
|
447 | 435 | #ifdef RESTC_CPP_WITH_TLS
|
448 | 436 | virtual std::shared_ptr<boost::asio::ssl::context> GetTLSContext() = 0;
|
@@ -476,30 +464,30 @@ class RestClient {
|
476 | 464 |
|
477 | 465 | #ifdef RESTC_CPP_WITH_TLS
|
478 | 466 | static std::unique_ptr<RestClient> Create(
|
479 |
| - std::shared_ptr<boost::asio::ssl::context> ctx); |
| 467 | + std::shared_ptr<::boost::asio::ssl::context> ctx); |
480 | 468 | static std::unique_ptr<RestClient> Create(
|
481 |
| - std::shared_ptr<boost::asio::ssl::context> ctx, |
482 |
| - const boost::optional<Request::Properties>& properties); |
| 469 | + std::shared_ptr<::boost::asio::ssl::context> ctx, |
| 470 | + const ::boost::optional<Request::Properties>& properties); |
483 | 471 | static std::unique_ptr<RestClient> Create(
|
484 |
| - std::shared_ptr<boost::asio::ssl::context> ctx, |
485 |
| - const boost::optional<Request::Properties>& properties, |
486 |
| - boost::asio::io_service& ioservice); |
| 472 | + std::shared_ptr<::boost::asio::ssl::context> ctx, |
| 473 | + const ::boost::optional<Request::Properties>& properties, |
| 474 | + boost_io_service& ioservice); |
487 | 475 | #endif
|
488 | 476 |
|
489 | 477 | static std::unique_ptr<RestClient>
|
490 |
| - Create(const boost::optional<Request::Properties>& properties); |
| 478 | + Create(const ::boost::optional<Request::Properties>& properties); |
491 | 479 |
|
492 | 480 | static std::unique_ptr<RestClient> CreateUseOwnThread();
|
493 | 481 |
|
494 | 482 | static std::unique_ptr<RestClient>
|
495 |
| - CreateUseOwnThread(const boost::optional<Request::Properties>& properties); |
| 483 | + CreateUseOwnThread(const ::boost::optional<Request::Properties>& properties); |
496 | 484 |
|
497 | 485 | static std::unique_ptr<RestClient>
|
498 |
| - Create(const boost::optional<Request::Properties>& properties, |
499 |
| - boost::asio::io_service& ioservice); |
| 486 | + Create(const ::boost::optional<Request::Properties>& properties, |
| 487 | + boost_io_service& ioservice); |
500 | 488 |
|
501 | 489 | static std::unique_ptr<RestClient>
|
502 |
| - Create(boost::asio::io_service& ioservice); |
| 490 | + Create(boost_io_service& ioservice); |
503 | 491 |
|
504 | 492 |
|
505 | 493 | protected:
|
|
0 commit comments