When writing portable cross-platform code, don't litter your code with preprocessor macros, use compile-time polymorphism instead.
A flexible build system will enable you to use advanced OOP-like compile-time polymorphism. That way you can hide all the specifics of the different platform behind an interface firewall. It is the usual way that most cross-platform toolkits and frameworks (such as QT, GTK or wxWidgets) are designed.