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/stdio/vswprintf.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/stdio/vswprintf.c')
-rw-r--r-- | newlib/libc/stdio/vswprintf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/stdio/vswprintf.c b/newlib/libc/stdio/vswprintf.c index 89795ed..08a8545 100644 --- a/newlib/libc/stdio/vswprintf.c +++ b/newlib/libc/stdio/vswprintf.c @@ -42,7 +42,7 @@ _vswprintf_r (struct _reent *ptr, if (size > INT_MAX / sizeof (wchar_t)) { - ptr->_errno = EOVERFLOW; /* POSIX extension */ + _REENT_ERRNO(ptr) = EOVERFLOW; /* POSIX extension */ return EOF; } f._flags = __SWR | __SSTR; @@ -60,7 +60,7 @@ _vswprintf_r (struct _reent *ptr, /* _svfwprintf_r() returns how many wide characters it would have printed * if there were enough space. Return an error if too big to fit in str, * unlike snprintf, which returns the size needed. */ - ptr->_errno = EOVERFLOW; /* POSIX extension */ + _REENT_ERRNO(ptr) = EOVERFLOW; /* POSIX extension */ ret = -1; } return ret; |