Commit | Line | Data |
cfca19c6 |
1 | #ifndef SFTYPES_INCLUDED |
2 | #define SFTYPES_INCLUDED |
3 | |
4 | #if defined(_WIN32) || defined(_WIN64) |
5 | |
6 | typedef signed char Int8; |
7 | typedef signed short Int16; |
8 | typedef signed long Int32; |
9 | typedef signed __int64 Int64; |
10 | |
11 | #ifdef _WIN64 |
12 | typedef signed __int64 IntPtr; |
13 | #else |
14 | typedef signed int IntPtr; |
15 | #endif |
16 | |
17 | typedef unsigned char UInt8; |
18 | typedef unsigned short UInt16; |
19 | typedef unsigned long UInt32; |
20 | typedef unsigned __int64 UInt64; |
21 | |
22 | #ifdef _WIN64 |
23 | typedef unsigned __int64 UIntPtr; |
24 | #else |
25 | typedef unsigned int UIntPtr; |
26 | #endif |
27 | |
28 | #else |
29 | |
30 | #include <stdint.h> |
31 | |
32 | typedef int8_t Int8; |
33 | typedef int16_t Int16; |
34 | typedef int32_t Int32; |
35 | typedef int64_t Int64; |
36 | typedef intptr_t IntPtr; |
37 | |
38 | typedef uint8_t UInt8; |
39 | typedef uint16_t UInt16; |
40 | typedef uint32_t UInt32; |
41 | typedef uint64_t UInt64; |
42 | typedef uintptr_t UIntPtr; |
43 | |
44 | #endif |
45 | |
46 | union IntConv { |
47 | Int8 i8[8]; |
48 | UInt8 ui8[8]; |
49 | Int16 i16[4]; |
50 | UInt16 ui16[4]; |
51 | Int32 i32[2]; |
52 | UInt32 ui32[2]; |
53 | Int64 i64; |
54 | UInt64 ui64; |
55 | }; |
56 | |
57 | #endif // #ifndef SFTYPES_INCLUDED |