diff --git a/CMakeLists.txt b/CMakeLists.txt index 96606e6..7159fa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,14 +16,14 @@ option (MQTTSN_NO_WARN_AS_ERR "Don't treat compilation warnings as errors." OFF) # is not provided and examples are not disabled. if ("${COMMSDSL_TAG}" STREQUAL "") - set(COMMSDSL_TAG "v3.5.1") + set(COMMSDSL_TAG "v3.5.2") endif () if ("${COMMS_TAG}" STREQUAL "") - set(COMMS_TAG "v3.0.1") + set(COMMS_TAG "v3.1") endif () -set (VERSION "0.18.1") +set (VERSION "0.19") set (EXTERNALS_DIR "${PROJECT_SOURCE_DIR}/externals") @@ -55,7 +55,7 @@ if ("${COMMSDSL2COMMS}" STREQUAL "") -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${commsdsl2comms_install_dir} -DCOMMSDSL_NO_TESTS=ON -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBOOST_ROOT=${BOOST_ROOT} - ${boost_static_libs_param} + -DCOMMSDSL_EXTERNALS_DIR=${EXTERNALS_DIR} ${boost_static_libs_param} BINARY_DIR "${commsdsl2comms_bin_dir}" ) diff --git a/src/include/mqttsn/field/MsgLengthField.h.public b/src/include/mqttsn/field/MsgLengthField.h.public index 6fda4e2..1139107 100644 --- a/src/include/mqttsn/field/MsgLengthField.h.public +++ b/src/include/mqttsn/field/MsgLengthField.h.public @@ -22,3 +22,10 @@ void setLengthValue(std::size_t val) field_long().setExists(); field_long().field().value() = static_cast(val); } + +// Verifying compile time length calculations. +static constexpr std::size_t MinLen = Base::minLength(); +static constexpr std::size_t MaxLen = Base::maxLength(); +static_assert(MinLen == Field_short::minLength(), "Invalid length assumption"); +static_assert(MaxLen == (Field_short::maxLength() + Field_long::Field::maxLength()), + "Invalid length assumption"); \ No newline at end of file