Skip to content

Commit

Permalink
iox-eclipse-iceoryx#743 adjusted endif and using elif instead of else…
Browse files Browse the repository at this point in the history
… and another if in attribute macros

Signed-off-by: Christian Eltzschig <[email protected]>
  • Loading branch information
elfenpiff committed Apr 20, 2021
1 parent 612d5de commit ff8edb8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions iceoryx_utils/include/iceoryx_utils/cxx/attributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ namespace cxx
// on an unknown platform we use for now nothing since we do not know what is supported there
#define IOX_NO_DISCARD
#endif
#endif

/// @brief IOX_FALLTHROUGH adds the [[fallthrough]] keyword when it is available for the current compiler.
/// @note
Expand All @@ -58,31 +57,27 @@ namespace cxx
/// activate keywords for gcc>=7 or clang>=4
#if (defined(__GNUC__) && __GNUC__ >= 7) || (defined(__clang__) && __clang_major__ >= 4)
#define IOX_FALLTHROUGH [[fallthrough]] // NOLINT
#else
#elif defined(_WIN32)
// On WIN32 we are using C++17 which makes the keyword [[fallthrough]] available
#if defined(_WIN32)
#define IOX_FALLTHROUGH [[fallthrough]] // NOLINT
// on an unknown platform we use for now nothing since we do not know what is supported there
#else
#define IOX_FALLTHROUGH
#endif
#endif

/// @brief IOX_MAYBE_UNUSED adds the [[gnu::unused]] or [[maybe_unused]] attribute when it is available for the current
/// compiler.
/// @note
/// activate attribute for gcc or clang
#if defined(__GNUC__) || defined(__clang__)
#define IOX_MAYBE_UNUSED [[gnu::unused]] // NOLINT
#else
#elif defined(_WIN32)
// On WIN32 we are using C++17 which makes the attribute [[maybe_unused]] available
#if defined(_WIN32)
#define IOX_MAYBE_UNUSED [[maybe_unused]] // NOLINT
// on an unknown platform we use for now nothing since we do not know what is supported there
#else
#define IOX_MAYBE_UNUSED
#endif
#endif


} // namespace cxx
Expand Down

0 comments on commit ff8edb8

Please sign in to comment.