Skip to content

Commit 5bff3c8

Browse files
authored
Merge pull request #935 from redboltz/fix_934
Fixed #934.
2 parents a885735 + b7bfdcf commit 5bff3c8

17 files changed

+48
-78
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 13.0.0
2+
* <<<< breaking change >>>> Minimum boost requirement is 1.74.0. (#934)
3+
* Modulized store. (#933)
4+
* Improved compile times and memory consumption. (#931)
5+
* Improved MQTT_STD_XXX behavior. (#929)
6+
* Improved build system. (#927)
7+
18
## 12.1.0
29
* Improved CI (#930)
310
* Improved MQTT_STD_XXX support (#929)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ ELSE ()
136136
MESSAGE (STATUS "Logging disabled")
137137
SET (MQTT_BOOST_COMPONENTS system date_time program_options)
138138
ENDIF ()
139-
FIND_PACKAGE (Boost 1.67.0 REQUIRED COMPONENTS ${MQTT_BOOST_COMPONENTS})
139+
FIND_PACKAGE (Boost 1.74.0 REQUIRED COMPONENTS ${MQTT_BOOST_COMPONENTS})
140140

141141
IF (MQTT_NO_TS_EXECUTORS AND ((Boost_MAJOR_VERSION LESS 1) OR (Boost_MINOR_VERSION LESS 74)))
142142
MESSAGE(FATAL_ERROR "Boost version 1.74.0 or later is required for use with standard executors")

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# MQTT client/server for C++14 based on Boost.Asio
22

3-
Version 12.1.0 [![Actions Status](https://github.com/redboltz/mqtt_cpp/workflows/CI/badge.svg)](https://github.com/redboltz/mqtt_cpp/actions)[![Build Status](https://dev.azure.com/redboltz/redboltz/_apis/build/status/redboltz.mqtt_cpp?branchName=master)](https://dev.azure.com/redboltz/redboltz/_build/latest?definitionId=6&branchName=master)[![codecov](https://codecov.io/gh/redboltz/mqtt_cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/redboltz/mqtt_cpp)
3+
Version 13.0.0 [![Actions Status](https://github.com/redboltz/mqtt_cpp/workflows/CI/badge.svg)](https://github.com/redboltz/mqtt_cpp/actions)[![Build Status](https://dev.azure.com/redboltz/redboltz/_apis/build/status/redboltz.mqtt_cpp?branchName=master)](https://dev.azure.com/redboltz/redboltz/_build/latest?definitionId=6&branchName=master)[![codecov](https://codecov.io/gh/redboltz/mqtt_cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/redboltz/mqtt_cpp)
44

55
Important note https://github.com/redboltz/mqtt_cpp/wiki/News.
66

77
[MQTT v5 is supported](https://github.com/redboltz/mqtt_cpp/wiki/MQTT-v5) since version 4.0.0.
88

99
## Overview
1010

11-
mqtt_cpp is a header only library. It requires C++14 and the Boost Libraries 1.67.0 or later.
11+
mqtt_cpp is a header only library. It requires C++14 and the Boost Libraries 1.74.0 or later.
1212

1313
Add mqtt_cpp/include to your include path. Then, include `mqtt_client_cpp.hpp` and/or `mqtt_server_cpp.hpp` as follows:
1414

@@ -117,8 +117,6 @@ make
117117
make test
118118
```
119119

120-
In order to build tests, you need to prepare the Boost Libraries 1.59.0.
121-
122120
## Documents
123121
https://github.com/redboltz/mqtt_cpp/wiki
124122

cmake/Config.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SET (Boost_USE_MULTITHREADED ON)
22
include(CMakeFindDependencyMacro)
33
FIND_DEPENDENCY (Threads)
4-
FIND_DEPENDENCY (Boost 1.67.0 COMPONENTS @MQTT_BOOST_COMPONENTS@)
4+
FIND_DEPENDENCY (Boost 1.74.0 COMPONENTS @MQTT_BOOST_COMPONENTS@)
55
@MQTT_DEPENDS_OPENSSL@
66
@MQTT_DEPENDS_ZLIB@
77

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ IF (UNIX)
2020
)
2121
ENDIF ()
2222

23-
FIND_PACKAGE (Boost 1.67.0 REQUIRED COMPONENTS program_options)
23+
FIND_PACKAGE (Boost 1.74.0 REQUIRED COMPONENTS program_options)
2424

2525
IF (MQTT_USE_TLS)
2626
LIST (APPEND exec_PROGRAMS

example/client_cli.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// http://www.boost.org/LICENSE_1_0.txt)
66

7+
#include <mqtt/config.hpp>
8+
79
#include <iostream>
810
#include <iomanip>
911
#include <fstream>
1012

1113
#include <boost/program_options.hpp>
1214
#include <boost/format.hpp>
1315

14-
#include <mqtt_client_cpp.hpp>
16+
#include <mqtt/setup_log.hpp>
17+
#include <mqtt/sync_client.hpp>
18+
#include <mqtt/unique_scope_guard.hpp>
1519

1620
inline void print_props(std::string prefix, MQTT_NS::v5::properties const& props) {
1721
for (auto const& p : props) {

include/mqtt/broker/uuid.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MQTT_BROKER_NS_BEGIN
1919

2020
inline std::string create_uuid_string() {
2121
// See https://github.com/boostorg/uuid/issues/121
22-
thread_local auto gen = boost::uuids::random_generator();
22+
thread_local boost::uuids::random_generator gen;
2323
return boost::uuids::to_string(gen());
2424
}
2525

include/mqtt/setup_log.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ void setup_log(severity_level threshold = severity_level::warning) {
138138
{ "mqtt_cb", threshold },
139139
{ "mqtt_impl", threshold },
140140
{ "mqtt_broker", threshold },
141+
{ "mqtt_test", threshold },
141142
}
142143
);
143144
}

include/mqtt/string_view.hpp

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ using std::basic_string_view;
2727

2828
#include <boost/version.hpp>
2929

30-
#if !defined(MQTT_NO_BOOST_STRING_VIEW)
31-
32-
#if BOOST_VERSION >= 106100
33-
34-
#define MQTT_NO_BOOST_STRING_VIEW 0
35-
3630
#include <boost/utility/string_view.hpp>
3731
#include <boost/container_hash/hash_fwd.hpp>
3832

@@ -45,48 +39,18 @@ using basic_string_view = boost::basic_string_view<CharT, Traits>;
4539

4640
} // namespace MQTT_NS
4741

48-
#if BOOST_VERSION < 106900
49-
namespace boost {
50-
template <class charT, class traits>
51-
std::size_t hash_value(basic_string_view<charT, traits> s) {
52-
return hash_range(s.begin(), s.end());
53-
}
54-
}
55-
56-
#endif // BOOST_VERSION < 106900
57-
58-
#else // BOOST_VERSION >= 106100
59-
60-
#define MQTT_NO_BOOST_STRING_VIEW 1
61-
62-
#include <boost/utility/string_ref.hpp>
63-
64-
namespace MQTT_NS {
65-
66-
using string_view = boost::string_ref;
67-
68-
template<class CharT, class Traits = std::char_traits<CharT> >
69-
using basic_string_view = boost::basic_string_ref<CharT, Traits>;
70-
71-
} // namespace MQTT_NS
72-
73-
#endif // BOOST_VERSION >= 106100
74-
75-
76-
#endif // !defined(MQTT_NO_BOOST_STRING_VIEW)
77-
7842
#endif // !defined(MQTT_STD_STRING_VIEW)
7943

8044
namespace MQTT_NS {
8145

8246
namespace detail {
83-
47+
8448
template<class T>
8549
T* to_address(T* p) noexcept
8650
{
8751
return p;
8852
}
89-
53+
9054
template<class T>
9155
auto to_address(const T& p) noexcept
9256
{

include/mqtt/tcp_endpoint.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ class tcp_endpoint : public socket {
115115
tcp_.lowest_layer().close(ec);
116116
}
117117

118-
#if BOOST_VERSION < 107400 || defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
118+
#if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
119119
MQTT_ALWAYS_INLINE as::executor get_executor() override final {
120120
return lowest_layer().get_executor();
121121
}
122-
#else // BOOST_VERSION < 107400 || defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
122+
#else // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
123123
MQTT_ALWAYS_INLINE as::any_io_executor get_executor() override final {
124124
return lowest_layer().get_executor();
125125
}
126-
#endif // BOOST_VERSION < 107400 || defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
126+
#endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
127127

128128
auto& socket() { return tcp_; }
129129
auto const& socket() const { return tcp_; }

0 commit comments

Comments
 (0)