Opto MMP Toolkit
 All Classes Functions Variables
O22TYPES.h
1 //-----------------------------------------------------------------------------
2 //
3 // O22TYPES.h
4 // Copyright (c) 2012 by Opto 22
5 //
6 // We rely on the C99 standarized types (e.g. uint8_t, uint32_t, etc.) for
7 // portability. Unfortunately, stdint.h is not available in Visual Studio
8 // versions prior to 2010, so we have to define them ourselves here.
9 //-----------------------------------------------------------------------------
10 
11 #ifndef __O22TYPES_H_
12 #define __O22TYPES_H_
13 
14 #ifndef _MSC_VER
15 #include <stdint.h>
16 #else
17 
18 #if (_MSC_VER >= 1600)
19 #include <stdint.h>
20 
21 #else
22 
23 // Visual Studio 6 and Embedded Visual C++ 4 doesn't
24 // realize that, e.g. char has the same size as __int8
25 // so we give up on __intX for them.
26 #if (_MSC_VER < 1300)
27  typedef signed char int8_t;
28  typedef signed short int16_t;
29  typedef signed int int32_t;
30  typedef unsigned char uint8_t;
31  typedef unsigned short uint16_t;
32  typedef unsigned int uint32_t;
33 #else
34  typedef signed __int8 int8_t;
35  typedef signed __int16 int16_t;
36  typedef signed __int32 int32_t;
37  typedef unsigned __int8 uint8_t;
38  typedef unsigned __int16 uint16_t;
39  typedef unsigned __int32 uint32_t;
40 #endif // _MSC_VER < 1300
41 typedef signed __int64 int64_t;
42 typedef unsigned __int64 uint64_t;
43 
44 #endif // _MSC_VER >= 1600
45 #endif // ifndef _MSC_VER
46 
47 #endif /* include guard */