alternative: do the common code just without any ? and use a ?MacOS block to redo the stuff for MacOS
You can't do it like that. If you don't specifically state what's for Windows and Linux, then it will get compiled along with any modifications you want to make for the Mac, when compiled on a Mac. You would only do it the way you're suggesting if you want the code for Windows/Linux to also run on a Mac, just with a little something extra.