Modified root_device.cpp to full support build with C++

Signed-off-by: sndnvaps <sndnvaps@gmail.com>