convert code to a version that is agreable to gcc (and, apparently, C++ standard)
in C++ proper, apparently we can't forward-declare enums, and gcc enforces that
use std::min(), std::max() instead of min/max macros and dis-ambiguate some invocations
in retrospect, this is unnecessary knob
more gcc compilation fixes
fix up ScopedComQIPtr