[SDL] C2C++ convertor/tool
Akinwale Ariwodola
akinwale at dev.definedworks.org
Mon May 3 16:48:19 PDT 2004
Er... I don't think this is technically advisable. It might not only be
difficult, but it may lead to a lot of bugs after converted.
Re-engineering is probably the way to go (rewriting the code). You look
at the code, understand it and dissect it and then rewrite it in C++...
But then again, you might want to consider long-term benefits of writing
a program which converts C code to C++ code. You might want to convert
other C programs to C++ in the future.
The choice is yours.
- Akinwale Ariwodola
KevinGPO wrote:
>I want to write a program so that it opens a C project and links all the
>dependencies, etc. views the project objectly. Then convert each C file to a
>C++ class in one go, or one file to class at a time. Is this possible? Has this
>idea already been done?
>
>I know C is a subset of C++ and some of you might think - easy! just rename .c
>file to .cpp. What am looking for is to encapsulate/wrapping a C file functions
>into a C++ class. But obviously it's not easy like that. We have to look at the
>relationships between each C file in a massive C project/program.
>
>I am wanting to convert the old classic SDLDoom-1.10 (which is purely 100% C)
>into C++ (see source at www.doomworld.com sourceports download). We can take
>each .c & .h couple and encapsulate/wrapup all the functions from the .c file
>into the .h file in a class named after the file name.
>
>Now what to do with extern variables and function prototypes? Plus, isn't C++
>heavily strongly typed?
>
>HELP!
>
>
>_______________________________________________
>SDL mailing list
>SDL at libsdl.org
>http://www.libsdl.org/mailman/listinfo/sdl
>
>
>
>
>
More information about the SDL
mailing list