[libc++] Do not redeclare lgamma_r when targeting the LLVM C library (#102036)
We use lgamma_r for the random normal distribution support. In this code we redeclare it, which causes issues with the LLVM C library as this function is marked noexcept in LLVM libc. This patch ensures that we don't redeclare that function when targeting LLVM libc.
This commit is contained in:
parent
ff2baf0360
commit
5f2389d49f
@ -30,15 +30,18 @@
|
||||
// ... add new file formats here ...
|
||||
#endif
|
||||
|
||||
// Need to detect which libc we're using if we're on Linux.
|
||||
#if defined(__linux__)
|
||||
// To detect which libc we're using
|
||||
#if __has_include(<features.h>)
|
||||
# include <features.h>
|
||||
#endif
|
||||
|
||||
#if defined(__linux__)
|
||||
# if defined(__GLIBC_PREREQ)
|
||||
# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
|
||||
# else
|
||||
# define _LIBCPP_GLIBC_PREREQ(a, b) 0
|
||||
# endif // defined(__GLIBC_PREREQ)
|
||||
#endif // defined(__linux__)
|
||||
#endif
|
||||
|
||||
#ifndef __BYTE_ORDER__
|
||||
# error \
|
||||
|
||||
@ -97,7 +97,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_MSVCRT_LIKE
|
||||
// The LLVM C library provides this with conflicting `noexcept` attributes.
|
||||
#if !defined(_LIBCPP_MSVCRT_LIKE) && !defined(__LLVM_LIBC__)
|
||||
extern "C" double lgamma_r(double, int*);
|
||||
#endif
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user