I don't know how to detect the lazarus version at compile time, but some place I was reading about performing an {$IFDEF ProcName} or something similar. I'll take a look around and see if I can find it.
I noticed the thread after you pointed it out, but the title threw me and didn't notice it when I was looking for a fix.