some compatibility fixes
resolve C++ and C misunderstandings when compile