Fix MSVC C++ ABI build. Close #2588.