Fix bugs for C/C++ mix and MSVC in crypt libs