[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c++ to c converter



Quoting Peter L. Peres <plp@actcom.co.il>:
> On Sun, 9 May 1999, Erez Doron wrote:
> 
> >HI
> >
> >anyone knows of a linux util that converts c++ source to c ?

If I'm not mistken, old versions of g++ did right that. Try looking in the
archives.
> 
> An experienced programmer team with nothing else to do ? ;) 
You don't need a whole team. Al you have to do is convert every class
declaration to a struct, and every function that works on that class to 
__class_name_func_name. You'll have to work a bit more for the inheritance
thingies. 

Templates, OTOH, is a bit harder. I think you can solve it with casting to
void * and back to the needed type, with the use of cleaver macros. 

I don't think it should take more then two-three days of one good programmer. 


> 
> The other way around is easier otoh.

You don't have to do anything, ANSI C is contained with in C++...
> 
> Peter
> 
Liran.
-- 
__________________________________________________________________________
Liran Zvibel.                            | " You know, how is The Force 
System Programmer, System Administrator. |   like duct tape? Answer:       
email : liranz@actcom.co.il              |   it has a light side, a dark
phone : 972 - 3 - 6493939                |   side, and it holds the
home  : http://www.math.tau.ac.il/~liranz|   universe together. "
UIN: 708004 ; WHOIS : LZ615              |             -- Larry Wall 
--------------------------------------------------------------------------