rewrote to conform to strict C, remove MinGW C++ plugin depend