diff options
author | Matt Joyce <matthew.joyce@embedded-brains.de> | 2022-01-18 10:13:04 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-13 06:55:41 +0200 |
commit | f3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5 (patch) | |
tree | 80cc7a629134d4568bf5dc71898266555a6863b0 /newlib/libc/stdlib/strtod.c | |
parent | d0d78e96ebf4187fb9362465f1a397680447046f (diff) | |
download | newlib-f3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5.zip newlib-f3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5.tar.gz newlib-f3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5.tar.bz2 |
Add _REENT_ERRNO(ptr)
Add a _REENT_ERRNO() macro to encapsulate the access to the
_errno member of struct reent. This will help to replace the
structure member with a thread-local storage object in a follow
up patch.
Replace uses of __errno_r() with _REENT_ERRNO(). Keep __errno_r() macro for
potential users outside of Newlib.
Diffstat (limited to 'newlib/libc/stdlib/strtod.c')
-rw-r--r-- | newlib/libc/stdlib/strtod.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c index cd02224..9156ed7 100644 --- a/newlib/libc/stdlib/strtod.c +++ b/newlib/libc/stdlib/strtod.c @@ -595,7 +595,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, if (e1 > DBL_MAX_10_EXP) { ovfl: #ifndef NO_ERRNO - ptr->_errno = ERANGE; + _REENT_ERRNO(ptr) = ERANGE; #endif /* Can't trust HUGE_VAL */ #ifdef IEEE_Arith @@ -702,7 +702,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, undfl: dval(rv) = 0.; #ifndef NO_ERRNO - ptr->_errno = ERANGE; + _REENT_ERRNO(ptr) = ERANGE; #endif if (bd0) goto retfree; @@ -1249,7 +1249,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se, #ifndef NO_ERRNO /* try to avoid the bug of testing an 8087 register value */ if ((dword0(rv) & Exp_mask) == 0) - ptr->_errno = ERANGE; + _REENT_ERRNO(ptr) = ERANGE; #endif } #endif /* Avoid_Underflow */ @@ -1303,7 +1303,7 @@ strtof_l (const char *__restrict s00, char **__restrict se, locale_t loc) float retval = (float) val; #ifndef NO_ERRNO if (isinf (retval) && !isinf (val)) - _REENT->_errno = ERANGE; + _REENT_ERRNO(_REENT) = ERANGE; #endif return retval; } @@ -1340,7 +1340,7 @@ strtof (const char *__restrict s00, float retval = (float) val; #ifndef NO_ERRNO if ((isinf (retval) && !isinf (val)) || (isdenormf(retval) && !isdenorm(val))) - _REENT->_errno = ERANGE; + _REENT_ERRNO(_REENT) = ERANGE; #endif return retval; } |