1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2016 Intel Corporation. All rights reserved.
4  *
5  * Author: Michal Jerzy Wierzbicki <michalx.wierzbicki@intel.com>
6  */
7 
8 /* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY */
9 
10 #ifdef __SOF_TRACE_PREPROC_PRIVATE_H__
11 /* Macros defined in this file are only helpers for the macros that are
12  * defined in header file containing "namespace"
13  *     __SOF_TRACE_PREPROC_PRIVATE_H__ .
14  * This combination of #ifdef and #ifndef should sufficently narrow
15  * the "include-ability" of this dependent header file.
16  * If you wish to use macros from this file directly, be *V E R Y* careful!
17  * HIC SUNT DRACONES
18  */
19 #ifndef __SOF_TRACE_PREPROC_PRIVATE_DEC_H__
20 #define __SOF_TRACE_PREPROC_PRIVATE_DEC_H__
21 
22 /* The only sane way I found to decrement values in cpreproc */
23 /* for instance META_DEC(3) will be tokenized to DEC_3
24  * and then expanded again to 2
25  */
26 #define _META_DEC_0    0 // notice how we deal with underflow
27 #define _META_DEC_1    0
28 #define _META_DEC_2    1
29 #define _META_DEC_3    2
30 #define _META_DEC_4    3
31 #define _META_DEC_5    4
32 #define _META_DEC_6    5
33 #define _META_DEC_7    6
34 #define _META_DEC_8    7
35 #define _META_DEC_9    8
36 #define _META_DEC_10   9
37 #define _META_DEC_11  10
38 #define _META_DEC_12  11
39 #define _META_DEC_13  12
40 #define _META_DEC_14  13
41 #define _META_DEC_15  14
42 #define _META_DEC_16  15
43 #define _META_DEC_17  16
44 #define _META_DEC_18  17
45 #define _META_DEC_19  18
46 #define _META_DEC_20  19
47 #define _META_DEC_21  20
48 #define _META_DEC_22  21
49 #define _META_DEC_23  22
50 #define _META_DEC_24  23
51 #define _META_DEC_25  24
52 #define _META_DEC_26  25
53 #define _META_DEC_27  26
54 #define _META_DEC_28  27
55 #define _META_DEC_29  28
56 #define _META_DEC_30  29
57 #define _META_DEC_31  30
58 #define _META_DEC_32  31
59 #define _META_DEC_33  32
60 #define _META_DEC_34  33
61 #define _META_DEC_35  34
62 #define _META_DEC_36  35
63 #define _META_DEC_37  36
64 #define _META_DEC_38  37
65 #define _META_DEC_39  38
66 #define _META_DEC_40  39
67 #define _META_DEC_41  40
68 #define _META_DEC_42  41
69 #define _META_DEC_43  42
70 #define _META_DEC_44  43
71 #define _META_DEC_45  44
72 #define _META_DEC_46  45
73 #define _META_DEC_47  46
74 #define _META_DEC_48  47
75 #define _META_DEC_49  48
76 #define _META_DEC_50  49
77 #define _META_DEC_51  50
78 #define _META_DEC_52  51
79 #define _META_DEC_53  52
80 #define _META_DEC_54  53
81 #define _META_DEC_55  54
82 #define _META_DEC_56  55
83 #define _META_DEC_57  56
84 #define _META_DEC_58  57
85 #define _META_DEC_59  58
86 #define _META_DEC_60  59
87 #define _META_DEC_61  60
88 #define _META_DEC_62  61
89 #define _META_DEC_63  62
90 #define _META_DEC_64  63
91 
92 #endif /* __SOF_TRACE_PREPROC_PRIVATE_DEC_H__ */
93 #else
94 	#error \
95 		Illegal use of header file: \
96 		can only be included from context of \
97 		__INCLUDE_MACRO_METAPROGRAMMING_PRIVATE__
98 #endif /* __SOF_TRACE_PREPROC_PRIVATE_H__ */
99