Check the Exporters section in your Projucer project. There is an Extra Compiler Flags field there you can use as needed. And under the Configurations for each Exporter are things like Header Search Path and Preprocessor Definitions that you can set for controlling things like this. Your code can include an #if statement that lets you skip or include the following code in a particular file, or whether to #include a specific file or not, based on whether it’s Mac or Windows (or any other condition you specify).
Would also be nice to have a feature in the upcoming Projucer which lets you choose per file basis if you want it to be compiled in some specific build or not (exporter). This would make it much more convenient when working on multiplatform software which must have platform specific files.