# define R_OK 4
#endif
-/* For systems that distinguish between text and binary I/O.
- O_BINARY is usually declared in fcntl.h */
-#if !defined O_BINARY && defined _O_BINARY
- /* For MSC-compatible compilers. */
-# define O_BINARY _O_BINARY
-# define O_TEXT _O_TEXT
-#endif
-
#if !defined O_DIRECT
# define O_DIRECT 0
#endif
# define O_SYNC 0
#endif
+/* For systems that distinguish between text and binary I/O.
+ O_BINARY is usually declared in fcntl.h */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+
#ifdef __BEOS__
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
# undef O_BINARY
# undef O_TEXT
#endif
-#if O_BINARY
-# ifndef __DJGPP__
-# define setmode _setmode
-# define fileno(_fp) _fileno (_fp)
-# endif /* not DJGPP */
-# define SET_MODE(_f, _m) setmode (_f, _m)
-# define SET_BINARY(_f) do {if (!isatty(_f)) setmode (_f, O_BINARY);} while (0)
-# define SET_BINARY2(_f1, _f2) \
- do { \
- if (!isatty (_f1)) \
- { \
- setmode (_f1, O_BINARY); \
- if (!isatty (_f2)) \
- setmode (_f2, O_BINARY); \
- } \
- } while(0)
-#else
-# define SET_MODE(_f, _m) (void)0
-# define SET_BINARY(f) (void)0
-# define SET_BINARY2(f1,f2) (void)0
-# ifndef O_BINARY
-# define O_BINARY 0
-# endif
+#ifndef O_BINARY
+# define O_BINARY 0
# define O_TEXT 0
-#endif /* O_BINARY */
+#endif
#if HAVE_DIRENT_H
# include <dirent.h>
#include "timespec.h"
-#ifdef __DJGPP__
- /* We need the declaration of setmode. */
-# include <io.h>
- /* We need the declaration of __djgpp_set_ctrl_c. */
-# include <sys/exceptn.h>
-#endif
-
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif