Add a new compilation flag: OPENLIBM_ONLY_THREAD_SAFE.
The global signgam variable is only part of the X/Open System Interfaces. It is not part of the POSIX base definitions nor the C standard. I'd rather have it disabled for my specific use-case, so introduce a new compilation flag that we can use to disable it.
This commit is contained in:
+4
-2
@@ -25,10 +25,12 @@
|
||||
|
||||
#include "math_private.h"
|
||||
|
||||
extern int signgam;
|
||||
|
||||
DLLEXPORT double
|
||||
__ieee754_gamma(double x)
|
||||
{
|
||||
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||
int signgam;
|
||||
#endif
|
||||
|
||||
return __ieee754_gamma_r(x,&signgam);
|
||||
}
|
||||
|
||||
+4
-2
@@ -26,10 +26,12 @@
|
||||
|
||||
#include "math_private.h"
|
||||
|
||||
extern int signgam;
|
||||
|
||||
DLLEXPORT float
|
||||
__ieee754_gammaf(float x)
|
||||
{
|
||||
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||
int signgam;
|
||||
#endif
|
||||
|
||||
return __ieee754_gammaf_r(x,&signgam);
|
||||
}
|
||||
|
||||
+4
-2
@@ -25,10 +25,12 @@
|
||||
|
||||
#include "math_private.h"
|
||||
|
||||
extern int signgam;
|
||||
|
||||
DLLEXPORT double
|
||||
__ieee754_lgamma(double x)
|
||||
{
|
||||
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||
int signgam;
|
||||
#endif
|
||||
|
||||
return __ieee754_lgamma_r(x,&signgam);
|
||||
}
|
||||
|
||||
+4
-2
@@ -26,10 +26,12 @@
|
||||
|
||||
#include "math_private.h"
|
||||
|
||||
extern int signgam;
|
||||
|
||||
DLLEXPORT float
|
||||
__ieee754_lgammaf(float x)
|
||||
{
|
||||
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||
int signgam;
|
||||
#endif
|
||||
|
||||
return __ieee754_lgammaf_r(x,&signgam);
|
||||
}
|
||||
|
||||
+3
-2
@@ -4,11 +4,12 @@
|
||||
|
||||
#include "math_private.h"
|
||||
|
||||
extern int signgam;
|
||||
|
||||
DLLEXPORT long double
|
||||
lgammal(long double x)
|
||||
{
|
||||
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||
int signgam;
|
||||
#endif
|
||||
|
||||
return (lgammal_r(x, &signgam));
|
||||
}
|
||||
|
||||
@@ -170,7 +170,10 @@ extern const union __nan_un {
|
||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||
|
||||
#define MAXFLOAT ((float)3.40282346638528860e+38)
|
||||
|
||||
#ifndef OPENLIBM_ONLY_THREAD_SAFE
|
||||
extern int signgam;
|
||||
#endif
|
||||
#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
|
||||
@@ -2,4 +2,6 @@
|
||||
|
||||
#include "math_private.h"
|
||||
|
||||
#ifndef OPENLIBM_ONLY_THREAD_SAFE
|
||||
int signgam = 0;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user