Skip to content

Commit 532fe15

Browse files
committed
Remove the non-standard gamma() function. Use lgamma() instead.
1 parent 388f0f1 commit 532fe15

8 files changed

Lines changed: 8 additions & 158 deletions

File tree

include/openlibm_math.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,6 @@ double y0(double);
281281
double y1(double);
282282
double yn(int, double);
283283

284-
#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
285-
double gamma(double);
286-
#endif
287-
288284
#if __XSI_VISIBLE <= 600 || __BSD_VISIBLE
289285
double scalb(double, double);
290286
#endif
@@ -312,10 +308,9 @@ int finite(double) __pure2;
312308
int isnanf(float) __pure2;
313309

314310
/*
315-
* Reentrant version of gamma & lgamma; passes signgam back by reference
316-
* as the second argument; user must allocate space for signgam.
311+
* Reentrant version of lgamma; passes signgam back by reference as the
312+
* second argument; user must allocate space for signgam.
317313
*/
318-
double gamma_r(double, int *);
319314
double lgamma_r(double, int *);
320315

321316
/*
@@ -402,7 +397,6 @@ float fminf(float, float) __pure2;
402397
#if __BSD_VISIBLE
403398
float dremf(float, float);
404399
int finitef(float) __pure2;
405-
float gammaf(float);
406400
float j0f(float);
407401
float j1f(float);
408402
float jnf(int, float);
@@ -412,11 +406,9 @@ float y1f(float);
412406
float ynf(int, float);
413407

414408
/*
415-
* Float versions of reentrant version of gamma & lgamma; passes
416-
* signgam back by reference as the second argument; user must
417-
* allocate space for signgam.
409+
* Float versions of reentrant version of lgamma; passes signgam back by
410+
* reference as the second argument; user must allocate space for signgam.
418411
*/
419-
float gammaf_r(float, int *);
420412
float lgammaf_r(float, int *);
421413

422414
/*

src/Make.files

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
$(CUR_SRCS) = common.c \
22
e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_asin.c e_asinf.c \
33
e_atan2.c e_atan2f.c e_atanh.c e_atanhf.c e_cosh.c e_coshf.c e_exp.c \
4-
e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \
5-
e_gammaf_r.c e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \
4+
e_expf.c e_fmod.c e_fmodf.c \
5+
e_hypot.c e_hypotf.c e_j0.c e_j0f.c e_j1.c e_j1f.c \
66
e_jn.c e_jnf.c e_lgamma.c e_lgamma_r.c e_lgammaf.c e_lgammaf_r.c \
77
e_lgammal.c e_log.c e_log10.c e_log10f.c e_log2.c e_log2f.c e_logf.c \
88
e_pow.c e_powf.c e_remainder.c e_remainderf.c e_scalb.c e_scalbf.c \

src/common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "math_private.h"
22

3+
DLLEXPORT int isopenlibm(void);
4+
35
DLLEXPORT int isopenlibm(void) {
46
return 1;
57
}

src/e_gamma.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/e_gamma_r.c

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/e_gammaf.c

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/e_gammaf_r.c

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/math_private.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,7 @@ irint(double x)
280280
#define __ieee754_fmod fmod
281281
#define __ieee754_pow pow
282282
#define __ieee754_lgamma lgamma
283-
#define __ieee754_gamma gamma
284283
#define __ieee754_lgamma_r lgamma_r
285-
#define __ieee754_gamma_r gamma_r
286284
#define __ieee754_log10 log10
287285
#define __ieee754_sinh sinh
288286
#define __ieee754_hypot hypot
@@ -306,9 +304,7 @@ irint(double x)
306304
#define __ieee754_fmodf fmodf
307305
#define __ieee754_powf powf
308306
#define __ieee754_lgammaf lgammaf
309-
#define __ieee754_gammaf gammaf
310307
#define __ieee754_lgammaf_r lgammaf_r
311-
#define __ieee754_gammaf_r gammaf_r
312308
#define __ieee754_log10f log10f
313309
#define __ieee754_log2f log2f
314310
#define __ieee754_sinhf sinhf

0 commit comments

Comments
 (0)