void effectinfo_dump(int fh, bool alsoprint)
{
+ #define WRITE(s) do { \
+ fputs(fh, s); \
+ if (alsoprint) LOG_INFO(s); \
+ } while (0)
+ WRITE("// ********************************************** //\n");
+ WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n");
+ WRITE("// ** ** //\n");
+ WRITE("// ** This file is automatically generated by ** //\n");
+ WRITE("// ** code with the command 'dumpeffectinfo'. ** //\n");
+ WRITE("// ** ** //\n");
+ WRITE("// ** If you modify an effect, please ** //\n");
+ WRITE("// ** regenerate this file with that command. ** //\n");
+ WRITE("// ** ** //\n");
+ WRITE("// ********************************************** //\n");
+ WRITE("\n");
+
for (EffectInfo it = NULL; (it = findfloat(it, instanceOfEffectInfo, true)); ) {
if (it.classname == "vtbl") continue;
string s = it.dump(it);
- fputs(fh, s);
- if (alsoprint) print(s);
+ WRITE(s);
}
+ #undef WRITE
}