0
|
1 #ifndef PORTABLE_H
|
|
2 #define PORTABLE_H
|
|
3
|
|
4 #if (defined(WIN32) && MSC_VER < 1300)
|
|
5
|
|
6 typedef unsigned char uint8_t;
|
|
7 typedef signed char int8_t;
|
|
8 typedef unsigned short uint16_t;
|
|
9 typedef signed short int16_t;
|
|
10 typedef unsigned int uint32_t;
|
|
11 typedef signed int int32_t;
|
|
12 typedef unsigned __int64 uint64_t;
|
|
13 typedef signed __int64 int64_t;
|
|
14
|
|
15 #else
|
|
16
|
|
17 #include <inttypes.h>
|
|
18
|
|
19 #endif
|
|
20
|
|
21 #if !defined(WIN32)
|
|
22 #define _open open
|
|
23 #define _close close
|
|
24 #define _read read
|
|
25 #define _write write
|
|
26 #define _lseeki64 lseek
|
|
27 #define _telli64(fd) (lseek(fd,0,SEEK_CUR))
|
|
28 #define _O_BINARY (0)
|
|
29 #define _O_RDONLY (O_RDONLY)
|
|
30 #define _O_WRONLY (O_WRONLY)
|
|
31 #define _O_SEQUENTIAL (0)
|
|
32 #define _O_CREAT (O_CREAT)
|
|
33 #define _O_TRUNC (O_TRUNC)
|
|
34 #define _S_IREAD (S_IRUSR|S_IRGRP|S_IROTH)
|
|
35 #define _S_IWRITE (S_IWUSR|S_IWGRP|S_IWOTH)
|
|
36 #endif
|
|
37
|
|
38 #endif /* PORTABLE_H */
|