Past few days I have been \"downgrading\" > 1000 filem of C++ code into C. It\'s been going well until now. Suddenly I\'m face to face with a class...
The compiler
Turn foobar into a normal struct
struct foobar {
goo mutex;
};
Create your own "constructor" and "destructor" as functions that you call on that struct
void InitFoobar(foobar* foo)
{
oneCreate(&foo->mutex);
}
void FreeFoobar(foobar* foo)
{
oneDestroy(foo->mutex);
}
struct foobar fooStruct;
InitFoobar(&fooStruct);
// ..
FreeFoobar(&fooStruct);
etc