--- mstools/h/sys/stat.h 2018/08/09 18:20:35 1.1.1.2 +++ mstools/h/sys/stat.h 2018/08/09 18:23:11 1.1.1.4 @@ -1,7 +1,7 @@ /*** -*sys\stat.h - defines structure used by stat() and fstat() +*sys/stat.h - defines structure used by stat() and fstat() * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved. * *Purpose: * This file defines the structure used by the _stat() and _fstat() @@ -17,12 +17,31 @@ extern "C" { #endif -#ifndef MIPS -#if (_MSC_VER <= 600) -#define __cdecl _cdecl -#endif +#include + +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + */ +#if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) + +/* + * Definitions for MS C8-32 (386/486) compiler + */ +#define _CRTAPI1 __cdecl +#define _CRTAPI2 __cdecl + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + #endif + #ifndef _TIME_T_DEFINED typedef long time_t; #define _TIME_T_DEFINED @@ -32,6 +51,9 @@ typedef long time_t; #ifndef _STAT_DEFINED +#ifdef _M_IX86 +#pragma pack(4) +#endif /* _M_IX86 */ struct _stat { _dev_t st_dev; @@ -47,11 +69,9 @@ struct _stat { time_t st_ctime; }; -#if !__STDC__ -/* Non-ANSI name for compatibility */ -// stat already mapped to _stat below -#endif - +#ifdef _M_IX86 +#pragma pack() +#endif /* _M_IX86 */ #define _STAT_DEFINED #endif @@ -59,6 +79,7 @@ struct _stat { #define _S_IFMT 0170000 /* file type mask */ #define _S_IFDIR 0040000 /* directory */ #define _S_IFCHR 0020000 /* character special */ +#define _S_IFIFO 0010000 /* pipe */ #define _S_IFREG 0100000 /* regular */ #define _S_IREAD 0000400 /* read permission, owner */ #define _S_IWRITE 0000200 /* write permission, owner */ @@ -67,8 +88,8 @@ struct _stat { /* function prototypes */ -int _fstat(int, struct _stat *); -int _stat(char *, struct _stat *); +int _CRTAPI1 _fstat(int, struct _stat *); +int _CRTAPI1 _stat(const char *, struct _stat *); #if !__STDC__ /* Non-ANSI names for compatibility */