Possible Duplicate:
Code convert from C++ to C
This is the dilemma. I have software that will be 10 times easier to maintain in C++ than C. This code will run on various platforms (on the PC and embedded systems of various types). C++ is naturally a better language for this project because I have components that must be switched in and out to accommodate the various platforms that it will be running on. Abstract classes, polymorphism, really really helps.
The problem is that some embedded systems does not have a C++ compiler, only C. Now I could rewrite the software in C but this is problematic since the software is always evolving and maintaining a C branch and C++ branch will be c开发者_开发知识库ostly. What I want instead is something, or some method, of developing the software in C++ and then when necessary, I can either throw the code into some kind of magical converter to get C code. Or maybe I can achieve this with compiler flags.. sounds messy but seems possible. The second option, which I really really want to avoid, is to bite the bullet and maintain the code in C.
Any solutions?
Comeau C++ generates C code.
精彩评论