Convert drivers.c to C++