From f3b8138239d3ba34c4ecaa4305b0fbd7eb4e28a5 Mon Sep 17 00:00:00 2001 From: Matt Joyce Date: Tue, 18 Jan 2022 10:13:04 +0100 Subject: 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. --- newlib/libc/stdlib/strtoumax.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'newlib/libc/stdlib/strtoumax.c') diff --git a/newlib/libc/stdlib/strtoumax.c b/newlib/libc/stdlib/strtoumax.c index cf1a427..adcf2b3 100644 --- a/newlib/libc/stdlib/strtoumax.c +++ b/newlib/libc/stdlib/strtoumax.c @@ -115,10 +115,10 @@ _strtoumax_l(struct _reent *rptr, const char * __restrict nptr, } if (any < 0) { acc = UINTMAX_MAX; - rptr->_errno = ERANGE; + _REENT_ERRNO(rptr) = ERANGE; } else if (!any) { noconv: - rptr->_errno = EINVAL; + _REENT_ERRNO(rptr) = EINVAL; } else if (neg) acc = -acc; if (endptr != NULL) -- cgit v1.1