Two things.....

1) You can just use C code "as-is" in a C++ program without modification. Just wrap the function declarations in "extern "C" {}" and you'll be able to link in the compiled C files just fine. I would suggest this over attempting to C++-ize the code if it's supremely messy, which it sounds to be.

2) Multi-threading is going to be very dicey for any code involving global variables. You typically need to use mutexes to excess in those situations. Just a warning.