1- /*
2- * Compile with `gcc -E example.c` to see the preprocessor output.
1+ /* Compile with `gcc -E example.c` to see the preprocessor output.
32 */
43#include "map.h"
54
@@ -26,10 +25,23 @@ MAP_UD(PRINT_STREAM, stderr, 1, 2, 3, 4, 5)
2625/* Pass user-defined data to each list invocation */
2726#define INVOKE (x , fun ) fun(x)
2827int arr [] = { MAP_LIST_UD (INVOKE , map , 1 , 2 , 3 , 4 , 5 ) };
29-
28+ MAP_INC (1 ,2 ,3 ,4 )
29+ MAP_INC (MAP_INC (1 ,2 ,3 ,4 ))
3030/* Pass user-defined data and an index to each invocation */
3131#define PRINT_STREAM_I (x , stream , index ) fprintf (stream, "%d: %d\n", index, x);
32- MAP_UD_I (PRINT_STREAM_I , stderr , 1 , 2 , 3 , 4 , 5 )
32+ MAP_UD_I (PRINT_STREAM_I , stderr ,
33+ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ,
34+ 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 ,
35+ 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 ,
36+ 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 ,
37+ 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 ,
38+ 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 ,
39+ 61 , 62 , 63 , 64 , 65 , 66 , 67 , 68 , 69 , 70 ,
40+ 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 ,
41+ 81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 , 90 ,
42+ 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 ,
43+ 101 , 102 , 103 , 104 , 105 , 106 , 107 , 108 , 109
44+ )
3345
3446/* Pass user-defined data and an index to each list invocation */
3547#define INVOKE_I (x , fun , index ) fun(index, x)
0 commit comments