Skip to content

Commit

Permalink
[core] Simplify and explain define of R__SIZEDDELETE
Browse files Browse the repository at this point in the history
With Clang and GNU libstdc++, we cannot just enable R__SIZEDDELETE
unconditionally because Clang only defines __cpp_sized_deallocation
if passed -fsized-deallocation.
  • Loading branch information
hahnjo authored and pcanal committed Apr 26, 2024
1 parent f2bf964 commit b5ad658
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core/foundation/inc/ROOT/RConfig.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,11 @@
# endif
#endif

#if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_12)
// At least on 10.11, the compiler defines but the c++ library does not provide the size operator delete.
// See for example https://llvm.org/bugs/show_bug.cgi?id=22951 or
// https://github.com/gperftools/gperftools/issues/794.
#elif !defined(__GNUC__)
# define R__SIZEDDELETE
#elif __GNUC__ > 4
#if defined(__GLIBCXX__) && !defined(__cpp_sized_deallocation)
// Sized global deallocation functions in libstc++ are only enabled if
// __cpp_sized_deallocation is defined, which Clang only does if explicitly
// passed -fsized-deallocation.
#else
# define R__SIZEDDELETE
#endif

Expand Down

0 comments on commit b5ad658

Please sign in to comment.