--- mstools/h/io.h 2018/08/09 18:20:01 1.1.1.1 +++ mstools/h/io.h 2018/08/09 18:21:13 1.1.1.3 @@ -1,7 +1,7 @@ /*** *io.h - declarations for low-level file handling and I/O functions * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. * *Purpose: * This file contains the function declarations for the low-level @@ -11,22 +11,52 @@ #ifndef _INC_IO +#ifndef _POSIX_ + #ifdef __cplusplus extern "C" { #endif -#if (_MSC_VER <= 600) -#define __cdecl _cdecl +/* + * 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 + +#elif ( _MSC_VER == 600 ) + +/* + * Definitions for old MS C6-386 compiler + */ +#define _CRTAPI1 _cdecl +#define _CRTAPI2 _cdecl +#define _M_IX86 300 + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + #endif + #ifndef _TIME_T_DEFINED typedef long time_t; /* time value */ #define _TIME_T_DEFINED /* avoid multiple def's of time_t */ #endif #ifndef _FSIZE_T_DEFINED -typedef unsigned long _fsize_t; // Could be 64 bits for Win32 +typedef unsigned long _fsize_t; /* Could be 64 bits for Win32 */ #define _FSIZE_T_DEFINED #endif @@ -34,8 +64,8 @@ typedef unsigned long _fsize_t; // C struct _finddata_t { unsigned attrib; - time_t time_create; // -1 for FAT file systems - time_t time_access; // -1 for FAT file systems + time_t time_create; /* -1 for FAT file systems */ + time_t time_access; /* -1 for FAT file systems */ time_t time_write; _fsize_t size; char name[256]; @@ -56,40 +86,40 @@ struct _finddata_t { /* function prototypes */ -int _access(const char *, int); -int _chmod(const char *, int); -int _chsize(int, long); -int _close(int); -int _commit(int); -int _creat(const char *, int); -int _dup(int); -int _dup2(int, int); -int _eof(int); -long _filelength(int); -int _isatty(int); -int _locking(int, int, long); -long _lseek(int, long, int); -char * _mktemp(char *); -int _open(const char *, int, ...); -int _pipe(int *, unsigned int, int); -int _read(int, void *, unsigned int); -int remove(const char *); -int rename(const char *, const char *); -int _setmode(int, int); -int _sopen(const char *, int, int, ...); -long _tell(int); -int _umask(int); -int _unlink(const char *); -int _write(int, const void *, unsigned int); -long _findfirst(char *, struct _finddata_t *); -int _findnext(long, struct _finddata_t *); -int _findclose(long); +int _CRTAPI1 _access(const char *, int); +int _CRTAPI1 _chmod(const char *, int); +int _CRTAPI1 _chsize(int, long); +int _CRTAPI1 _close(int); +int _CRTAPI1 _commit(int); +int _CRTAPI1 _creat(const char *, int); +int _CRTAPI1 _dup(int); +int _CRTAPI1 _dup2(int, int); +int _CRTAPI1 _eof(int); +long _CRTAPI1 _filelength(int); +long _CRTAPI1 _findfirst(char *, struct _finddata_t *); +int _CRTAPI1 _findnext(long, struct _finddata_t *); +int _CRTAPI1 _findclose(long); +int _CRTAPI1 _isatty(int); +int _CRTAPI1 _locking(int, int, long); +long _CRTAPI1 _lseek(int, long, int); +char * _CRTAPI1 _mktemp(char *); +int _CRTAPI2 _open(const char *, int, ...); +int _CRTAPI1 _pipe(int *, unsigned int, int); +int _CRTAPI1 _read(int, void *, unsigned int); +int _CRTAPI1 remove(const char *); +int _CRTAPI1 rename(const char *, const char *); +int _CRTAPI1 _setmode(int, int); +int _CRTAPI2 _sopen(const char *, int, int, ...); +long _CRTAPI1 _tell(int); +int _CRTAPI1 _umask(int); +int _CRTAPI1 _unlink(const char *); +int _CRTAPI1 _write(int, const void *, unsigned int); -long _get_osfhandle(int); -int _open_osfhandle(long, int); +long _CRTAPI1 _get_osfhandle(int); +int _CRTAPI1 _open_osfhandle(long, int); -#if !__STDC__ +#if !(__STDC__ || defined(__cplusplus)) /* Non-ANSI names for compatibility */ #define access _access #define chmod _chmod @@ -118,5 +148,8 @@ int _open_osfhandle(long, int); } #endif + +#endif /* _POSIX_ */ + #define _INC_IO #endif /* _INC_IO */