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>
6 * \date first release 19/12/2006
7 * \date modification 26/03/2007
10 #ifndef _VP_SDK_TYPES_H_
11 #define _VP_SDK_TYPES_H_
13 #include <VP_Os/vp_os.h>
15 #if defined(USE_LINUX) || defined(__ELINUX__)
16 # include "vp_os_serial.h"
23 #define VP_SUCCESS (0)
24 #define VP_FAILURE (!VP_SUCCESS)
26 #define VP_SUCCEEDED(a) (((a) & 0xffff) == VP_SUCCESS)
27 #define VP_FAILED(a) (((a) & 0xffff) != VP_SUCCESS)
31 Those macros have been used in the SDK but are already defined in Windows.h
32 and thus used with a wrong value when compiling under Windows, leading to a crash.
33 VP_xxx macros should be used to avoid confusion.
35 #define SUCCESS VP_SUCCESS
36 #define FAIL VP_FAILURE
38 #define SUCCEED VP_SUCCEEDED
39 #define FAILED VP_FAILED
45 //typedef unsigned __int64 off64_t;
48 #if defined(_WIN32) || defined(USE_MINGW32)
50 // Definition des types entiers
51 typedef signed __int8 int8_t;
52 typedef unsigned __int8 uint8_t;
53 typedef signed __int16 int16_t;
54 typedef unsigned __int16 uint16_t;
55 typedef signed __int32 int32_t;
56 typedef unsigned __int32 uint32_t;
57 typedef signed __int64 int64_t;
58 typedef unsigned __int64 uint64_t;
62 #if defined(__NDS__) || defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR)
72 #endif // < __NDS__ || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
74 typedef float float32_t;
75 typedef double float64_t;
77 #if defined(__linux__) && !defined(USE_MINGW32)
85 #if defined(USE_ANDROID)
89 #define __FD_ZERO(fdsetp) (vp_os_memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
91 #define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)
95 #define bool_t int32_t
97 #if defined(USE_PARROTOS_CORE)
98 #include <generic/parrotOS_types.h>
102 #if !defined(USE_MINGW32)
112 #endif // < USE_MINGW32
114 #if !defined(USE_ANDROID)
115 typedef volatile uint8_t vuint8;
116 typedef volatile uint16_t vuint16;
117 typedef volatile uint32_t vuint32;
118 typedef volatile uint64_t vuint64;
120 typedef volatile int8_t vint8;
121 typedef volatile int16_t vint16;
122 typedef volatile int32_t vint32;
123 typedef volatile int64_t vint64;
126 #define INT_MAX 2147483647
129 #endif // !USE_ANDROID
132 # include <VP_Os/linux/intrin.h>
135 #define BDADDR_SIZE 6
137 #if !defined(__BLUETOOTH_H)
138 typedef struct _bdaddr_t
140 uint8_t b[BDADDR_SIZE];
142 #endif // !defined(__BLUETOOTH_H)
144 typedef C_RESULT (*Read) (void* s, int8_t* buffer, int32_t* size);
145 typedef C_RESULT (*Write) (void* s, const int8_t* buffer, int32_t* size);