Added C++ compatibility.