diff options
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r-- | newlib/libc/stdio/local.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index 71d579ee0..8b1516f01 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -123,6 +123,24 @@ extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *, #define FREELB(ptr, fp) { _free_r(ptr,(char *)(fp)->_lb._base); \ (fp)->_lb._base = NULL; } +/* + * Set the orientation for a stream. If o > 0, the stream has wide- + * orientation. If o < 0, the stream has byte-orientation. + */ +#define ORIENT(fp,ori) \ + do \ + { \ + if (!((fp)->_flags & __SORD)) \ + { \ + (fp)->_flags |= __SORD; \ + if (ori > 0) \ + (fp)->_flags2 |= __SWID; \ + else \ + (fp)->_flags2 &= ~__SWID; \ + } \ + } \ + while (0) + /* WARNING: _dcvt is defined in the stdlib directory, not here! */ char *_EXFUN(_dcvt,(struct _reent *, char *, double, int, int, char, int)); |