aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib/wcstoul.c
diff options
context:
space:
mode:
authorMatt Joyce <matthew.joyce@embedded-brains.de>2022-01-18 10:13:04 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-07-13 06:55:41 +0200
commitf3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5 (patch)
tree80cc7a629134d4568bf5dc71898266555a6863b0 /newlib/libc/stdlib/wcstoul.c
parentd0d78e96ebf4187fb9362465f1a397680447046f (diff)
downloadnewlib-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/wcstoul.c')
-rw-r--r--newlib/libc/stdlib/wcstoul.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/wcstoul.c b/newlib/libc/stdlib/wcstoul.c
index fe3c878..9c78fc3 100644
--- a/newlib/libc/stdlib/wcstoul.c
+++ b/newlib/libc/stdlib/wcstoul.c
@@ -179,7 +179,7 @@ _wcstoul_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr,
}
if (any < 0) {
acc = ULONG_MAX;
- rptr->_errno = ERANGE;
+ _REENT_ERRNO(rptr) = ERANGE;
} else if (neg)
acc = -acc;
if (endptr != 0)