Skip to content

Commit

Permalink
Work around missing libm functions for __APPLE__
Browse files Browse the repository at this point in the history
No isnanf, isinff or lgammaf_r functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Apr 17, 2019
1 parent be0fe9d commit e773c38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions posix/snek-posix.h
Expand Up @@ -19,6 +19,10 @@ extern FILE *snek_posix_input;

int snek_getc(FILE *input);

#ifdef __APPLE__
#define isnanf isnan
#endif

#define SNEK_GETC() snek_getc(snek_posix_input)

#define SNEK_DEBUG 1
Expand Down
4 changes: 2 additions & 2 deletions snek-math.c
Expand Up @@ -205,7 +205,7 @@ snek_builtin_math_isclose(uint8_t nposition, uint8_t nnamed, snek_poly_t *args)
}

m1(math_isfinite, isfinite)
#ifdef WIN32
#if defined(WIN32) || defined(__APPLE__)
m1(math_isinf, isinf)
#else
m1(math_isinf, isinff)
Expand Down Expand Up @@ -256,7 +256,7 @@ m1(math_erf, erff);
m1(math_erfc, erfcf);
m1(math_gamma, tgammaf);

#ifdef WIN32
#if defined(WIN32) || defined(__APPLE__)
m1(math_lgamma, lgammaf);
#else
static float
Expand Down

0 comments on commit e773c38

Please sign in to comment.