Skip to content

Commit

Permalink
Only check for GCC version if GCC is used. (#228)
Browse files Browse the repository at this point in the history
This fixes #227.
  • Loading branch information
aentinger committed Apr 13, 2023
1 parent c86ec38 commit 8fb3385
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Node::Node(uint8_t * heap_ptr,
* PUBLIC MEMBER FUNCTIONS
**************************************************************************************/

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)
Registry Node::create_registry()
{
return std::make_shared<impl::Registry>(*this, _micros_func);
Expand Down
2 changes: 1 addition & 1 deletion src/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Node
template <typename T_REQ, typename T_RSP, typename OnResponseCb>
ServiceClient<T_REQ> create_service_client(CanardPortID const response_port_id, CanardMicrosecond const tx_timeout_usec, OnResponseCb&& on_response_cb, CanardMicrosecond const tid_timeout_usec = CANARD_DEFAULT_TRANSFER_ID_TIMEOUT_USEC);

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)
Registry create_registry();
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/util/registry/Registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "registry_impl.hpp"

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

/**************************************************************************************
* NAMESPACE
Expand Down Expand Up @@ -113,6 +113,6 @@ class Registry final : public registry::Registry

} /* impl */

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */

#endif /* REGISTER_LIST_H_ */
4 changes: 2 additions & 2 deletions src/util/registry/cavl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <cstdint>
#include <type_traits>

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

/// If CAVL is used in throughput-critical code, then it is recommended to disable assertion checks as they may
/// be costly in terms of execution time.
Expand Down Expand Up @@ -633,4 +633,4 @@ class Tree final

} // namespace cavl

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */
4 changes: 2 additions & 2 deletions src/util/registry/registry_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "registry_value.hpp"

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

namespace registry
{
Expand Down Expand Up @@ -78,4 +78,4 @@ class IIntrospectableRegistry : public IRegistry

} // namespace registry

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */
4 changes: 2 additions & 2 deletions src/util/registry/registry_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "cavl.hpp" // Copy from https://github.com/pavel-kirienko/cavl/blob/main/c%2B%2B/cavl.hpp
#include <memory>

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

namespace registry
{
Expand Down Expand Up @@ -387,4 +387,4 @@ class Registry : public IIntrospectableRegistry

using Registry = std::shared_ptr<registry::Registry>;

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */
4 changes: 2 additions & 2 deletions src/util/registry/registry_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "../../DSDL_Types.h"

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

namespace registry
{
Expand Down Expand Up @@ -275,4 +275,4 @@ Value makeValue(const Ts&... src)

} // namespace registry

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */
4 changes: 2 additions & 2 deletions src/util/storage/KeyValueStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

#include <string_view>
#include <optional>
Expand Down Expand Up @@ -60,4 +60,4 @@ class KeyValueStorage

} /* cyphal::support::platform::storage */

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */
4 changes: 2 additions & 2 deletions src/util/storage/register_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#if __GNUC__ >= 11
#if !defined(__GNUC__) || (__GNUC__ >= 11)

#include "KeyValueStorage.hpp"

Expand Down Expand Up @@ -135,4 +135,4 @@ template <typename ResetPredicate>

} /* namespace cyphal::support */

#endif /* __GNUC__ >= 11 */
#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */

0 comments on commit 8fb3385

Please sign in to comment.