Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r--newlib/libc/stdio/local.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index b34c7c9d8..3b86cf19a 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -231,21 +231,24 @@ extern _READ_WRITE_RETURN_TYPE __swrite64 (struct _reent *, void *,
* 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)
+#define ORIENT(fp,ori) \
+ ( \
+ ( \
+ ((fp)->_flags & __SORD) ? \
+ 0 \
+ : \
+ ( \
+ ((fp)->_flags |= __SORD), \
+ (ori > 0) ? \
+ ((fp)->_flags2 |= __SWID) \
+ : \
+ ((fp)->_flags2 &= ~__SWID) \
+ ) \
+ ), \
+ ((fp)->_flags2 & __SWID) ? 1 : -1 \
+ )
#else
-#define ORIENT(fp,ori)
+#define ORIENT(fp,ori) (-1)
#endif
/* WARNING: _dcvt is defined in the stdlib directory, not here! */