Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (38 sloc) 1000 Bytes
/* win32_compat.h
*
* compatibility stuff for Windows
*
* Thanks to Javier Gutiérrez Chamorro for Windows support.
*/
#ifndef _WIN32_COMPAT_H
#define _WIN32_COMPAT_H 1
#ifdef __cplusplus
extern "C" {
#endif
#include <process.h>
#include <errno.h>
#include <io.h> /* _findfirst and _findnext set errno iff they return -1 */
#include <fcntl.h>
#include <sys/utime.h>
#define snprintf _snprintf
#define lstat _stat
#define realpath(N,R) _fullpath((R),(N),MAXPATHLEN)
#define ftruncate(fildes,length) open(fildes, O_TRUNC|O_WRONLY)
#define set_filemode_binary(file) _setmode(_fileno(file), _O_BINARY)
#define round(x) ((int) (x))
#define getuid(x) 0
#define geteuid() 0
#define chown(outfname,st_uid,st_gid) 0
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#ifndef HOST_TYPE
#if _WIN64
#define HOST_TYPE "Win64"
#else if WIN32
#define HOST_TYPE "Win32"
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* _WIN32_COMPAT_H */
Something went wrong with that request. Please try again.