-
Notifications
You must be signed in to change notification settings - Fork 0
/
preprocessor_char_eq.h
533 lines (493 loc) · 25.7 KB
/
preprocessor_char_eq.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
/*
* CREATED BY SHPEGUN60
*
* CHAR LITERALS EQUALUATION MACROCES
*/
#ifndef __PREPROCESSOR_CHAR_EQ_H__
#define __PREPROCESSOR_CHAR_EQ_H__ 1
#include "preprocessor_tuple.h"
#include "preprocessor_logical.h"
/*********************************************************************************************************************
* LOWER CHAR detector macro
*
* PREPROCESSOR_CHAR_IS_LOWERCASE(l) // expands to 1
* PREPROCESSOR_CHAR_IS_LOWERCASE(L) // expands to 0
* PREPROCESSOR_CHAR_IS_LOWERCASE() // expands to 0
*
*/
#define PREPROCESSOR_CHAR_IS_LOWERCASE(x) PREPROCESSOR_CHAR_IS_LOWERCASE_IMPL(x)
#define PREPROCESSOR_CHAR_IS_LOWERCASE_IMPL(x) PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_LOWER_DETECTOR_##x##_##x)
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_a_a ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_b_b ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_c_c ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_d_d ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_e_e ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_f_f ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_g_g ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_h_h ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_i_i ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_j_j ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_k_k ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_l_l ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_m_m ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_n_n ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_o_o ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_p_p ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_q_q ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_r_r ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_s_s ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_t_t ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_u_u ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_v_v ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_w_w ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_x_x ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_y_y ()
#define PREPROCESSOR_CHAR_LOWER_DETECTOR_z_z ()
/*********************************************************************************************************************
* UPPER CHAR detector macro
*
* PREPROCESSOR_CHAR_IS_UPPERCASE(l) // expands to 0
* PREPROCESSOR_CHAR_IS_UPPERCASE(L) // expands to 1
* PREPROCESSOR_CHAR_IS_UPPERCASE() // expands to 0
*
*/
#define PREPROCESSOR_CHAR_IS_UPPERCASE(x) PREPROCESSOR_CHAR_IS_UPPERCASE_IMPL(x)
#define PREPROCESSOR_CHAR_IS_UPPERCASE_IMPL(x) PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_UPPER_DETECTOR_##x##_##x)
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_A_A ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_B_B ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_C_C ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_D_D ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_E_E ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_F_F ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_G_G ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_H_H ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_I_I ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_J_J ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_K_K ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_L_L ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_M_M ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_N_N ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_O_O ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_P_P ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_Q_Q ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_R_R ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_S_S ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_T_T ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_U_U ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_V_V ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_W_W ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_X_X ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_Y_Y ()
#define PREPROCESSOR_CHAR_UPPER_DETECTOR_Z_Z ()
/*********************************************************************************************************************
* UNDERSCORE CHAR detector macro
*
* PREPROCESSOR_CHAR_IS_UNDERSCORE(a) // expands to 0
* PREPROCESSOR_CHAR_IS_UNDERSCORE(_) // expands to 1
* PREPROCESSOR_CHAR_IS_UNDERSCORE() // expands to 0
*
*/
#define PREPROCESSOR_CHAR_IS_UNDERSCORE(x) PREPROCESSOR_CHAR_IS_UNDERSCORE_IMPL(x)
#define PREPROCESSOR_CHAR_IS_UNDERSCORE_IMPL(x) PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_UNDERSCORE_DETECTOR##x##x)
#define PREPROCESSOR_CHAR_UNDERSCORE_DETECTOR__ ()
/*********************************************************************************************************************
* POSITIVE CHAR DIGITS DETECT MACRO
*
* PREPROCESSOR_CHAR_IS_DIGIT(128) // expands to 0 WARNING!!! CHAR TYPE IS SIGNED, value 128 is overflow
* PREPROCESSOR_CHAR_IS_DIGIT(99) // expands to 1
* PREPROCESSOR_CHAR_IS_DIGIT(aaa) // expands to 0
* PREPROCESSOR_CHAR_IS_DIGIT() // expands to 0
*
*/
#define PREPROCESSOR_CHAR_IS_DIGIT(x) PREPROCESSOR_CHAR_IS_DIGIT_IMPL(x)
#define PREPROCESSOR_CHAR_IS_DIGIT_IMPL(x) PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_DIGIT_DETECTOR_##x##_##x)
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_0_0 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_1_1 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_2_2 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_3_3 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_4_4 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_5_5 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_6_6 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_7_7 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_8_8 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_9_9 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_10_10 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_11_11 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_12_12 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_13_13 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_14_14 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_15_15 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_16_16 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_17_17 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_18_18 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_19_19 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_20_20 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_21_21 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_22_22 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_23_23 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_24_24 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_25_25 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_26_26 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_27_27 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_28_28 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_29_29 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_30_30 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_31_31 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_32_32 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_33_33 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_34_34 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_35_35 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_36_36 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_37_37 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_38_38 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_39_39 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_40_40 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_41_41 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_42_42 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_43_43 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_44_44 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_45_45 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_46_46 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_47_47 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_48_48 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_49_49 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_50_50 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_51_51 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_52_52 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_53_53 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_54_54 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_55_55 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_56_56 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_57_57 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_58_58 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_59_59 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_60_60 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_61_61 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_62_62 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_63_63 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_64_64 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_65_65 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_66_66 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_67_67 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_68_68 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_69_69 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_70_70 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_71_71 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_72_72 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_73_73 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_74_74 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_75_75 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_76_76 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_77_77 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_78_78 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_79_79 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_80_80 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_81_81 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_82_82 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_83_83 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_84_84 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_85_85 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_86_86 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_87_87 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_88_88 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_89_89 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_90_90 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_91_91 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_92_92 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_93_93 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_94_94 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_95_95 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_96_96 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_97_97 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_98_98 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_99_99 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_100_100 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_101_101 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_102_102 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_103_103 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_104_104 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_105_105 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_106_106 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_107_107 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_108_108 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_109_109 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_110_110 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_111_111 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_112_112 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_113_113 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_114_114 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_115_115 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_116_116 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_117_117 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_118_118 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_119_119 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_120_120 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_121_121 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_122_122 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_123_123 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_124_124 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_125_125 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_126_126 ()
#define PREPROCESSOR_CHAR_DIGIT_DETECTOR_127_127 ()
/*********************************************************************************************************************
* IS CHAR detector macro. WARNING!!! DO NOT DETECT SIGNED CHAR DEGITS, DETECT ONLY UNSIGNED CHAR DIGITS
*
* PREPROCESSOR_IS_CHAR() // expands to 0
* PREPROCESSOR_IS_CHAR(1) // expands to 1
* PREPROCESSOR_IS_CHAR(aaa) // expands to 0
* PREPROCESSOR_IS_CHAR(99) // expands to 1
* PREPROCESSOR_IS_CHAR(_) // expands to 1
* PREPROCESSOR_IS_CHAR(A) // expands to 1
*
*/
#define PREPROCESSOR_IS_CHAR(x) \
PREPROCESSOR_OR4( \
PREPROCESSOR_CHAR_IS_LOWERCASE(x), \
PREPROCESSOR_CHAR_IS_UPPERCASE(x), \
PREPROCESSOR_CHAR_IS_DIGIT(x), \
PREPROCESSOR_CHAR_IS_UNDERSCORE(x))
/*********************************************************************************************************************
* CHAR EQUALUATION MACRO
*
* PREPROCESSOR_CHAR_EQ(,) // expands to 0
* PREPROCESSOR_CHAR_EQ( , ) // expands to 0
* PREPROCESSOR_CHAR_EQ(aaa,aaa) // expands to 0
* PREPROCESSOR_CHAR_EQ(a,a) // expands to 1
* PREPROCESSOR_CHAR_EQ(A,A) // expands to 1
* PREPROCESSOR_CHAR_EQ(A,a) // expands to 0
* PREPROCESSOR_CHAR_EQ(1,1) // expands to 1
* PREPROCESSOR_CHAR_EQ(1,2) // expands to 0
*/
#define PREPROCESSOR_CHAR_EQ(x, y) \
PREPROCESSOR_IF_ELSE(PREPROCESSOR_CHAR_IS_UNDERSCORE(x)) ( \
PREPROCESSOR_CHAR_IS_UNDERSCORE(y), \
PREPROCESSOR_OR3( \
PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_LOWER_DETECTOR_##x##_##y), \
PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_UPPER_DETECTOR_##x##_##y), \
PREPROCESSOR_IS_TUPLE_FAST(PREPROCESSOR_CHAR_DIGIT_DETECTOR_##x##_##y)))
/*********************************************************************************************************************
* CONVERT TO CHAR
*
* PREPROCESSOR_CHAR_TO_LIT_CONV(123) // expands to '123'
* PREPROCESSOR_CHAR_TO_LIT_CONV(a) // expands to 'a'
* PREPROCESSOR_CHAR_TO_LIT_CONV(1) // expands to '1'
* ...
* PREPROCESSOR_CHAR_TO_LIT_CONV() // expands to nothing
*
*/
#define PREPROCESSOR_CHAR_TO_LIT_CONV(x) \
PREPROCESSOR_IF(PREPROCESSOR_IS_CHAR(x)) ( \
PREPROCESSOR_CHAR_TO_LIT_CONV_IMPL(x) \
)
#define PREPROCESSOR_CHAR_TO_LIT_CONV_IMPL(x) PREPROCESSOR_CONCAT(PREPROCESSOR_CHAR_LIT_CONVERSATION_, x)
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_a 'a'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_b 'b'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_c 'c'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_d 'd'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_e 'e'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_f 'f'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_g 'g'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_h 'h'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_i 'i'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_j 'j'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_k 'k'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_l 'l'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_m 'm'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_n 'n'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_o 'o'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_p 'p'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_q 'q'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_r 'r'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_s 's'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_t 't'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_u 'u'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_v 'v'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_w 'w'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_x 'x'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_y 'y'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_z 'z'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_A 'A'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_B 'B'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_C 'C'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_D 'D'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_E 'E'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_F 'F'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_G 'G'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_H 'H'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_I 'I'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_J 'J'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_K 'K'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_L 'L'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_M 'M'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_N 'N'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_O 'O'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_P 'P'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_Q 'Q'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_R 'R'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_S 'S'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_T 'T'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_U 'U'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_V 'V'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_W 'W'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_X 'X'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_Y 'Y'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_Z 'Z'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_0 '0'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_1 '1'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_2 '2'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_3 '3'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_4 '4'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_5 '5'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_6 '6'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_7 '7'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_8 '8'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_9 '9'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_10 '10'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_11 '11'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_12 '12'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_13 '13'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_14 '14'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_15 '15'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_16 '16'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_17 '17'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_18 '18'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_19 '19'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_20 '20'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_21 '21'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_22 '22'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_23 '23'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_24 '24'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_25 '25'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_26 '26'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_27 '27'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_28 '28'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_29 '29'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_30 '30'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_31 '31'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_32 '32'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_33 '33'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_34 '34'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_35 '35'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_36 '36'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_37 '37'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_38 '38'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_39 '39'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_40 '40'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_41 '41'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_42 '42'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_43 '43'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_44 '44'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_45 '45'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_46 '46'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_47 '47'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_48 '48'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_49 '49'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_50 '50'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_51 '51'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_52 '52'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_53 '53'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_54 '54'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_55 '55'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_56 '56'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_57 '57'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_58 '58'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_59 '59'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_60 '60'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_61 '61'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_62 '62'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_63 '63'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_64 '64'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_65 '65'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_66 '66'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_67 '67'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_68 '68'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_69 '69'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_70 '70'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_71 '71'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_72 '72'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_73 '73'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_74 '74'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_75 '75'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_76 '76'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_77 '77'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_78 '78'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_79 '79'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_80 '80'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_81 '81'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_82 '82'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_83 '83'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_84 '84'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_85 '85'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_86 '86'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_87 '87'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_88 '88'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_89 '89'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_90 '90'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_91 '91'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_92 '92'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_93 '93'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_94 '94'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_95 '95'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_96 '96'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_97 '97'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_98 '98'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_99 '99'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_100 '100'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_101 '101'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_102 '102'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_103 '103'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_104 '104'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_105 '105'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_106 '106'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_107 '107'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_108 '108'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_109 '109'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_110 '110'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_111 '111'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_112 '112'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_113 '113'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_114 '114'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_115 '115'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_116 '116'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_117 '117'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_118 '118'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_119 '119'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_120 '120'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_121 '121'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_122 '122'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_123 '123'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_124 '124'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_125 '125'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_126 '126'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION_127 '127'
#define PREPROCESSOR_CHAR_LIT_CONVERSATION__ '_'
/*****************************************************************************************************
* Expands to all comma-separated lowercase letters.
*
* This macro consumes all arguments.
*
* #define F_IMPL(x) [x]
* PREPROCESSOR_FOR_EACH(F_IMPL, PREPROCESSOR_COMMA, PREPROCESSOR_LOWERCASE_CHARS())
*
* // EXPANDS TO:
* [a] , [b] , [c] , [d] , [e] , [f] , [g] , [h] , [i] , [j] , [k] , [l] , [m] , [n] , [o] , [p] , [q] , [r] , [s] , [t] , [u] , [v] , [w] , [x] , [y] , [z]
*
*/
#define PREPROCESSOR_LOWERCASE_CHARS(...) \
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
/*****************************************************************************************************
* The same as #PREPROCESSOR_LOWERCASE_CHARS but for uppercase characters.
*/
#define PREPROCESSOR_UPPERCASE_CHARS(...) \
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
/*****************************************************************************************************
* The same as #PREPROCESSOR_LOWERCASE_CHARS but for digits.
*/
#define PREPROCESSOR_CHAR_DIGITS(...) \
0, 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, 59, 60, 61, 62, 63, 64, 65, 66, 67, \
68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127
#endif /* __PREPROCESSOR_CHAR_EQ_H__ */