mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2025-01-01 06:23:39 +01:00
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:
parent
9fdc4f9d9e
commit
c253db68ca
7 changed files with 24 additions and 10 deletions
|
@ -25,10 +25,12 @@
|
||||||
|
|
||||||
#include "math_private.h"
|
#include "math_private.h"
|
||||||
|
|
||||||
extern int signgam;
|
|
||||||
|
|
||||||
DLLEXPORT double
|
DLLEXPORT double
|
||||||
__ieee754_gamma(double x)
|
__ieee754_gamma(double x)
|
||||||
{
|
{
|
||||||
|
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
|
int signgam;
|
||||||
|
#endif
|
||||||
|
|
||||||
return __ieee754_gamma_r(x,&signgam);
|
return __ieee754_gamma_r(x,&signgam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,12 @@
|
||||||
|
|
||||||
#include "math_private.h"
|
#include "math_private.h"
|
||||||
|
|
||||||
extern int signgam;
|
|
||||||
|
|
||||||
DLLEXPORT float
|
DLLEXPORT float
|
||||||
__ieee754_gammaf(float x)
|
__ieee754_gammaf(float x)
|
||||||
{
|
{
|
||||||
|
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
|
int signgam;
|
||||||
|
#endif
|
||||||
|
|
||||||
return __ieee754_gammaf_r(x,&signgam);
|
return __ieee754_gammaf_r(x,&signgam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,12 @@
|
||||||
|
|
||||||
#include "math_private.h"
|
#include "math_private.h"
|
||||||
|
|
||||||
extern int signgam;
|
|
||||||
|
|
||||||
DLLEXPORT double
|
DLLEXPORT double
|
||||||
__ieee754_lgamma(double x)
|
__ieee754_lgamma(double x)
|
||||||
{
|
{
|
||||||
|
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
|
int signgam;
|
||||||
|
#endif
|
||||||
|
|
||||||
return __ieee754_lgamma_r(x,&signgam);
|
return __ieee754_lgamma_r(x,&signgam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,12 @@
|
||||||
|
|
||||||
#include "math_private.h"
|
#include "math_private.h"
|
||||||
|
|
||||||
extern int signgam;
|
|
||||||
|
|
||||||
DLLEXPORT float
|
DLLEXPORT float
|
||||||
__ieee754_lgammaf(float x)
|
__ieee754_lgammaf(float x)
|
||||||
{
|
{
|
||||||
|
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
|
int signgam;
|
||||||
|
#endif
|
||||||
|
|
||||||
return __ieee754_lgammaf_r(x,&signgam);
|
return __ieee754_lgammaf_r(x,&signgam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,12 @@
|
||||||
|
|
||||||
#include "math_private.h"
|
#include "math_private.h"
|
||||||
|
|
||||||
extern int signgam;
|
|
||||||
|
|
||||||
DLLEXPORT long double
|
DLLEXPORT long double
|
||||||
lgammal(long double x)
|
lgammal(long double x)
|
||||||
{
|
{
|
||||||
|
#ifdef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
|
int signgam;
|
||||||
|
#endif
|
||||||
|
|
||||||
return (lgammal_r(x, &signgam));
|
return (lgammal_r(x, &signgam));
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,10 @@ extern const union __nan_un {
|
||||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||||
|
|
||||||
#define MAXFLOAT ((float)3.40282346638528860e+38)
|
#define MAXFLOAT ((float)3.40282346638528860e+38)
|
||||||
|
|
||||||
|
#ifndef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
extern int signgam;
|
extern int signgam;
|
||||||
|
#endif
|
||||||
#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
|
#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
|
||||||
|
|
||||||
#if __BSD_VISIBLE
|
#if __BSD_VISIBLE
|
||||||
|
|
|
@ -2,4 +2,6 @@
|
||||||
|
|
||||||
#include "math_private.h"
|
#include "math_private.h"
|
||||||
|
|
||||||
|
#ifndef OPENLIBM_ONLY_THREAD_SAFE
|
||||||
int signgam = 0;
|
int signgam = 0;
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue