Skip to content

Commit

Permalink
Merge branch 'main' into fix-attributes-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Jan 18, 2024
2 parents 594215c + 589dd2a commit d3cfa08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@
// C++ Version Check
// -----------------------------------------------------------------------------

// Enforce C++11 as the minimum. Note that Visual Studio has not
// advanced __cplusplus despite being good enough for our purposes, so
// so we exempt it from the check.
#if defined(__cplusplus) && !defined(_MSC_VER)
// Enforce C++11 as the minimum.
#if defined(_MSVC_LANG)
#if _MSVC_LANG < 201103L
#error "C++ versions less than C++11 are not supported."
#endif // _MSVC_LANG < 201103L
#elif defined(__cplusplus)
#if __cplusplus < 201103L
#error "C++ versions less than C++11 are not supported."
#endif
#endif // __cplusplus < 201103L
#endif

// -----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ using underlying_type_t = typename std::underlying_type<T>::type;

namespace type_traits_internal {

#if __cplusplus >= 201703L
#if (!defined(_MSVC_LANG) && (__cplusplus >= 201703L)) || \
(defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))
// std::result_of is deprecated (C++17) or removed (C++20)
template<typename> struct result_of;
template<typename F, typename... Args>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ void print_value(const nostd::span<T> &vec, std::ostream &sout)
}

// Prior to C++14, generic lambda is not available so fallback to functor.
#if __cplusplus < 201402L
#if (!defined(_MSVC_LANG) && (__cplusplus < 201402L)) || \
(defined(_MSVC_LANG) && (_MSVC_LANG < 201402L))

class OwnedAttributeValueVisitor
{
Expand Down Expand Up @@ -97,7 +98,8 @@ class AttributeValueVisitor
inline void print_value(const opentelemetry::sdk::common::OwnedAttributeValue &value,
std::ostream &sout)
{
#if __cplusplus < 201402L
#if (!defined(_MSVC_LANG) && (__cplusplus < 201402L)) || \
(defined(_MSVC_LANG) && (_MSVC_LANG < 201402L))
opentelemetry::nostd::visit(OwnedAttributeValueVisitor(sout), value);
#else
opentelemetry::nostd::visit(
Expand All @@ -111,7 +113,8 @@ inline void print_value(const opentelemetry::sdk::common::OwnedAttributeValue &v

inline void print_value(const opentelemetry::common::AttributeValue &value, std::ostream &sout)
{
#if __cplusplus < 201402L
#if (!defined(_MSVC_LANG) && (__cplusplus < 201402L)) || \
(defined(_MSVC_LANG) && (_MSVC_LANG < 201402L))
opentelemetry::nostd::visit(AttributeValueVisitor(sout), value);
#else
opentelemetry::nostd::visit(
Expand Down

0 comments on commit d3cfa08

Please sign in to comment.