fix C++ compatibility