summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-06-30 17:49:57 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-06-30 17:49:57 +0000
commitce64bdaf0ec7aa164b1a36bbd9ec79124f08386f (patch)
tree1c3365102c78ccaf6a1bef5b9923c583b9f3eb10 /lib
parent4f8fa6adc36c096088803a9bf2654ce1a4f8b5a8 (diff)
downloaddiffutils-ce64bdaf0ec7aa164b1a36bbd9ec79124f08386f.tar.gz
Don't include <stdbool.h>, since setmode.h now does this.
Include setmode.h first, to catch interface errors. Assume HAVE_SETMODE_DOS is defined.
Diffstat (limited to 'lib')
-rw-r--r--lib/setmode.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/lib/setmode.c b/lib/setmode.c
index b2b93a6..4f49be6 100644
--- a/lib/setmode.c
+++ b/lib/setmode.c
@@ -23,25 +23,17 @@
# include <config.h>
#endif
-#if HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-typedef enum {false = 0, true = 1} bool;
-#endif
-
-#if HAVE_SETMODE_DOS
-# include <io.h>
-# if HAVE_FCNTL_H
-# include <fcntl.h>
-# endif
-# if HAVE_UNISTD_H
-# include <unistd.h>
-# endif
-#endif
-
#include "setmode.h"
#undef set_binary_mode
+#include <io.h>
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#ifndef __attribute__
# if __GNUC__ < 3 || __STRICT_ANSI__
# define __attribute__(x)
@@ -49,12 +41,9 @@ typedef enum {false = 0, true = 1} bool;
#endif
/* Set the binary mode of FD to MODE, returning its previous mode.
- MODE is 1 for binary and 0 for text. If setting the mode might
- cause problems, ignore the request and return MODE. Always return
- 1 on POSIX platforms, which do not distinguish between text and
- binary. */
+ MODE is true for binary and false for text. If setting the mode might
+ cause problems, ignore the request and return MODE. */
-#if HAVE_SETMODE_DOS
bool
set_binary_mode (int fd, bool mode)
{
@@ -62,6 +51,3 @@ set_binary_mode (int fd, bool mode)
return mode;
return setmode (fd, mode ? O_BINARY : O_TEXT) != O_TEXT;
}
-#else
-static char dummy;
-#endif