├── test.c ├── README.org ├── LICENSE └── cpplib.h /test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "cpplib.h" 3 | 4 | #define CASE(x) case x: 5 | #define ANY(...) CPP_FOREACH(CASE,__VA_ARGS__) 6 | 7 | #define CLOSEBRACE(_,_2) } 8 | #define CLOSE(n) CPP_REPEAT(n,CLOSEBRACE) 9 | 10 | #define LIST_FOO_(X,XLAST) \ 11 | X(Bar) \ 12 | X(Baz) \ 13 | X(Quux) \ 14 | X(Qaz) \ 15 | XLAST(Lower) 16 | #define LIST_FOO(X) LIST_FOO_(X,X) 17 | 18 | typedef enum { LIST_FOO_(CPP_ENUMERATE,CPP_ID) } foo; 19 | 20 | foo foo_of_string(const char *s) 21 | { 22 | #define COMPARE_Lower(x) x 23 | #define FOO_CMP(name) CPP_IF(CPP_EQUAL(name,Lower))(if(strcmp(s,"lower")==0)return Lower;, if(strcmp(s,#name)==0)return name;) 24 | LIST_FOO(FOO_CMP) 25 | #undef FOO_CMP 26 | #undef COMPARE_Lower 27 | return (foo)-1; 28 | } 29 | 30 | const char *string_of_foo(foo x) 31 | { 32 | #define COMPARE_Quux(x) x 33 | #define COMPARE_Qaz(x) x 34 | #define FOO_CMP(name) CPP_IF(CPP_OR(CPP_EQUAL(name,Quux))(CPP_EQUAL(name,Qaz))) \ 35 | ( \ 36 | if(x==name)return "Q";, \ 37 | if(x==name)return #name; \ 38 | ) 39 | LIST_FOO(FOO_CMP) 40 | #undef FOO_CMP 41 | #undef COMPARE_Qaz 42 | #undef COMPARE_Quux 43 | } 44 | 45 | int main(int argc, const char **argv) 46 | { 47 | if (argc != 2) return 1; 48 | else { 49 | foo x = foo_of_string(argv[1]); 50 | switch (x) 51 | { 52 | case (foo)-1: puts("invalid"); break; 53 | ANY(Bar,Baz) puts("starts with b"); break; 54 | default: puts(string_of_foo(x)); 55 | 56 | CLOSE(3) -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | * Overview 2 | cpplib brings standard programming language features—such as conditionals and 3 | loops—to the C preprocessor. It also includes macros to simulate function 4 | overloading and variadic templates. 5 | 6 | cpplib is a single header file written in pure CPP with no C code to bloat 7 | executable size. 8 | 9 | * Why 10 | C preprocessor is much nicer than C itself. It is a purely functional language based on pattern matching—this means CPP code is easier to reason about and can be automatically parallelized. CPP is also very efficient, compiling to C with no dependencies. 11 | 12 | Unfortunately, while CPP is rivaled only by Haskell in clarity and purity, it 13 | is missing some convenient features by default, such as the “if” expression 14 | and recursion. cpplib fills in the gaps, so you can write more code in functional CPP instead of imperative C. Take advantage of pattern matching and functional programming with CPP! 15 | 16 | * Documentation 17 | Documentation only distracts you from code and risks becoming outdated. Thanks to common functional programming techniques including higher-order macros, cpplib is very easy to understand. Consult cpplib.h in place of documentation. 18 | 19 | * Examples 20 | ** Syntactic sugar for repeated case statements 21 | #+BEGIN_SRC c 22 | #define CASE(x) case x: 23 | #define ANY(...) CPP_FOREACH(CASE,__VA_ARGS__) 24 | typedef enum { Cn, Lu, Ll, Lt, Lm, Lo, Zs, Zl, Zp } unicode_category; 25 | switch (get_category(codepoint)) 26 | { 27 | ANY(Zs, Zl, Zp) process_whitespace(codepoint); 28 | default: process_other(codepoint); 29 | } 30 | #+END_SRC 31 | ** Function overloading 32 | #+BEGIN_SRC c 33 | #define range(...) CPP_OVERLOAD(range,__VA_ARGS__) 34 | #define range2(f,n) range3(f,0,n) 35 | void range3(void (*yield)(int), int from, int to) 36 | { 37 | for (int i = from; i < to; ++i) yield(i); 38 | } 39 | #+END_SRC 40 | ** Enum values to column names 41 | #+BEGIN_SRC c 42 | #define LIST_COLUMNS_(X,X_) X(FieldID) X(State) X(Name) X_(Code) 43 | #define LIST_COLUMNS(X) LIST_COLUMNS_(X,X) 44 | typedef enum { LIST_COLUMNS_(CPP_ENUMERATE, CPP_ID) } column_t; 45 | const char *column_name_of_enum(column_t c) 46 | { 47 | #define COMPARE_FieldID(x) x 48 | #define TOSTR(name) \ 49 | CPP_IF(CPP_EQUAL(name,FieldID)) \ 50 | ( \ 51 | case FieldID: return "field_id";, \ 52 | case name: return #name; \ 53 | ) 54 | 55 | switch (c) 56 | { 57 | LIST_COLUMNS(TOSTR) 58 | } 59 | 60 | #undef TOSTR 61 | #undef COMPARE_FieldID 62 | } 63 | #+END_SRC 64 | 65 | * License 66 | cpplib is licensed under the Creative Commons CC0 license. Where possible I renounce copyright to cpplib. See LICENSE for details. 67 | 68 | cpplib.h includes a quote from Dante Alighieri's epic poem ‘Inferno’. Check that your country allows you to freely distribute 700 year old texts. Otherwise, you're stealing from Mr. Alighieri. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /cpplib.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 𝕷𝖆𝖘𝖈𝖎𝖆𝖙𝖊 𝖔𝖌𝖓𝖊 𝖘𝖕𝖊𝖗𝖆𝖓𝖟𝖆, 𝖛𝖔𝖎 𝖈𝖍'𝖎𝖓𝖙𝖗𝖆𝖙𝖊 3 | * 4 | * 5 | * You have been WARNED 6 | * 7 | * Many of the preprocessor metaprogramming techniques used here are from this 8 | * excellent article: 9 | * https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms 10 | * 11 | * In general, it's best not to try to decipher this. 12 | */ 13 | 14 | #define CPP_PASTE(a,...) a ## __VA_ARGS__ 15 | #define CPP_CAT(a,...) CPP_PASTE(a,__VA_ARGS__) 16 | 17 | #define CPP_ENUMERATE(x) x, 18 | #define CPP_ID(x) x 19 | 20 | #define CPP_EMPTY() 21 | #define CPP_BLOCK_EXPANSION(x) x CPP_EMPTY() 22 | #define CPP_DEFER(...) __VA_ARGS__ CPP_BLOCK_EXPANSION(CPP_EMPTY)() 23 | #define CPP_EXPAND(...) __VA_ARGS__ 24 | #define CPP_EAT(...) 25 | 26 | #define CPP_EVAL(...) CPP_EVAL1(CPP_EVAL1(CPP_EVAL1(__VA_ARGS__))) 27 | #define CPP_EVAL1(...) CPP_EVAL2(CPP_EVAL2(CPP_EVAL2(__VA_ARGS__))) 28 | #define CPP_EVAL2(...) CPP_EVAL3(CPP_EVAL3(CPP_EVAL3(__VA_ARGS__))) 29 | #define CPP_EVAL3(...) CPP_EVAL4(CPP_EVAL4(CPP_EVAL4(__VA_ARGS__))) 30 | #define CPP_EVAL4(...) CPP_EVAL5(CPP_EVAL5(CPP_EVAL5(__VA_ARGS__))) 31 | #define CPP_EVAL5(...) CPP_EXPAND(CPP_EXPAND(CPP_EXPAND(__VA_ARGS__))) 32 | 33 | #define CPP_IF_(b) CPP_PASTE(CPP_IF__,b) 34 | #define CPP_IF__0(t,...) __VA_ARGS__ 35 | #define CPP_IF__1(t,...) t 36 | 37 | #define CPP_NEGATE(x) CPP_PASTE(CPP_NEGATE_,x) 38 | #define CPP_NEGATE_0 1 39 | #define CPP_NEGATE_1 0 40 | 41 | // Lord knows how this works or how I once understood it. 42 | #define CPP_CHECK_N(x,n,...) n 43 | #define CPP_CHECK(...) CPP_CHECK_N(__VA_ARGS__,0,) 44 | #define CPP_PROBE(x) x, 1, 45 | #define CPP_IS_PAREN_PROBE(...) CPP_PROBE(~) 46 | #define CPP_IS_PAREN(x) CPP_CHECK(CPP_IS_PAREN_PROBE x) 47 | 48 | #define CPP_NOT(x) CPP_CHECK(CPP_PASTE(CPP_NOT_,x)) 49 | #define CPP_NOT_0 CPP_PROBE(~) 50 | #define CPP_AND(x) CPP_PASTE(CPP_AND_,x) 51 | #define CPP_AND_0(y) 0 52 | #define CPP_AND_1(y) y 53 | #define CPP_OR(x) CPP_PASTE(CPP_OR_,x) 54 | #define CPP_OR_0(y) y 55 | #define CPP_OR_1(y) 1 56 | 57 | #define CPP_IS_TRUTHY(x) CPP_NEGATE(CPP_NOT(x)) 58 | #define CPP_IF(pred) CPP_IF_(CPP_IS_TRUTHY(pred)) 59 | 60 | #define CPP_WHEN(pred) CPP_IF(pred)(CPP_EXPAND,CPP_EAT) 61 | #define CPP_UNLESS(pred) CPP_IF(pred)(CPP_EAT,CPP_EXPAND) 62 | 63 | #define CPP_NEQ_COMPARABLE(x,y) CPP_IS_PAREN(COMPARE_##x(COMPARE_##y)(())) 64 | #define CPP_IS_COMPARABLE(x) CPP_IS_PAREN(CPP_CAT(COMPARE_,x)(())) 65 | #define CPP_NOT_EQUAL(x,y) \ 66 | CPP_IF_(CPP_AND(CPP_IS_COMPARABLE(x))(CPP_IS_COMPARABLE(y))) \ 67 | ( \ 68 | CPP_NEQ_COMPARABLE, \ 69 | 1 CPP_EAT \ 70 | )(x,y) 71 | #define CPP_EQUAL(x,y) CPP_NEGATE(CPP_NOT_EQUAL(x,y)) 72 | 73 | #define CPP_REPEAT_(n,f,...) \ 74 | CPP_WHEN(n) \ 75 | ( \ 76 | CPP_DEFER(CPP_REPEAT__) () (CPP_DEC(n), f, __VA_ARGS__) \ 77 | CPP_DEFER(f) (CPP_DEC(n), __VA_ARGS__) \ 78 | ) 79 | 80 | #define CPP_REPEAT__() CPP_REPEAT_ 81 | 82 | #define CPP_REPEAT(...) CPP_EVAL(CPP_REPEAT_(__VA_ARGS__)) 83 | 84 | // Could use GCC's ,##__VA_ARGS__ extension to support 0 arguments. 85 | #define CPP_N_VA_ARGS_(_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,N,...) N 86 | #define CPP_N_VA_ARGS(...) CPP_N_VA_ARGS_(__VA_ARGS__,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0) 87 | 88 | #define CPP_OVERLOAD(fn, ...) CPP_CAT(fn, CPP_N_VA_ARGS(__VA_ARGS__))(__VA_ARGS__) 89 | 90 | #define CPP_FOREACH_0(f,x) 91 | #define CPP_FOREACH_1(f,x) f(x) 92 | #define CPP_FOREACH_2(f,x,...) f(x)CPP_FOREACH_1(f,__VA_ARGS__) 93 | #define CPP_FOREACH_3(f,x,...) f(x)CPP_FOREACH_2(f,__VA_ARGS__) 94 | #define CPP_FOREACH_4(f,x,...) f(x)CPP_FOREACH_3(f,__VA_ARGS__) 95 | #define CPP_FOREACH_5(f,x,...) f(x)CPP_FOREACH_4(f,__VA_ARGS__) 96 | #define CPP_FOREACH_6(f,x,...) f(x)CPP_FOREACH_5(f,__VA_ARGS__) 97 | #define CPP_FOREACH_7(f,x,...) f(x)CPP_FOREACH_6(f,__VA_ARGS__) 98 | #define CPP_FOREACH_8(f,x,...) f(x)CPP_FOREACH_7(f,__VA_ARGS__) 99 | #define CPP_FOREACH_9(f,x,...) f(x)CPP_FOREACH_8(f,__VA_ARGS__) 100 | #define CPP_FOREACH_10(f,x,...) f(x)CPP_FOREACH_9(f,__VA_ARGS__) 101 | #define CPP_FOREACH_11(f,x,...) f(x)CPP_FOREACH_10(f,__VA_ARGS__) 102 | #define CPP_FOREACH_12(f,x,...) f(x)CPP_FOREACH_11(f,__VA_ARGS__) 103 | #define CPP_FOREACH_13(f,x,...) f(x)CPP_FOREACH_12(f,__VA_ARGS__) 104 | #define CPP_FOREACH_14(f,x,...) f(x)CPP_FOREACH_13(f,__VA_ARGS__) 105 | #define CPP_FOREACH_15(f,x,...) f(x)CPP_FOREACH_14(f,__VA_ARGS__) 106 | #define CPP_FOREACH_16(f,x,...) f(x)CPP_FOREACH_15(f,__VA_ARGS__) 107 | #define CPP_FOREACH_17(f,x,...) f(x)CPP_FOREACH_16(f,__VA_ARGS__) 108 | #define CPP_FOREACH_18(f,x,...) f(x)CPP_FOREACH_17(f,__VA_ARGS__) 109 | #define CPP_FOREACH_19(f,x,...) f(x)CPP_FOREACH_18(f,__VA_ARGS__) 110 | #define CPP_FOREACH_20(f,x,...) f(x)CPP_FOREACH_19(f,__VA_ARGS__) 111 | #define CPP_FOREACH_21(f,x,...) f(x)CPP_FOREACH_20(f,__VA_ARGS__) 112 | #define CPP_FOREACH_22(f,x,...) f(x)CPP_FOREACH_21(f,__VA_ARGS__) 113 | #define CPP_FOREACH_23(f,x,...) f(x)CPP_FOREACH_22(f,__VA_ARGS__) 114 | #define CPP_FOREACH_24(f,x,...) f(x)CPP_FOREACH_23(f,__VA_ARGS__) 115 | #define CPP_FOREACH_25(f,x,...) f(x)CPP_FOREACH_24(f,__VA_ARGS__) 116 | #define CPP_FOREACH_26(f,x,...) f(x)CPP_FOREACH_25(f,__VA_ARGS__) 117 | #define CPP_FOREACH_27(f,x,...) f(x)CPP_FOREACH_26(f,__VA_ARGS__) 118 | #define CPP_FOREACH_28(f,x,...) f(x)CPP_FOREACH_27(f,__VA_ARGS__) 119 | #define CPP_FOREACH_29(f,x,...) f(x)CPP_FOREACH_28(f,__VA_ARGS__) 120 | #define CPP_FOREACH_30(f,x,...) f(x)CPP_FOREACH_29(f,__VA_ARGS__) 121 | #define CPP_FOREACH_31(f,x,...) f(x)CPP_FOREACH_30(f,__VA_ARGS__) 122 | #define CPP_FOREACH_32(f,x,...) f(x)CPP_FOREACH_31(f,__VA_ARGS__) 123 | 124 | #define CPP_FOREACH(f,...) CPP_OVERLOAD(CPP_FOREACH_, f, __VA_ARGS__) 125 | 126 | 127 | 128 | // No nicer way to write this. More cases can be added on an as-needed basis. 129 | // Saturate instead of wraparound. 130 | #define CPP_INC(x) CPP_PASTE(CPP_INC_,x) 131 | #define CPP_INC_0 1 132 | #define CPP_INC_1 2 133 | #define CPP_INC_2 3 134 | #define CPP_INC_3 4 135 | #define CPP_INC_4 5 136 | #define CPP_INC_5 6 137 | #define CPP_INC_6 7 138 | #define CPP_INC_7 8 139 | #define CPP_INC_8 9 140 | #define CPP_INC_9 10 141 | #define CPP_INC_10 11 142 | #define CPP_INC_11 12 143 | #define CPP_INC_12 13 144 | #define CPP_INC_13 14 145 | #define CPP_INC_14 15 146 | #define CPP_INC_15 16 147 | #define CPP_INC_16 17 148 | #define CPP_INC_17 18 149 | #define CPP_INC_18 19 150 | #define CPP_INC_19 20 151 | #define CPP_INC_20 21 152 | #define CPP_INC_21 22 153 | #define CPP_INC_22 23 154 | #define CPP_INC_23 24 155 | #define CPP_INC_24 25 156 | #define CPP_INC_25 26 157 | #define CPP_INC_26 27 158 | #define CPP_INC_27 28 159 | #define CPP_INC_28 29 160 | #define CPP_INC_29 30 161 | #define CPP_INC_30 31 162 | #define CPP_INC_31 32 163 | #define CPP_INC_32 33 164 | #define CPP_INC_33 34 165 | #define CPP_INC_34 35 166 | #define CPP_INC_35 36 167 | #define CPP_INC_36 37 168 | #define CPP_INC_37 38 169 | #define CPP_INC_38 39 170 | #define CPP_INC_39 40 171 | #define CPP_INC_40 41 172 | #define CPP_INC_41 42 173 | #define CPP_INC_42 43 174 | #define CPP_INC_43 44 175 | #define CPP_INC_44 45 176 | #define CPP_INC_45 46 177 | #define CPP_INC_46 47 178 | #define CPP_INC_47 48 179 | #define CPP_INC_48 49 180 | #define CPP_INC_49 50 181 | #define CPP_INC_50 51 182 | #define CPP_INC_51 52 183 | #define CPP_INC_52 53 184 | #define CPP_INC_53 54 185 | #define CPP_INC_54 55 186 | #define CPP_INC_55 56 187 | #define CPP_INC_56 57 188 | #define CPP_INC_57 58 189 | #define CPP_INC_58 59 190 | #define CPP_INC_59 60 191 | #define CPP_INC_60 61 192 | #define CPP_INC_61 62 193 | #define CPP_INC_62 63 194 | #define CPP_INC_63 63 195 | 196 | #define CPP_DEC(x) CPP_PASTE(CPP_DEC_,x) 197 | #define CPP_DEC_0 0 198 | #define CPP_DEC_1 0 199 | #define CPP_DEC_2 1 200 | #define CPP_DEC_3 2 201 | #define CPP_DEC_4 3 202 | #define CPP_DEC_5 4 203 | #define CPP_DEC_6 5 204 | #define CPP_DEC_7 6 205 | #define CPP_DEC_8 7 206 | #define CPP_DEC_9 8 207 | #define CPP_DEC_10 9 208 | #define CPP_DEC_11 10 209 | #define CPP_DEC_12 11 210 | #define CPP_DEC_13 12 211 | #define CPP_DEC_14 13 212 | #define CPP_DEC_15 14 213 | #define CPP_DEC_16 15 214 | #define CPP_DEC_17 16 215 | #define CPP_DEC_18 17 216 | #define CPP_DEC_19 18 217 | #define CPP_DEC_20 19 218 | #define CPP_DEC_21 20 219 | #define CPP_DEC_22 21 220 | #define CPP_DEC_23 22 221 | #define CPP_DEC_24 23 222 | #define CPP_DEC_25 24 223 | #define CPP_DEC_26 25 224 | #define CPP_DEC_27 26 225 | #define CPP_DEC_28 27 226 | #define CPP_DEC_29 28 227 | #define CPP_DEC_30 29 228 | #define CPP_DEC_31 30 229 | #define CPP_DEC_32 31 230 | #define CPP_DEC_33 32 231 | #define CPP_DEC_34 33 232 | #define CPP_DEC_35 34 233 | #define CPP_DEC_36 35 234 | #define CPP_DEC_37 36 235 | #define CPP_DEC_38 37 236 | #define CPP_DEC_39 38 237 | #define CPP_DEC_40 39 238 | #define CPP_DEC_41 40 239 | #define CPP_DEC_42 41 240 | #define CPP_DEC_43 42 241 | #define CPP_DEC_44 43 242 | #define CPP_DEC_45 44 243 | #define CPP_DEC_46 45 244 | #define CPP_DEC_47 46 245 | #define CPP_DEC_48 47 246 | #define CPP_DEC_49 48 247 | #define CPP_DEC_50 49 248 | #define CPP_DEC_51 50 249 | #define CPP_DEC_52 51 250 | #define CPP_DEC_53 52 251 | #define CPP_DEC_54 53 252 | #define CPP_DEC_55 54 253 | #define CPP_DEC_56 55 254 | #define CPP_DEC_57 56 255 | #define CPP_DEC_58 57 256 | #define CPP_DEC_59 58 257 | #define CPP_DEC_60 59 258 | #define CPP_DEC_61 60 259 | #define CPP_DEC_62 61 260 | #define CPP_DEC_63 62 261 | --------------------------------------------------------------------------------