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_
14 #include <VP_Os/vp_os.h>
16 #if defined(USE_LINUX) || defined(__ELINUX__)
17 # include "vp_os_serial.h"
24 #define VP_SUCCESS (0)
25 #define VP_FAILURE (!VP_SUCCESS)
27 #define VP_SUCCEEDED(a) (((a) & 0xffff) == VP_SUCCESS)
28 #define VP_FAILED(a) (((a) & 0xffff) != VP_SUCCESS)
32 Those macros have been used in the SDK but are already defined in Windows.h
33 and thus used with a wrong value when compiling under Windows, leading to a crash.
34 VP_xxx macros should be used to avoid confusion.
36 #define SUCCESS VP_SUCCESS
37 #define FAIL VP_FAILURE
39 #define SUCCEED VP_SUCCEEDED
40 #define FAILED VP_FAILED
46 //typedef unsigned __int64 off64_t;
49 #if defined(_WIN32) || defined(USE_MINGW32)
51 // Definition des types entiers
52 typedef signed __int8 int8_t;
53 typedef unsigned __int8 uint8_t;
54 typedef signed __int16 int16_t;
55 typedef unsigned __int16 uint16_t;
56 typedef signed __int32 int32_t;
57 typedef unsigned __int32 uint32_t;
58 typedef signed __int64 int64_t;
59 typedef unsigned __int64 uint64_t;
63 #if defined(__NDS__) || defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR)
73 #endif // < __NDS__ || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
75 typedef float float32_t;
76 typedef double float64_t;
78 #if defined(__linux__) && !defined(USE_MINGW32)
86 #if defined(USE_ANDROID)
90 #define __FD_ZERO(fdsetp) (vp_os_memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
92 #define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)
96 #define bool_t int32_t
98 #if defined(USE_PARROTOS_CORE)
99 #include <generic/parrotOS_types.h>
103 #if !defined(USE_MINGW32)
113 #endif // < USE_MINGW32
115 #if !defined(USE_ANDROID)
116 typedef volatile uint8_t vuint8;
117 typedef volatile uint16_t vuint16;
118 typedef volatile uint32_t vuint32;
119 typedef volatile uint64_t vuint64;
121 typedef volatile int8_t vint8;
122 typedef volatile int16_t vint16;
123 typedef volatile int32_t vint32;
124 typedef volatile int64_t vint64;
127 #define INT_MAX 2147483647
130 #endif // !USE_ANDROID
133 # include <VP_Os/linux/intrin.h>
136 #define BDADDR_SIZE 6
138 #if !defined(__BLUETOOTH_H)
139 typedef struct _bdaddr_t
141 uint8_t b[BDADDR_SIZE];
143 #endif // !defined(__BLUETOOTH_H)
145 typedef C_RESULT (*Read) (void* s, int8_t* buffer, int32_t* size);
146 typedef C_RESULT (*Write) (void* s, const int8_t* buffer, int32_t* size);