00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_liboctave_macros_h)
00024 #define octave_liboctave_macros_h 1
00025
00026
00027
00028 #define OCT_ITERATE_PARAM_MACRO0(MACRO, PARAM)
00029 #define OCT_ITERATE_PARAM_MACRO1(MACRO, PARAM) \
00030 MACRO(0, PARAM)
00031 #define OCT_ITERATE_PARAM_MACRO2(MACRO, PARAM) \
00032 MACRO(0, PARAM) MACRO(1, PARAM)
00033 #define OCT_ITERATE_PARAM_MACRO3(MACRO, PARAM) \
00034 MACRO(0, PARAM) MACRO(1, PARAM) MACRO(2, PARAM)
00035 #define OCT_ITERATE_PARAM_MACRO4(MACRO, PARAM) \
00036 MACRO(0, PARAM) MACRO(1, PARAM) MACRO(2, PARAM) MACRO(3, PARAM)
00037 #define OCT_ITERATE_PARAM_MACRO5(MACRO, PARAM) \
00038 MACRO(0, PARAM) MACRO(1, PARAM) MACRO(2, PARAM) MACRO(3, PARAM) MACRO(4, PARAM)
00039 #define OCT_ITERATE_PARAM_MACRO6(MACRO, PARAM) \
00040 OCT_ITERATE_PARAM_MACRO5(MACRO, PARAM) MACRO(5, PARAM)
00041 #define OCT_ITERATE_PARAM_MACRO7(MACRO, PARAM) \
00042 OCT_ITERATE_PARAM_MACRO5(MACRO, PARAM) MACRO(5, PARAM) MACRO(6, PARAM)
00043 #define OCT_ITERATE_PARAM_MACRO8(MACRO, PARAM) \
00044 OCT_ITERATE_PARAM_MACRO5(MACRO, PARAM) MACRO(5, PARAM) MACRO(6, PARAM) MACRO(7, PARAM)
00045 #define OCT_ITERATE_PARAM_MACRO9(MACRO, PARAM) \
00046 OCT_ITERATE_PARAM_MACRO8(MACRO, PARAM) MACRO(8, PARAM)
00047 #define OCT_ITERATE_PARAM_MACRO10(MACRO, PARAM) \
00048 OCT_ITERATE_PARAM_MACRO8(MACRO, PARAM) MACRO(8, PARAM) MACRO(9, PARAM)
00049
00050
00051 #define OCT_ITERATE_PARAM_MACRO(MACRO, PARAM, NUM) OCT_ITERATE_PARAM_MACRO##NUM(MACRO,PARAM)
00052
00053 #define OCT_IF_PARAM0(MACRO, PARAM)
00054 #define OCT_IF_PARAM1(MACRO, PARAM) MACRO(PARAM)
00055 #define OCT_IF_PARAM2(MACRO, PARAM) MACRO(PARAM)
00056 #define OCT_IF_PARAM3(MACRO, PARAM) MACRO(PARAM)
00057 #define OCT_IF_PARAM4(MACRO, PARAM) MACRO(PARAM)
00058 #define OCT_IF_PARAM5(MACRO, PARAM) MACRO(PARAM)
00059 #define OCT_IF_PARAM6(MACRO, PARAM) MACRO(PARAM)
00060 #define OCT_IF_PARAM7(MACRO, PARAM) MACRO(PARAM)
00061 #define OCT_IF_PARAM8(MACRO, PARAM) MACRO(PARAM)
00062 #define OCT_IF_PARAM9(MACRO, PARAM) MACRO(PARAM)
00063
00064
00065 #define OCT_IF_PARAM(NUM, MACRO, PARAM) OCT_IF_PARAM##NUM(MACRO, PARAM)
00066
00067
00068 #define OCT_CONCAT2(ARG1, ARG2) ARG1 ## ARG2
00069 #define OCT_CONCAT2_REVERSE(ARG1, ARG2) ARG2 ## ARG1
00070
00071 #define OCT_IF_HELPER(X) X
00072
00073
00074 #define OCT_IF(NUM, X) OCT_IF_PARAM(NUM, OCT_IF_HELPER, X)
00075
00076 #define OCT_ITERATE_MACRO_HELPER(NUM, MACRO) MACRO(NUM)
00077
00078
00079 #define OCT_ITERATE_MACRO(MACRO, NUM) OCT_ITERATE_PARAM_MACRO(OCT_ITERATE_MACRO_HELPER, MACRO, NUM)
00080
00081 #define OCT_MAKE_LIST_HELPER1(ARG) ARG,
00082
00083
00084 #define OCT_MAKE_LIST_HELPER(NUM, MACRO) OCT_IF_PARAM(NUM,OCT_MAKE_LIST_HELPER1,) MACRO(NUM)
00085
00086 #define OCT_MAKE_LIST(MACRO, NUM) OCT_ITERATE_PARAM_MACRO(OCT_MAKE_LIST_HELPER, MACRO, NUM)
00087
00088 #define OCT_MAKE_DECL_LIST_HELPER(NUM, PREFIX) \
00089 OCT_IF_PARAM(NUM,OCT_MAKE_LIST_HELPER1,) OCT_CONCAT2(PREFIX, NUM)
00090
00091
00092 #define OCT_MAKE_DECL_LIST(TYPE, PREFIX, NUM) \
00093 OCT_ITERATE_PARAM_MACRO(OCT_MAKE_DECL_LIST_HELPER, TYPE PREFIX, NUM)
00094
00095 #endif