File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -97,13 +97,19 @@ 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 _LIBCPP_GLIBC_PREREQ(2, 8) || defined(__LLVM_LIBC__)
102+ # define _LIBCPP_LGAMMA_R_NOEXCEPT _NOEXCEPT
103+ else
104+ # define _LIBCPP_LGAMMA_R_NOEXCEPT
105+ #endif
106+
107+ #if !defined(_LIBCPP_MSVCRT_LIKE)
108+ extern " C" double lgamma_r (double , int *) _LIBCPP_LGAMMA_R_NOEXCEPT;
103109#endif
104110
105111inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma (double __d) {
106- #if defined(_LIBCPP_MSVCRT_LIKE) || defined(__LLVM_LIBC__)
112+ #if defined(_LIBCPP_MSVCRT_LIKE)
107113 return lgamma (__d);
108114#else
109115 int __sign;
You can’t perform that action at this time.
0 commit comments