Skip to content

Commit b70674b

Browse files
authored
Patches
1 parent aee08b6 commit b70674b

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

api/include/opentelemetry/config.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33

44
#pragma once
55

6-
#ifndef __has_include
7-
# define OPENTELEMETRY_HAS_INCLUDE(x) 0
8-
#else
9-
# define OPENTELEMETRY_HAS_INCLUDE(x) __has_include(x)
10-
#endif
6+
#include <type_traits> // IWYU pragma: keep
117

12-
#if !defined(__GLIBCXX__) || OPENTELEMETRY_HAS_INCLUDE(<codecvt>) // >= libstdc++-5
8+
#if !defined(__GLIBCXX__) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7) || \
9+
(defined(__GLIBCXX__) && __GLIBCXX__ >= 20150422) // >= libstdc++-5
1310
# define OPENTELEMETRY_TRIVIALITY_TYPE_TRAITS
1411
#endif

api/include/opentelemetry/nostd/type_traits.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ using std::is_trivially_move_constructible;
142142
template <typename T>
143143
struct is_trivially_copy_constructible
144144
{
145-
static constexpr bool value =
146-
std::is_copy_constructible<T>::value && __is_trivially_assignable(T &, const T &);
145+
static constexpr bool value = std::is_copy_constructible<T>::value && __has_trivial_copy(T);
147146
};
148147

149148
template <typename T>
@@ -155,8 +154,7 @@ struct is_trivially_move_constructible
155154
template <typename T>
156155
struct is_trivially_copy_assignable
157156
{
158-
static constexpr bool value =
159-
std::is_copy_assignable<T>::value && __is_trivially_assignable(T &, const T &);
157+
static constexpr bool value = std::is_copy_assignable<T>::value && __has_trivial_assign(T);
160158
};
161159

162160
template <typename T>

0 commit comments

Comments
 (0)