Skip to content

Commit

Permalink
Add musl fenv.c needed by musl math functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
juj committed Dec 16, 2014
1 parent 644b013 commit 3974e99
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
7 changes: 7 additions & 0 deletions system/lib/libc.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
T expm1
T expm1f
T expm1l
T feclearexcept
T feraiseexcept
T fetestexcept
T fegetround
T __fesetround
T fegetenv
T fesetenv
T fdim
T fdimf
T fdiml
Expand Down
38 changes: 38 additions & 0 deletions system/lib/libc/musl/src/fenv/fenv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <fenv.h>

/* Dummy functions for archs lacking fenv implementation */

int feclearexcept(int mask)
{
return 0;
}

int feraiseexcept(int mask)
{
return 0;
}

int fetestexcept(int mask)
{
return 0;
}

int fegetround(void)
{
return FE_TONEAREST;
}

int __fesetround(int r)
{
return 0;
}

int fegetenv(fenv_t *envp)
{
return 0;
}

int fesetenv(const fenv_t *envp)
{
return 0;
}
3 changes: 3 additions & 0 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def create_libc():
'isxdigit.c',
'tolower.c',
]],
['fenv', [
'fenv.c'
]],
['internal', [
'intscan.c',
'floatscan.c',
Expand Down

0 comments on commit 3974e99

Please sign in to comment.