I have heard that a way to write Cross Platform c++ code is to define classes as follows (for example, a Window class):
window.h
window_win32.cpp
window_linux.cp
I would only add a 5) bullet to @Laethnes' answer
5) Write an empty header that includes, at compile-time, the platform header and hide the platform-specific class under a typedef
// MyClass.hpp
#if defined(WINDOWS)
# include "WINMyClass.hpp"
typedef WINMyClass MyClass
#elif defined(OSX)
# include "OSXMyClass.hpp"
typedef OSXMyClass MyClass
... // keep going
#endif
Pros:
Cons: