Number of OSGeo stack software written by C/C++ camphave to run on Microsoft Windows systems. I think I wouldn’t be dead wrong if said that most of hackers from OSGeo Community work on Unix systems (Linux, Mac OS X) but there is large number of users who work on Windows.
Principles of Portability
Obey the standards, because they are not just dumb rules.
Make a list of compilers that must be supported. Learn about their differences.
Write code in C or in C++, but do not write both at the same time.
Avoid (direct) use of C POSIX Library.
Never ever disable any warnings compiler throw. Fix them.
Be pedantic. Compile in highest strict mode possible.
If possible, do not use compiler-specific features.
Do not make platform/architecture specific assumptions about memory addressing, memory layout, etc.
Personal preferences are evil. Make decisions based on reasoning.
(Re)Use good code that already exist. Boost C++ Libraries won’t bite you!