That will only work for open source libraries. It won't work for libraries provided in binary form (which is common in commercial contexts I've worked in so far). I also tend to dislike the preprocessor and other forms of syntactic programming in favour of solutions working on the semantic level. The more I know about the preprocessor, the less simple and more puzzling it is to me, especially after implementing it.