Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / synfig_0_61_07_rc3 / src / synfig / proto / proto.m4
1 dnl
2
3  define(`forloop',
4                 `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
5  define(`_forloop',
6                 `$4`'ifelse($1, `$3', ,
7                            `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
8
9 define(`_PRINT_ARGS',`dnl
10 ifelse($#,1,,`$2 v$1`'ifelse($#,2,,`, _PRINT_ARGS(incr($1), shift(shift($@)))')')dnl
11 ')dnl
12
13 define(`_PRINT_ARGS2',`dnl
14 ifelse($#,1,,`v$1`'ifelse($#,2,,`, _PRINT_ARGS2(incr($1), shift(shift($@)))')')dnl
15 ')dnl
16
17 dnl PX_DEFINE_FUNC(func_name, ret_type, args...)
18 define(`PX_DEFINE_FUNC',`
19         sigc::slot< $2`'ifelse($#,2,,`, shift(shift($@))') > _slot_$1;
20         $2 $1(ifelse($#,2,,`_PRINT_ARGS(1,shift(shift($@)))')) {
21                 return _slot_$1(ifelse($#,2,,`_PRINT_ARGS2(1,shift(shift($@)))'));
22         }
23 ')dnl
24
25 dnl PX_DEFINE_FUNC_CONST(func_name, ret_type, args...)
26 define(`PX_DEFINE_FUNC_CONST',`
27         sigc::slot< $2`'ifelse($#,2,,`, shift(shift($@))') > _slot_$1_const;
28         $2 $1(ifelse($#,2,,`_PRINT_ARGS(1,shift(shift($@)))'))const {
29                 return _slot_$1_const(ifelse($#,2,,`_PRINT_ARGS2(1,shift(shift($@)))'));
30         }
31 ')dnl
32
33 define(`PX_DEFINE_DATA', `dnl
34 PX_DEFINE_FUNC_CONST(get_$1, $2)
35 PX_DEFINE_FUNC(set_$1, void, $2)
36 ')dnl
37