4 #ifdef QCC_SUPPORT_ACCUMULATE
5 # define ACCUMULATE_FUNCTION(func, otherfunc) \
6 [[accumulate]] void func() { otherfunc(); }
7 # define CALL_ACCUMULATED_FUNCTION(func) \
10 #ifdef HAVE_YO_DAWG_CPP
11 // TODO make ascii art pic of xzibit
13 // I HERD YO LIEK MACROS
14 // SO I PUT A MACRO DEFINITION IN YO MACRO DEFINITION
15 // SO YO CAN EXPAND MACROS WHILE YO EXPAND MACROS
16 # define ACCUMULATE_FUNCTION(func,otherfunc) \
18 void __merge__##otherfunc() { func(); otherfunc(); } \
20 #define func __merge__##otherfunc \
22 #define func otherfunc \
24 # define CALL_ACCUMULATED_FUNCTION(func) \
27 # define ACCUMULATE_FUNCTION(func,otherfunc) \
28 .float _ACCUMULATE_##func##__##otherfunc;
29 void ACCUMULATE_call(string func)
32 float n = numentityfields();
33 string funcprefix = strcat("_ACCUMULATE_", func, "__");
34 float funcprefixlen = strlen(funcprefix);
35 for(i = 0; i < n; ++i)
37 string name = entityfieldname(i);
38 if(substring(name, 0, funcprefixlen) == funcprefix)
39 callfunction(substring(name, funcprefixlen, -1));
42 # define CALL_ACCUMULATED_FUNCTION(func) \
43 ACCUMULATE_call(#func)
47 // used for simplifying ACCUMULATE_FUNCTIONs
48 #define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
49 #define SET_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
50 #define CHECK_MAX_COUNT(name,max,count,type) if(count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }