MFC r309554 and r309631 which breaks down overly long monolithic
souce file and reduces duplication by auto-generating functions
that only differ in the value of the SCM_XXX constant used.
This also fixes unintentional breakage introduced in earlier
MFC in r338617 that happens to rely on some of those changes.
Reported by: asomers
Pointy-hat goes to: sobomax