Deleted Added
full compact
system.h (126432) system.h (131554)
1/* Portability cruft. Include after config.h and sys/types.h.
2 Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8

--- 39 unchanged lines hidden (view full) ---

48
49#ifndef HAVE_STRERROR
50extern int sys_nerr;
51extern char *sys_errlist[];
52# define strerror(E) (0 <= (E) && (E) < sys_nerr ? _(sys_errlist[E]) : _("Unknown system error"))
53#endif
54
55/* Some operating systems treat text and binary files differently. */
1/* Portability cruft. Include after config.h and sys/types.h.
2 Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8

--- 39 unchanged lines hidden (view full) ---

48
49#ifndef HAVE_STRERROR
50extern int sys_nerr;
51extern char *sys_errlist[];
52# define strerror(E) (0 <= (E) && (E) < sys_nerr ? _(sys_errlist[E]) : _("Unknown system error"))
53#endif
54
55/* Some operating systems treat text and binary files differently. */
56#if O_BINARY
56#ifdef __BEOS__
57# undef O_BINARY /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
58#endif
59#ifdef HAVE_DOS_FILE_CONTENTS
57# include <io.h>
58# ifdef HAVE_SETMODE
59# define SET_BINARY(fd) setmode (fd, O_BINARY)
60# else
61# define SET_BINARY(fd) _setmode (fd, O_BINARY)
62# endif
60# include <io.h>
61# ifdef HAVE_SETMODE
62# define SET_BINARY(fd) setmode (fd, O_BINARY)
63# else
64# define SET_BINARY(fd) _setmode (fd, O_BINARY)
65# endif
63#else
64# ifndef O_BINARY
65# define O_BINARY 0
66# define SET_BINARY(fd) (void)0
67# endif
68#endif
69
70#ifdef HAVE_DOS_FILE_NAMES
71# define IS_SLASH(c) ((c) == '/' || (c) == '\\')
72# define FILESYSTEM_PREFIX_LEN(f) ((f)[0] && (f)[1] == ':' ? 2 : 0)
73#endif
74
75#ifndef IS_SLASH
76# define IS_SLASH(c) ((c) == '/')
77#endif
78
79#ifndef FILESYSTEM_PREFIX_LEN
80# define FILESYSTEM_PREFIX_LEN(f) 0
81#endif
82
66#endif
67
68#ifdef HAVE_DOS_FILE_NAMES
69# define IS_SLASH(c) ((c) == '/' || (c) == '\\')
70# define FILESYSTEM_PREFIX_LEN(f) ((f)[0] && (f)[1] == ':' ? 2 : 0)
71#endif
72
73#ifndef IS_SLASH
74# define IS_SLASH(c) ((c) == '/')
75#endif
76
77#ifndef FILESYSTEM_PREFIX_LEN
78# define FILESYSTEM_PREFIX_LEN(f) 0
79#endif
80
83/* This assumes _WIN32, like DJGPP, has D_OK. Does it? In what header? */
84#ifdef D_OK
81int isdir PARAMS ((char const *));
82
83#ifdef HAVE_DIR_EACCES_BUG
85# ifdef EISDIR
86# define is_EISDIR(e, f) \
87 ((e) == EISDIR \
84# ifdef EISDIR
85# define is_EISDIR(e, f) \
86 ((e) == EISDIR \
88 || ((e) == EACCES && access (f, D_OK) == 0 && ((e) = EISDIR, 1)))
87 || ((e) == EACCES && isdir (f) && ((e) = EISDIR, 1)))
89# else
88# else
90# define is_EISDIR(e, f) ((e) == EACCES && access (f, D_OK) == 0)
89# define is_EISDIR(e, f) ((e) == EACCES && isdir (f))
91# endif
92#endif
93
94#ifndef is_EISDIR
95# ifdef EISDIR
96# define is_EISDIR(e, f) ((e) == EISDIR)
97# else
98# define is_EISDIR(e, f) 0

--- 109 unchanged lines hidden ---
90# endif
91#endif
92
93#ifndef is_EISDIR
94# ifdef EISDIR
95# define is_EISDIR(e, f) ((e) == EISDIR)
96# else
97# define is_EISDIR(e, f) 0

--- 109 unchanged lines hidden ---