Skip to content

Commit

Permalink
Fix compatibility of OPENTELEMETRY_LIKELY_IF
Browse files Browse the repository at this point in the history
Signed-off-by: owent <admin@owent.net>
  • Loading branch information
owent committed May 13, 2022
1 parent 5d07025 commit e80ac98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/include/opentelemetry/common/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@

#include "opentelemetry/version.h"

#ifndef OPENTELEMETRY_LIKELY_IF
#if !defined(OPENTELEMETRY_LIKELY_IF) && defined(__cplusplus)
# if defined(__has_cpp_attribute)
# if __has_cpp_attribute(likely)
# define OPENTELEMETRY_LIKELY_IF(...) \
if (__VA_ARGS__) \
[[likely]]
# endif
# elif defined(__clang__)
# elif __cplusplus >= 202002L && defined(__clang__)
# if __clang_major__ >= 12
# define OPENTELEMETRY_LIKELY_IF(...) \
if (__VA_ARGS__) \
[[likely]]
# endif
# elif defined(__GNUC__)
# elif __cplusplus >= 202002L && defined(__GNUC__)
# if __GNUC__ >= 9
# define OPENTELEMETRY_LIKELY_IF(...) \
if (__VA_ARGS__) \
Expand Down

0 comments on commit e80ac98

Please sign in to comment.