about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/w_lgammal.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/w_lgammal.c')
-rw-r--r--sysdeps/libm-ieee754/w_lgammal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sysdeps/libm-ieee754/w_lgammal.c b/sysdeps/libm-ieee754/w_lgammal.c
index aab8417e31..9db2ce2693 100644
--- a/sysdeps/libm-ieee754/w_lgammal.c
+++ b/sysdeps/libm-ieee754/w_lgammal.c
@@ -27,8 +27,6 @@ static char rcsid[] = "$NetBSD: $";
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
 	long double __lgammal(long double x)
 #else
@@ -37,10 +35,14 @@ extern int __signgam;
 #endif
 {
 #ifdef _IEEE_LIBM
-	return __ieee754_lgammal_r(x,&__signgam);
+	return __ieee754_lgammal_r(x,&signgam);
 #else
         long double y;
-        y = __ieee754_lgammal_r(x,&__signgam);
+	int local_signgam;
+        y = __ieee754_lgammal_r(x,&local_signgam);
+	if (_LIB_VERSION != _ISOC_)
+	  /* ISO C 9x does not define the global variable.  */
+	  signgam = local_signgam;
         if(_LIB_VERSION == _IEEE_) return y;
         if(!__finitel(y)&&__finitel(x)) {
             if(__floorl(x)==x&&x<=0.0)