From d3513e5004d78c54da4a9a9f9d076c86139621ce Mon Sep 17 00:00:00 2001 From: NicJA Date: Mon, 11 Jun 2018 02:46:38 +0000 Subject: [PATCH] add internal functions to access private fenv values. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55291 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/stdc/_fenv.c | 21 ++++++++++++++++++++- compiler/stdc/stdc.conf | 7 +++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/compiler/stdc/_fenv.c b/compiler/stdc/_fenv.c index 580b4aeead..6db3115572 100644 --- a/compiler/stdc/_fenv.c +++ b/compiler/stdc/_fenv.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2018, The AROS Development Team. All rights reserved. $Id$ */ @@ -10,8 +10,27 @@ * function name with _ prepended will be used. */ +#include "__stdc_intbase.h" #include +void *__stdc_get_fe_dfl(void) +{ + struct StdCIntBase *_StdCBase = (struct StdCIntBase *)__aros_getbase_StdCBase(); + return (void *)_StdCBase->__fe_dfl_env; +} + +void *__stdc_get_fe_nom(void) +{ + struct StdCIntBase *_StdCBase = (struct StdCIntBase *)__aros_getbase_StdCBase(); + return (void *)_StdCBase->__fe_nomask_env; +} + +int __stdc_get_fe_round(void) +{ + struct StdCIntBase *_StdCBase = (struct StdCIntBase *)__aros_getbase_StdCBase(); + return _StdCBase->__fe_round; +} + int _feclearexcept(int excepts) { return feclearexcept(excepts); diff --git a/compiler/stdc/stdc.conf b/compiler/stdc/stdc.conf index 77c1991014..0e1490dddd 100644 --- a/compiler/stdc/stdc.conf +++ b/compiler/stdc/stdc.conf @@ -54,10 +54,13 @@ int *__stdc_set_errorptr(int *errorptr) int *__stdc_get_errorptr(void) void __stdc_set_exitjmp(jmp_buf exitjmp, jmp_buf previousjmp) void __stdc_jmp2exit(int normal, int returncode) -# private functions for patching in softfloat support +# private functions for patching in softfloat/fenv support void *__stdc_set_fpuprivate(void *fpuprivate) void *__stdc_get_fpuprivate(void) -.skip 11 +void *__stdc_get_fe_dfl(void) +void *__stdc_get_fe_nom(void) +int __stdc_get_fe_round(void) +.skip 8 # == C99 functions ordered per include file == # * assert.h: Support function for assert() macro void __assert(const char * expr, const char * file, unsigned int line) -- 2.11.4.GIT