Merge anthm's MacroIf patch (bug #2912)