ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Multiplatform / Protocol / VP_Os / vp_os_types.h
1 /**
2  *  \brief    VP OS. Types declaration.
3  *  \brief    These types are used to provide clean types declaration for portability between OSes
4  *  \author   Sylvain Gaeremynck <sylvain.gaeremynck@parrot.fr>
5  *  \version  1.0
6  *  \date     first release 19/12/2006
7  *  \date     modification  26/03/2007
8  */
9
10 #ifndef _VP_SDK_TYPES_H_
11 #define _VP_SDK_TYPES_H_
12
13 #include <VP_Os/vp_os.h>
14
15 #define C_RESULT        int
16 #define C_OK            0
17 #define C_FAIL          -1
18
19 #define SUCCESS         (0)
20 #define FAIL            (!SUCCESS)
21
22 #define SUCCEED(a)      (((a) & 0xffff) == SUCCESS)
23 #define FAILED(a)       (((a) & 0xffff) != SUCCESS)
24 #ifdef USE_MINGW32
25 #include <windows.h>
26 #include <windef.h>
27 #endif
28
29 #if defined(USE_MINGW32)
30
31 // Definition des types entiers
32 typedef signed    __int8    int8_t;
33 typedef unsigned  __int8    uint8_t;
34 typedef signed    __int16   int16_t;
35 typedef unsigned  __int16   uint16_t;
36 typedef signed    __int32   int32_t;
37 typedef unsigned  __int32   uint32_t;
38 typedef signed    __int64   int64_t;
39 typedef unsigned  __int64   uint64_t;
40
41 #endif // < _WIN32
42
43 typedef float               float32_t;
44 typedef double              float64_t;
45
46 #if !defined(USE_MINGW32)
47
48 #include <stdint.h>
49 #include <stddef.h>
50
51 #define CBOOL int
52
53 #endif // < __linux__
54
55 typedef volatile uint8_t    vuint8;
56 typedef volatile uint16_t   vuint16;
57 typedef volatile uint32_t   vuint32;
58 typedef volatile uint64_t   vuint64;
59
60 typedef volatile int8_t     vint8;
61 typedef volatile int16_t    vint16;
62 typedef volatile int32_t    vint32;
63 typedef volatile int64_t    vint64;
64
65 #define bool_t  int32_t
66
67 #if !defined(USE_MINGW32)
68
69 #ifndef TRUE
70 #define TRUE    1
71 #endif
72
73 #ifndef FALSE
74 #define FALSE   0
75 #endif
76
77 #endif // < USE_MINGW32
78
79 #define BDADDR_SIZE   6
80
81 #if !defined(__BLUETOOTH_H)
82 typedef struct _bdaddr_t
83 {
84   uint8_t b[BDADDR_SIZE];
85 } bdaddr_t;
86 #endif // !defined(__BLUETOOTH_H)
87
88 #endif // _TYPES_H_