File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -97,13 +97,23 @@ class binomial_distribution {
9797 }
9898};
9999
100- // The LLVM C library provides this with conflicting `noexcept` attributes.
101- #if !defined(_LIBCPP_MSVCRT_LIKE) && !defined(__LLVM_LIBC__)
102- extern " C" double lgamma_r (double , int *);
100+ // Some libc declares the math functions to be `noexcept`.
101+ #if defined(_LIBCPP_GLIBC_PREREQ)
102+ # if _LIBCPP_GLIBC_PREREQ(2, 8)
103+ # define _LIBCPP_LGAMMA_R_NOEXCEPT _NOEXCEPT
104+ # endif
105+ #elif defined(__LLVM_LIBC__)
106+ # define _LIBCPP_LGAMMA_R_NOEXCEPT _NOEXCEPT
107+ #else
108+ # define _LIBCPP_LGAMMA_R_NOEXCEPT
109+ #endif
110+
111+ #if !defined(_LIBCPP_MSVCRT_LIKE)
112+ extern " C" double lgamma_r (double , int *) _LIBCPP_LGAMMA_R_NOEXCEPT;
103113#endif
104114
105115inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma (double __d) {
106- #if defined(_LIBCPP_MSVCRT_LIKE) || defined(__LLVM_LIBC__)
116+ #if defined(_LIBCPP_MSVCRT_LIKE)
107117 return lgamma (__d);
108118#else
109119 int __sign;
You can’t perform that action at this time.
0 commit comments