[libcxx-commits] [libcxx] [libc++] Add a thread-safe version of std::lgamma in the dylib (PR #153631)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 8 00:52:32 PDT 2025
================
@@ -55,6 +55,31 @@ inline _LIBCPP_HIDE_FROM_ABI double tgamma(_A1 __x) _NOEXCEPT {
return __builtin_tgamma((double)__x);
}
+// __lgamma_r
+
+struct __lgamma_result {
+ double __result;
+ int __sign;
+};
+
+#if _LIBCPP_AVAILABILITY_HAS_THREAD_SAFE_LGAMMA
+_LIBCPP_EXPORTED_FROM_ABI __lgamma_result __lgamma_thread_safe_impl(double) _NOEXCEPT;
+
+inline _LIBCPP_HIDE_FROM_ABI __lgamma_result __lgamma_thread_safe(double __d) _NOEXCEPT {
+ return __math::__lgamma_thread_safe_impl(__d);
+}
----------------
philnik777 wrote:
What's the reason for having another wrapper here?
https://github.com/llvm/llvm-project/pull/153631
More information about the libcxx-commits
mailing list