You might want to look at Boost Wave. It's a preprocessor built as a library instead of an application, but putting a wrapper around it to turn it into a standalone program should be fairly trivial (most of what you'd do is connect things up so it knows what file(s) to read from and write to).