-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathchutil.h
58 lines (47 loc) · 1.37 KB
/
chutil.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* chutil.h
*
* Created on: 01.01.2017
* Author: joerg
*/
/**
* @file chutil.h
* @author Austin Glaser <[email protected]>
*
* Copyright (C) 2016 Austin Glaser
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*
* @brief Shared utility macros and functions
*/
#ifndef SRC_CHUTIL_H_
#define SRC_CHUTIL_H_
/**
* @defgroup UTIL Utilities
* @{
*/
/* --- PUBLIC MACROS -------------------------------------------------------- */
/**
* @brief Concatenates two symbols s1 and s2 exactly, without expanding either
*
* @param[in] s1: The first symbol to concatenate
* @param[in] s2: The second symbol to concatenate
*
* @return A single symbol containing s1 and s2 concatenated without expansion
*/
#define CONCAT_SYMBOLS(s1, s2) s1##s2
/**
* @brief Concatenate the symbols s1 and s2, expanding both of them
*
* This is important because simply applying s1##s2 doesn't expand them if they're
* preprocessor tokens themselves
*
* @param[in] s1: The first symbol to concatenate
* @param[in] s2: The second symbol to concatenate
*
* @return A single symbol containing s1 expanded followed by s2 expanded
*/
#define CONCAT_EXPANDED_SYMBOLS(s1, s2) CONCAT_SYMBOLS(s1, s2)
/** @} defgroup UTIL */
#endif /* SRC_CHUTIL_H_ */