source: trunk/third-party/libutp/utypes.h @ 13317

Last change on this file since 13317 was 13317, checked in by livings124, 9 years ago

update libutp, fixing #4915

File size: 902 bytes
Line 
1#ifndef __UTYPES_H__
2#define __UTYPES_H__
3
4// standard types
5typedef unsigned char byte;
6typedef unsigned char uint8;
7typedef signed char int8;
8typedef unsigned short uint16;
9typedef signed short int16;
10typedef unsigned int uint;
11typedef unsigned int uint32;
12typedef signed int int32;
13
14#ifdef _MSC_VER
15typedef unsigned __int64 uint64;
16typedef signed __int64 int64;
17#else
18typedef unsigned long long uint64;
19typedef long long int64;
20#endif
21
22/* compile-time assert */
23#ifndef CASSERT
24#define CASSERT( exp, name ) typedef int is_not_##name [ (exp ) ? 1 : -1 ];
25#endif
26
27CASSERT(8 == sizeof(uint64), sizeof_uint64_is_8)
28CASSERT(8 == sizeof(int64), sizeof_int64_is_8)
29
30#ifndef INT64_MAX
31#define INT64_MAX 0x7fffffffffffffffLL
32#endif
33
34// always ANSI
35typedef const char * cstr;
36typedef char * str;
37
38#ifndef __cplusplus
39typedef uint8 bool;
40#endif
41
42#endif //__UTYPES_H__
Note: See TracBrowser for help on using the repository browser.