Sha256: 91a7da713aa204bb61d06515c9e88d13dbb01a81a636fc43b8342627eb73e3e4

Contents?: true

Size: 1.57 KB

Versions: 20

Compression:

Stored size: 1.57 KB

Contents

#ifndef _UNISTD_H
#define _UNISTD_H    1

/* This file intended to serve as a drop-in replacement for 
 *  unistd.h on Windows
 *  Please add functionality as neeeded 
 */

#include <stdlib.h>
#include <io.h>
#include <process.h> /* for getpid() and the exec..() family */
#include <direct.h> /* for _getcwd() and _chdir() */

#define srandom srand
#define random rand

/* Values for the second argument to access.
   These may be OR'd together.  */
#define R_OK    4       /* Test for read permission.  */
#define W_OK    2       /* Test for write permission.  */
//#define   X_OK    1       /* execute permission - unsupported in windows*/
#define F_OK    0       /* Test for existence.  */

#define access _access
#define dup2 _dup2
#define execve _execve
#define ftruncate _chsize
#define unlink _unlink
#define fileno _fileno
#define getcwd _getcwd
#define chdir _chdir
#define isatty _isatty
#define lseek _lseek
/* read, write, and close are NOT being #defined here, because while there are file handle specific versions for Windows, they probably don't work for sockets. You need to look at your app and consider whether to call e.g. closesocket(). */

#define ssize_t int

#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* should be in some equivalent to <sys/types.h> */
typedef __int8            int8_t;
typedef __int16           int16_t; 
typedef __int32           int32_t;
typedef __int64           int64_t;
typedef unsigned __int8   uint8_t;
typedef unsigned __int16  uint16_t;
typedef unsigned __int32  uint32_t;
typedef unsigned __int64  uint64_t;

#endif /* unistd.h  */

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mathematical-1.6.20 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.18 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.14 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.13 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.12 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.11 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.10 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.9 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.8 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.7 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.6 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.5 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.4 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.3 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.2 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.1 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.6.0 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.5.12 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.5.0 ext/mathematical/mtex2MML/src/win32-shims/unistd.h
mathematical-1.4.2 ext/mathematical/mtex2MML/src/win32-shims/unistd.h