Skip to content

Commit

Permalink
Setting alignment requirements on the dummy client structs (to fix gi…
Browse files Browse the repository at this point in the history
…thub issue #3).
  • Loading branch information
arobenko committed Nov 18, 2024
1 parent d693e6a commit 583f9a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 0 additions & 1 deletion client/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ if ((NOT CC_MQTTSN_CLIENT_DEFAULT_LIB) AND
return()
endif ()


######################################################################

set (HEADER_TEMPL ${CMAKE_CURRENT_SOURCE_DIR}/templ/client.h.templ)
Expand Down
24 changes: 15 additions & 9 deletions client/lib/templ/client.cpp.templ
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@

#include <limits>

struct CC_MqttsnClient {};
struct CC_MqttsnSearch {};
struct CC_MqttsnConnect {};
struct CC_MqttsnDisconnect {};
struct CC_MqttsnSubscribe {};
struct CC_MqttsnUnsubscribe {};
struct CC_MqttsnPublish {};
struct CC_MqttsnWill {};
struct CC_MqttsnSleep {};
struct alignas(alignof(cc_mqttsn_client::ClientImpl)) CC_MqttsnClient {};
struct alignas(alignof(cc_mqttsn_client::op::ConnectOp)) CC_MqttsnConnect {};
struct alignas(alignof(cc_mqttsn_client::op::DisconnectOp)) CC_MqttsnDisconnect {};
struct alignas(alignof(cc_mqttsn_client::op::SubscribeOp)) CC_MqttsnSubscribe {};
struct alignas(alignof(cc_mqttsn_client::op::UnsubscribeOp)) CC_MqttsnUnsubscribe {};
struct alignas(alignof(cc_mqttsn_client::op::SendOp)) CC_MqttsnPublish {};
struct alignas(alignof(cc_mqttsn_client::op::DisconnectOp)) CC_MqttsnSleep {};

#if CC_MQTTSN_CLIENT_HAS_GATEWAY_DISCOVERY
struct alignas(alignof(cc_mqttsn_client::op::SearchOp)) CC_MqttsnSearch {};
#endif // #if CC_MQTTSN_CLIENT_HAS_GATEWAY_DISCOVERY

#if CC_MQTTSN_CLIENT_HAS_WILL
struct alignas(alignof(cc_mqttsn_client::op::WillOp)) CC_MqttsnWill {};
#endif // #if CC_MQTTSN_CLIENT_HAS_WILL

namespace
{
Expand Down

0 comments on commit 583f9a4

Please sign in to comment.