Works beautifully, thanks. (Sorry to cause confusion: I was actually quoting code from a C-based project, not a Vala-based project, where I don't need the fix. But if you install this patch then I will certainly use it in my C-based projects to reduce the use of #ifdef.)
Is there a reason not to make a similar macro for compute_curr_prefix?