1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
/* 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
#ifndef S_ISREG
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#ifndef HOST_TYPE
#if _WIN64
#define HOST_TYPE "Win64"
#elif WIN32
#define HOST_TYPE "Win32"
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* WIN32_COMPAT_H */
|