os.h 1.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#ifndef _OS_H_INCLUDED
#define _OS_H_INCLUDED

#if defined __FreeBSD__
typedef off_t off64_t;
#define lseek64(fd, offset, whence) lseek((fd), (offset), (whence))
#define open64(path, flags, mode)   open((path), (flags), (mode))
#define ftruncate64(fd, length)     ftruncate((fd), (length))
#define O_LARGEFILE 0
#endif

#if defined(WIN32)
typedef __int64 BIGINT;
#else   // !WIN32
15
typedef longlong  BIGINT;
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#define FILE_BEGIN    SEEK_SET  
#define FILE_CURRENT  SEEK_CUR  
#define FILE_END      SEEK_END  
#endif  // !WIN32

#if !defined(WIN32)
typedef const void *LPCVOID;
typedef const char *LPCTSTR;
typedef const char *LPCSTR;
typedef unsigned char BYTE;
typedef char *LPSTR;
typedef char *LPTSTR;
typedef char *PSZ;
typedef int INT;
#if !defined(NODW)
31
typedef unsigned int DWORD;
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 57
#endif   /* !NODW */
#undef  HANDLE     
typedef int   HANDLE;

/* TODO-BAR: remove this */
#ifdef __cplusplus
typedef int   bool;
#else
#define bool  my_bool
#endif

#define _MAX_PATH   PATH_MAX
#define stricmp     strcasecmp
#define _stricmp    strcasecmp
#define strnicmp    strncasecmp
#define _strnicmp   strncasecmp
#define _MAX_PATH   260
#define _MAX_DRIVE    3
#define _MAX_DIR    256
#define _MAX_FNAME  256
#define _MAX_EXT    256
#define INVALID_HANDLE_VALUE  (-1)
#define __stdcall
#endif /* !WIN32 */

#endif /* _OS_H_INCLUDED */