F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
BasicTypes.h
Go to the documentation of this file.
1 
12 #include <PlatformTypes.h>
13 #ifndef FW_BASIC_TYPES_H
14 #define FW_BASIC_TYPES_H
15 
16 // Compiler checks
17 #if defined(__GNUC__) || defined(__llvm__) || defined(PLATFORM_OVERRIDE_GCC_CLANG_CHECK)
18 #else
19 #error Unsupported compiler!
20 #endif
21 
22 /*----------------------------------------------------------------------------*/
23 /* Type definitions: I8, U8, I16, U16, ..., I64, U64, F32, and F64 */
24 /*----------------------------------------------------------------------------*/
25 typedef int8_t I8;
26 typedef uint8_t U8;
27 typedef U8 BYTE;
28 typedef char CHAR;
29 
30 #if FW_HAS_16_BIT
31 typedef int16_t I16;
32 typedef uint16_t U16;
33 #endif
34 
35 #if FW_HAS_32_BIT
36 typedef int32_t I32;
37 typedef uint32_t U32;
38 #endif
39 
40 #if FW_HAS_64_BIT
41 typedef int64_t I64;
42 typedef uint64_t U64;
43 #endif
44 
45 typedef float F32;
46 #if FW_HAS_F64
47 typedef double F64;
48 #endif
49 
50 // Backwards-compatibility definitions
54 
55 /*----------------------------------------------------------------------------*/
56 /* Useful macro definitions */
57 /*----------------------------------------------------------------------------*/
58 #define FW_NO_ASSERT 1
59 #define FW_FILEID_ASSERT \
60  2
61 #define FW_FILENAME_ASSERT 3
62 #define FW_RELATIVE_PATH_ASSERT \
63  4
65 
66 #define FW_NUM_ARRAY_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
67 #define FW_MAX(a, b) (((a) > (b)) ? (a) : (b))
68 #define FW_MIN(a, b) (((a) < (b)) ? (a) : (b))
69 
70 #ifndef STATIC
71 #define STATIC static
72 #endif
73 
74 #ifndef PROTECTED
75 #define PROTECTED protected
76 #endif
77 
78 #ifndef PRIVATE
79 #define PRIVATE private
80 #endif
81 
82 #endif // FW_BASIC_TYPES_H
PlatformPointerCastType POINTER_CAST
Definition: BasicTypes.h:53
int8_t I8
8-bit signed integer
Definition: BasicTypes.h:25
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
U8 BYTE
byte type
Definition: BasicTypes.h:27
float F32
32-bit floating point
Definition: BasicTypes.h:45
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:26
char CHAR
Definition: BasicTypes.h:28
PlatformUIntType NATIVE_UINT_TYPE
Definition: BasicTypes.h:52
uint8_t PlatformPointerCastType
unsigned int PlatformUIntType
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
#define U64(C)
Definition: sha.h:176