not a big fan of macros but couldn't we do something like and deduplicate wmin and wmax?
#define DEFINE_WINDOWFUN(fname, init_val, op)
DEFINE_WINDOWFUN(wmax, R_NegInf, >=)
DEFINE_WINDOWFUN(wmin, R_PosInf, <=)
Originally posted by @ben-schwen in #7299 (comment)