MRPT  1.9.9
rptypes.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 /*
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
33 
34 #pragma once
35 
36 #ifdef _WIN32
37 
38 // fake stdint.h for VC only
39 
40 typedef signed char int8_t;
41 typedef unsigned char uint8_t;
42 
43 typedef __int16 int16_t;
44 typedef unsigned __int16 uint16_t;
45 
46 typedef __int32 int32_t;
47 typedef unsigned __int32 uint32_t;
48 
49 typedef __int64 int64_t;
50 typedef unsigned __int64 uint64_t;
51 
52 #else
53 
54 #include <stdint.h>
55 
56 #endif
57 
58 // based on stdint.h
59 typedef int8_t _s8;
60 typedef uint8_t _u8;
61 
62 typedef int16_t _s16;
63 typedef uint16_t _u16;
64 
65 typedef int32_t _s32;
66 typedef uint32_t _u32;
67 
68 typedef int64_t _s64;
69 typedef uint64_t _u64;
70 
71 #define __small_endian
72 
73 #ifndef __GNUC__
74 #define __attribute__(x)
75 #endif
76 
77 // The _word_size_t uses actual data bus width of the current CPU
78 #ifdef _AVR_
79 typedef _u8 _word_size_t;
80 #define THREAD_PROC
81 #elif defined(WIN64)
82 typedef _u64 _word_size_t;
83 #define THREAD_PROC __stdcall
84 #elif defined(WIN32)
85 typedef _u32 _word_size_t;
86 #define THREAD_PROC __stdcall
87 #elif defined(__GNUC__)
88 typedef unsigned long _word_size_t;
89 #define THREAD_PROC
90 #elif defined(__ICCARM__)
91 typedef _u32 _word_size_t;
92 #define THREAD_PROC
93 #endif
94 
96 
97 #define RESULT_OK 0
98 #define RESULT_FAIL_BIT 0x80000000
99 #define RESULT_ALREADY_DONE 0x20
100 #define RESULT_INVALID_DATA (0x8000 | RESULT_FAIL_BIT)
101 #define RESULT_OPERATION_FAIL (0x8001 | RESULT_FAIL_BIT)
102 #define RESULT_OPERATION_TIMEOUT (0x8002 | RESULT_FAIL_BIT)
103 #define RESULT_OPERATION_STOP (0x8003 | RESULT_FAIL_BIT)
104 #define RESULT_OPERATION_NOT_SUPPORT (0x8004 | RESULT_FAIL_BIT)
105 #define RESULT_FORMAT_NOT_SUPPORT (0x8005 | RESULT_FAIL_BIT)
106 #define RESULT_INSUFFICIENT_MEMORY (0x8006 | RESULT_FAIL_BIT)
107 
108 #define IS_OK(x) (((x)&RESULT_FAIL_BIT) == 0)
109 #define IS_FAIL(x) (((x)&RESULT_FAIL_BIT))
110 
111 typedef _word_size_t(THREAD_PROC* thread_proc_t)(void*);
unsigned __int16 uint16_t
Definition: rptypes.h:44
signed char int8_t
Definition: rptypes.h:40
unsigned char uint8_t
Definition: rptypes.h:41
uint8_t _u8
Definition: rptypes.h:60
__int16 int16_t
Definition: rptypes.h:43
__int64 int64_t
Definition: rptypes.h:49
_word_size_t(THREAD_PROC * thread_proc_t)(void *)
Definition: rptypes.h:111
int32_t _s32
Definition: rptypes.h:65
int64_t _s64
Definition: rptypes.h:68
__int32 int32_t
Definition: rptypes.h:46
unsigned __int64 uint64_t
Definition: rptypes.h:50
uint32_t _u32
Definition: rptypes.h:66
int16_t _s16
Definition: rptypes.h:62
uint64_t _u64
Definition: rptypes.h:69
uint16_t _u16
Definition: rptypes.h:63
unsigned __int32 uint32_t
Definition: rptypes.h:47
int8_t _s8
Definition: rptypes.h:59
uint32_t u_result
Definition: rptypes.h:95



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020