Speeduino
Loading...
Searching...
No Matches
preprocessor.h
Go to the documentation of this file.
1#pragma once
2
8#if !defined(UNUSED)
10#define UNUSED(x) \
11 (void)(x)
12#endif
13
15#if !defined(_countof)
16#define _countof(x) \
17 (sizeof((x)) / sizeof ((x)[0]))
18#endif
19
21#if !defined(_end_range_address)
22#define _end_range_address(array) \
23 ((array) + _countof((array)))
24#endif
25
27#if !defined(_end_range_byte_address)
28#define _end_range_byte_address(array) \
29 (((byte*)(array)) + sizeof((array)))
30#endif
31
33#if !defined(PP_INC)
34#define PP_INC(x) \
35 PP_INC_I(x)
36#endif
37
39// PP_INC() support macros
40#define PP_INC_I(x) PP_INC_ ## x
41#define PP_INC_0 1 // NOSONAR
42#define PP_INC_1 2 // NOSONAR
43#define PP_INC_2 3 // NOSONAR
44#define PP_INC_3 4 // NOSONAR
45#define PP_INC_4 5 // NOSONAR
46#define PP_INC_5 6 // NOSONAR
47#define PP_INC_6 7 // NOSONAR
48#define PP_INC_7 8 // NOSONAR
49#define PP_INC_8 9 // NOSONAR
50#define PP_INC_9 10 // NOSONAR
51#define PP_INC_10 11 // NOSONAR
52#define PP_INC_11 12 // NOSONAR
53#define PP_INC_12 13 // NOSONAR
55
57// CONCAT() support macros
58#define CAT_HELPER(a, b) a ## b
60
62#if !defined(CONCAT)
63#define CONCAT(A, B) \
64 CAT_HELPER(A, B)
65#endif