Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions api/include/opentelemetry/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@
#else
# define OPENTELEMETRY_HAS_INCLUDE(x) __has_include(x)
#endif

#if !defined(__GLIBCXX__) || OPENTELEMETRY_HAS_INCLUDE(<codecvt>) // >= libstdc++-5
# define OPENTELEMETRY_TRIVIALITY_TYPE_TRAITS
#endif
2 changes: 1 addition & 1 deletion api/include/opentelemetry/nostd/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ using is_nothrow_swappable = detail::swappable::is_nothrow_swappable<is_swappabl
* std::is_trivialy_copy_assignable
* std::is_trivialy_move_assignable
*/
#ifdef OPENTELEMETRY_TRIVIALITY_TYPE_TRAITS
#if defined(OPENTELEMETRY_STL_VERSION) && OPENTELEMETRY_STL_VERSION >= 2011
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback implementation relies on GCC's API, making it exclusive to GCC. It should be updated to support all compilers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should it? Opentelemetry does not support cxx03 standard.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the code in #else branch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a dead code, opentelemetry does not support cxx03 standard / libstdc++ 5.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgthegreat

In theory, yes, this is dead code.
In practice, no, this code is not totally dead now, there are historical reasons to maintain this part working.

What we need here is a fix that solves the trivial cases of building with recent compilers, using std:: type traits when they are available, instead of using the alternate nostd:: implementation.

The issue is probably that we need to do this independently of WITH_STL : that is, test __cplusplus instead of OPENTELEMETRY_STL_VERSION.

Now, for old cases when std:: classes are not available, like this old work around for gcc 4.8, the code needs to implement the work around as before.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope I understood you correctly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if !defined(OPENTELEMETRY_HAVE_STD_TYPE_TRAITS) can be removed now.

using std::is_trivially_copy_assignable;
using std::is_trivially_copy_constructible;
using std::is_trivially_move_assignable;
Expand Down
Loading