3 #ifdef QCC_SUPPORT_ACCUMULATE
4 #define ACCUMULATE_FUNCTION(func, otherfunc) \
5 [[accumulate]] void func() \
9 #define CALL_ACCUMULATED_FUNCTION(func) \
12 #ifdef HAVE_YO_DAWG_CPP
14 // I HERD YO LIEK MACROS
15 // SO I PUT A MACRO DEFINITION IN YO MACRO DEFINITION
16 // SO YO CAN EXPAND MACROS WHILE YO EXPAND MACROS
17 #define ACCUMULATE_FUNCTION(func, otherfunc) \
19 void __merge__##otherfunc() \
21 func(); otherfunc(); \
24 #define func __merge__##otherfunc \
26 #define func otherfunc \
28 #define CALL_ACCUMULATED_FUNCTION(func) \
31 #define ACCUMULATE_FUNCTION(func, otherfunc) \
32 .float _ACCUMULATE_##func##__##otherfunc;
33 void ACCUMULATE_call(string func)
36 float n = numentityfields();
37 string funcprefix = strcat("_ACCUMULATE_", func, "__");
38 float funcprefixlen = strlen(funcprefix);
39 for (i = 0; i < n; ++i)
41 string name = entityfieldname(i);
42 if (substring(name, 0, funcprefixlen) == funcprefix) callfunction(substring(name, funcprefixlen, -1));
45 #define CALL_ACCUMULATED_FUNCTION(func) \
46 ACCUMULATE_call( #func)
50 // used for simplifying ACCUMULATE_FUNCTIONs
51 #define SET_FIRST_OR_LAST(input, first, count) \
52 if (!input) { input = (first + count); }
53 #define SET_FIELD_COUNT(field, first, count) \
54 if (!field) { field = (first + count); ++count; }
55 #define CHECK_MAX_COUNT(name, max, count, type) \
56 if (count > max) { error(strcat("Maximum ", type, " hit: ", #name, ": ", ftos(count), ".\n")); }