Obviously, the preceding code is ugly. Even in this simple example, one has a hard time reading through the class definition. It’s also a bit of a maintenance headache; adding (or subtracting) platforms requires a change to the class, and to the
main program. In addition, it breaks the guideline that interfaces not expose which platforms are supported by the API.
- 1. Policy and Management
- from Cross-Platform Development in C++: Building Mac OS X, Linux, and Windows Applications
- Publisher: Addison-Wesley Professional
- Released: November 2007
if defined #endif #if defined #endif ... mixture
Share this highlighthttp://www.safaribooksonline.com/a/cross-platform-development-in/626247/