Skip to content

Commit ba53d6b

Browse files
Remove incorrect forward-declaration of lgamma_r header
libc++ declares `lgamma_r` as: ``` extern "C" double lgamma_r(double, int *); ``` while modern glibc uses the following: ``` __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); ``` This causes (I did not digged to the very bottom of it) the following compilation error when compiling with nvcc: ``` libcxx/include/__random/binomial_distribution.h(117): error: linkage specification is incompatible with previous "lgamma_r" /usr/include/x86_64-linux-gnu/bits/mathcalls.h(271): here ```
1 parent 89ad31f commit ba53d6b

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

libcxx/include/__random/binomial_distribution.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ class _LIBCPP_TEMPLATE_VIS binomial_distribution {
9797
}
9898
};
9999

100-
#ifndef _LIBCPP_MSVCRT_LIKE
101-
extern "C" double lgamma_r(double, int*);
102-
#endif
103-
104100
inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma(double __d) {
105101
#if defined(_LIBCPP_MSVCRT_LIKE)
106102
return lgamma(__d);

0 commit comments

Comments
 (0)