* include/sys/stat.h (_S_IFLNK, S_IFLNK, _S_ISLNK, S_ISLNK, _lstat,

lstat): Conditionalize defines for __STRICT_ANSI__.
This commit is contained in:
Earnie Boyd 2005-01-11 13:34:42 +00:00
parent 0e05431799
commit aa67a4484e
2 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-01-11 Earnie Boyd <earnie@users.sf.net>
* include/sys/stat.h (_S_IFLNK, S_IFLNK, _S_ISLNK, S_ISLNK, _lstat,
lstat): Conditionalize defines for __STRICT_ANSI__.
2005-01-10 Earnie Boyd <earnie@users.sf.net> 2005-01-10 Earnie Boyd <earnie@users.sf.net>
* include/errno.h (ELOOP): Add definition. * include/errno.h (ELOOP): Add definition.

View File

@ -26,7 +26,9 @@
/* /*
* Constants for the stat st_mode member. * Constants for the stat st_mode member.
*/ */
#ifndef __STRICT_ANSI__
#define _S_IFLNK 0xF000 /* Pretend */ #define _S_IFLNK 0xF000 /* Pretend */
#endif
#define _S_IFIFO 0x1000 /* FIFO */ #define _S_IFIFO 0x1000 /* FIFO */
#define _S_IFCHR 0x2000 /* Character */ #define _S_IFCHR 0x2000 /* Character */
#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ #define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
@ -49,11 +51,15 @@
#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) #define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR)
#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK) #define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK)
#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) #define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#define _S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) /* Should always be zero.*/ #ifndef __STRICT_ANSI__
# define _S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) /* Should always be zero.*/
#endif
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#ifndef __STRICT_ANSI__
#define S_IFLNK _S_IFLNK #define S_IFLNK _S_IFLNK
#endif
#define S_IFIFO _S_IFIFO #define S_IFIFO _S_IFIFO
#define S_IFCHR _S_IFCHR #define S_IFCHR _S_IFCHR
#define S_IFBLK _S_IFBLK #define S_IFBLK _S_IFBLK
@ -73,7 +79,9 @@
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#ifndef __STRICT_ANSI__
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* Should always be zero.*/ #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* Should always be zero.*/
#endif
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
@ -159,7 +167,15 @@ extern "C" {
_CRTIMP int __cdecl _fstat (int, struct _stat*); _CRTIMP int __cdecl _fstat (int, struct _stat*);
_CRTIMP int __cdecl _chmod (const char*, int); _CRTIMP int __cdecl _chmod (const char*, int);
_CRTIMP int __cdecl _stat (const char*, struct _stat*); _CRTIMP int __cdecl _stat (const char*, struct _stat*);
/*
* FIXME: Should we use something MinGW specific such as __NO_POSIX_EMULATION__
* instead of __STRICT_ANSI__? I.E.: Do other things break because of -ansi
* being specified to the compiler? Of particular interest is the ACE/TAO
* project which the lstat define broke the build of.
*/
#ifndef __STRICT_ANSI__
#define _lstat _stat #define _lstat _stat
#endif
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
@ -167,7 +183,9 @@ _CRTIMP int __cdecl _stat (const char*, struct _stat*);
_CRTIMP int __cdecl fstat (int, struct stat*); _CRTIMP int __cdecl fstat (int, struct stat*);
_CRTIMP int __cdecl chmod (const char*, int); _CRTIMP int __cdecl chmod (const char*, int);
_CRTIMP int __cdecl stat (const char*, struct stat*); _CRTIMP int __cdecl stat (const char*, struct stat*);
#ifndef __STRICT_ANSI__
#define lstat stat #define lstat stat
#endif
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */