Skip to content

Commit

Permalink
Fixing bare-metal compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jul 29, 2017
1 parent 1d8b15b commit 1e77e8a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/src/basic/BasicClient.h
Expand Up @@ -320,7 +320,7 @@ class BasicClient
typedef mqttsn::protocol::message::Willmsgresp<Message, TProtOpts> WillmsgrespMsg;

BasicClient() = default;
virtual ~BasicClient() = default;
~BasicClient() noexcept = default;

typedef typename Message::ReadIterator ReadIterator;

Expand Down Expand Up @@ -2474,7 +2474,9 @@ class BasicClient
++op->m_attempt;

PingreqMsg msg;
msg.field_clientId().value() = m_clientId;
auto& clientIdStorage = msg.field_clientId().value();
using ClientIdStorage = typename std::decay<decltype(clientIdStorage)>::type;
clientIdStorage = ClientIdStorage(m_clientId.c_str(), m_clientId.size());
sendMessage(msg);
return true;
}
Expand Down
12 changes: 12 additions & 0 deletions client/test/bare_metal_app/test_client_build/stub.cpp
Expand Up @@ -75,6 +75,18 @@ void* memcpy( void* dest, const void* src, std::size_t count )
return nullptr;
}

extern "C"
int memcmp(const void*, const void*, std::size_t)
{
return 0;
}

extern "C"
std::size_t strlen(const char*)
{
return 0U;
}

extern "C"
void __aeabi_uidiv()
{
Expand Down
3 changes: 3 additions & 0 deletions protocol/include/mqttsn/protocol/message/SubUnsubBase.h
Expand Up @@ -145,6 +145,9 @@ class SubUnsubBase : public

return refreshed;
}

protected:
~SubUnsubBase() noexcept = default;
};

} // namespace message
Expand Down
3 changes: 3 additions & 0 deletions protocol/include/mqttsn/protocol/message/WilltopicBase.h
Expand Up @@ -123,6 +123,9 @@ class WilltopicBase : public

return refreshed;
}

protected:
~WilltopicBase() noexcept = default;
};

} // namespace message
Expand Down

0 comments on commit 1e77e8a

Please sign in to comment.