NERecord Linux SDK 5.5.3103
Loading...
Searching...
No Matches
nerecord_base_types.h
Go to the documentation of this file.
1
8#ifndef NERECORD_BASE_TYPES_H
9#define NERECORD_BASE_TYPES_H
10
11#include <sys/types.h>
12
13#ifndef _MSC_VER
14// stdint.h is part of C99 but MSVC doesn't have it.
15#include <stdint.h> // For intptr_t.
16#endif
17
18/* define int types*/
19#if defined(__GNUC__)
20
21#ifndef _STDINT_H
22
23/* FreeBSD has these C99 int types defined in /sys/inttypes.h already */
24#ifndef _SYS_TYPES_H
25typedef signed char int8_t;
26typedef signed short int16_t;
27typedef signed int int32_t;
28typedef signed long long int64_t;
29typedef unsigned char uint8_t;
30typedef unsigned short uint16_t;
31typedef unsigned int uint32_t;
32typedef unsigned long long uint64_t;
33#else
34typedef u_int8_t uint8_t;
35typedef u_int16_t uint16_t;
36typedef u_int32_t uint32_t;
37typedef u_int64_t uint64_t;
38#endif // _SYS_TYPES_H
39
40#endif // _STDINT_H
41
42#elif defined(_MSC_VER)
43typedef signed char int8_t;
44typedef signed short int16_t;
45typedef signed int int32_t;
46typedef signed __int64 int64_t;
47typedef unsigned char uint8_t;
48typedef unsigned short uint16_t;
49typedef unsigned int uint32_t;
50typedef unsigned __int64 uint64_t;
51
52/* the following definitions are from VS2010's stdint.h */
53// #ifndef _INTPTR_T_DEFINED
54// #define _INTPTR_T_DEFINED
55// #ifdef _WIN64
56// typedef __int64 intptr_t;
57// #else /* _WIN64 */
58// typedef _W64 int intptr_t;
59// #endif /* _WIN64 */
60// #endif /* _INTPTR_T_DEFINED */
61//
62// #ifndef _UINTPTR_T_DEFINED
63// #define _UINTPTR_T_DEFINED
64// #ifdef _WIN64
65// typedef unsigned __int64 uintptr_t;
66// #else /* _WIN64 */
67// typedef _W64 unsigned int uintptr_t;
68// #endif /* _WIN64 */
69// #endif /* _UINTPTR_T_DEFINED */
70
71#endif // COMPILER_GCC/COMPILER_MSVC
72
73//const uint8_t kUint8Max = (( uint8_t) 0xFF);
74//const uint16_t kUint16Max = ((uint16_t) 0xFFFF);
75//const uint32_t kUint32Max = ((uint32_t) 0xFFFFFFFF);
76//const uint64_t kUint64Max = ((uint64_t) GG_LONGLONG(0xFFFFFFFFFFFFFFFF));
77//const int8_t kInt8Min = (( int8_t) 0x80);
78//const int8_t kInt8Max = (( int8_t) 0x7F);
79//const int16_t kInt16Min = (( int16_t) 0x8000);
80//const int16_t kInt16Max = (( int16_t) 0x7FFF);
81//const int32_t kInt32Min = (( int32_t) 0x80000000);
82//const int32_t kInt32Max = (( int32_t) 0x7FFFFFFF);
83//const int64_t kInt64Min = (( int64_t) GG_LONGLONG(0x8000000000000000));
84//const int64_t kInt64Max = (( int64_t) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));
85
86#endif // NERECORD_BASE_TYPES_H