Skip to content

Commit

Permalink
Update runtime to support more function/operation arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwvj committed Jun 30, 2017
1 parent f591a3c commit 9b654b0
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions c/vdmclib/src/main/VdmClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,35 @@ struct ClassType* newClassValue(int id, unsigned int* refs, freeVdmClassFunction
#define TVP_VARG_CAST_FE_5(WHAT, X, ...) TVP_VARG_CAST_FE_4(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_6(WHAT, X, ...) TVP_VARG_CAST_FE_5(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_7(WHAT, X, ...) TVP_VARG_CAST_FE_6(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_8(WHAT, X, ...) TVP_VARG_CAST_FE_7(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_9(WHAT, X, ...) TVP_VARG_CAST_FE_8(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_10(WHAT, X, ...) TVP_VARG_CAST_FE_9(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_11(WHAT, X, ...) TVP_VARG_CAST_FE_10(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_12(WHAT, X, ...) TVP_VARG_CAST_FE_11(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_13(WHAT, X, ...) TVP_VARG_CAST_FE_12(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_14(WHAT, X, ...) TVP_VARG_CAST_FE_13(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_15(WHAT, X, ...) TVP_VARG_CAST_FE_14(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_16(WHAT, X, ...) TVP_VARG_CAST_FE_15(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_17(WHAT, X, ...) TVP_VARG_CAST_FE_16(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_18(WHAT, X, ...) TVP_VARG_CAST_FE_17(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_19(WHAT, X, ...) TVP_VARG_CAST_FE_18(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_20(WHAT, X, ...) TVP_VARG_CAST_FE_19(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_21(WHAT, X, ...) TVP_VARG_CAST_FE_20(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_22(WHAT, X, ...) TVP_VARG_CAST_FE_21(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_23(WHAT, X, ...) TVP_VARG_CAST_FE_22(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_24(WHAT, X, ...) TVP_VARG_CAST_FE_23(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_25(WHAT, X, ...) TVP_VARG_CAST_FE_24(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_26(WHAT, X, ...) TVP_VARG_CAST_FE_25(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_27(WHAT, X, ...) TVP_VARG_CAST_FE_26(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_28(WHAT, X, ...) TVP_VARG_CAST_FE_27(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_29(WHAT, X, ...) TVP_VARG_CAST_FE_28(WHAT, __VA_ARGS__)WHAT(X)
#define TVP_VARG_CAST_FE_30(WHAT, X, ...) TVP_VARG_CAST_FE_29(WHAT, __VA_ARGS__)WHAT(X)

/* ... repeat as needed */

#define TVP_VARG_CAST_GET_MACRO(_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
#define TVP_VARG_CAST_GET_MACRO(_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,NAME,...) NAME
#define TVP_VARG_CAST_FOR_EACH(action,...) \
TVP_VARG_CAST_GET_MACRO(__VA_ARGS__,TVP_VARG_CAST_FE_7,TVP_VARG_CAST_FE_6,TVP_VARG_CAST_FE_5,TVP_VARG_CAST_FE_4,TVP_VARG_CAST_FE_3,TVP_VARG_CAST_FE_2,TVP_VARG_CAST_FE_1)(action,__VA_ARGS__)
TVP_VARG_CAST_GET_MACRO(__VA_ARGS__,TVP_VARG_CAST_FE_30,TVP_VARG_CAST_FE_29,TVP_VARG_CAST_FE_28,TVP_VARG_CAST_FE_27,TVP_VARG_CAST_FE_26,TVP_VARG_CAST_FE_25,TVP_VARG_CAST_FE_24,TVP_VARG_CAST_FE_23,TVP_VARG_CAST_FE_22,TVP_VARG_CAST_FE_21,TVP_VARG_CAST_FE_20,TVP_VARG_CAST_FE_19,TVP_VARG_CAST_FE_18,TVP_VARG_CAST_FE_17,TVP_VARG_CAST_FE_16,TVP_VARG_CAST_FE_15,TVP_VARG_CAST_FE_14,TVP_VARG_CAST_FE_13,TVP_VARG_CAST_FE_12,TVP_VARG_CAST_FE_11,TVP_VARG_CAST_FE_10,TVP_VARG_CAST_FE_9,TVP_VARG_CAST_FE_8,TVP_VARG_CAST_FE_7,TVP_VARG_CAST_FE_6,TVP_VARG_CAST_FE_5,TVP_VARG_CAST_FE_4,TVP_VARG_CAST_FE_3,TVP_VARG_CAST_FE_2,TVP_VARG_CAST_FE_1)(action,__VA_ARGS__)

/*
* Make a FOREACH macro for call cast base argument type
Expand Down

0 comments on commit 9b654b0

Please sign in to comment.