From 5cf6708ef4559248ba751adc349af475e654be2a Mon Sep 17 00:00:00 2001 From: Earnie Boyd Date: Thu, 1 Nov 2001 19:51:50 +0000 Subject: [PATCH] 2001-10-30 Danny Smith * include/io.h (_commit): Add declaration. Thanks to: "stefan" 2001-10-30 Danny Smith * include/sys/stat.h: Make S_IS* macros safer. 2001-10-27 Danny Smith * include/stdlib.h (EXIT_FAILURE): Change value to 1. 2001-10-12 Danny Smith * include/stdlib.h (__p__environ, __p__wenviron): Use __STDC__ prototypes. --- winsup/mingw/ChangeLog | 18 ++++++++++++++++++ winsup/mingw/include/io.h | 2 ++ winsup/mingw/include/stdlib.h | 6 +++--- winsup/mingw/include/sys/stat.h | 22 +++++++++++----------- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 1493b6fd3..f1428c043 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,21 @@ +2001-10-30 Danny Smith + + * include/io.h (_commit): Add declaration. + Thanks to: "stefan" + +2001-10-30 Danny Smith + + * include/sys/stat.h: Make S_IS* macros safer. + +2001-10-27 Danny Smith + + * include/stdlib.h (EXIT_FAILURE): Change value to 1. + +2001-10-12 Danny Smith + + * include/stdlib.h (__p__environ, __p__wenviron): Use + __STDC__ prototypes. + 2001-09-19 Earnie Boyd * Makefile.in: Remove the /usr from the install target. diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h index 6cb65a4da..8896686ac 100644 --- a/winsup/mingw/include/io.h +++ b/winsup/mingw/include/io.h @@ -126,6 +126,7 @@ int _mkdir (const char*); char* _mktemp (char*); int _rmdir (const char*); + #ifdef __MSVCRT__ __int64 _filelengthi64(int); long _findfirsti64(const char*, struct _finddatai64_t*); @@ -176,6 +177,7 @@ extern "C" { int _access (const char*, int); int _chsize (int, long); int _close (int); +int _commit(int); /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), * the "owner write permission" bit (on FAT). */ diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h index 9bae20c31..18a80a73a 100644 --- a/winsup/mingw/include/stdlib.h +++ b/winsup/mingw/include/stdlib.h @@ -48,7 +48,7 @@ * These values may be used as exit status codes. */ #define EXIT_SUCCESS 0 -#define EXIT_FAILURE -1 +#define EXIT_FAILURE 1 /* * Definitions for path name functions. @@ -150,8 +150,8 @@ int* __doserrno(void); */ #ifdef __MSVCRT__ - extern char *** __p__environ(); - extern wchar_t *** __p__wenviron(); + extern char *** __p__environ(void); + extern wchar_t *** __p__wenviron(void); # define _environ (*__p__environ()) # define _wenviron (*__p__wenviron()) #else /* ! __MSVCRT__ */ diff --git a/winsup/mingw/include/sys/stat.h b/winsup/mingw/include/sys/stat.h index 0178660bd..47862105f 100644 --- a/winsup/mingw/include/sys/stat.h +++ b/winsup/mingw/include/sys/stat.h @@ -46,7 +46,7 @@ */ #define _S_IFIFO 0x1000 /* FIFO */ #define _S_IFCHR 0x2000 /* Character */ -#define _S_IFBLK 0x3000 /* Block */ +#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ #define _S_IFDIR 0x4000 /* Directory */ #define _S_IFREG 0x8000 /* Regular */ @@ -61,11 +61,11 @@ #define _S_IWUSR _S_IWRITE #define _S_IRUSR _S_IREAD -#define _S_ISDIR(m) ((m) & _S_IFDIR) -#define _S_ISFIFO(m) ((m) & _S_IFIFO) -#define _S_ISCHR(m) ((m) & _S_IFCHR) -#define _S_ISBLK(m) ((m) & _S_IFBLK) -#define _S_ISREG(m) ((m) & _S_IFREG) +#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) +#define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) +#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) +#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK) +#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) #ifndef _NO_OLDNAMES @@ -83,11 +83,11 @@ #define S_IWUSR _S_IWUSR #define S_IRUSR _S_IRUSR -#define S_ISDIR(m) ((m) & S_IFDIR) -#define S_ISFIFO(m) ((m) & S_IFIFO) -#define S_ISCHR(m) ((m) & S_IFCHR) -#define S_ISBLK(m) ((m) & S_IFBLK) -#define S_ISREG(m) ((m) & S_IFREG) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif /* Not _NO_OLDNAMES */ -- 2.43.5