Update system.cpp

Add native C++ support