vcpkg/ports/nanodbc/0002_msvc14_codecvt.patch
2016-10-13 19:07:01 +08:00

35 lines
2.3 KiB
Diff

diff --git a/src/nanodbc.cpp b/src/nanodbc.cpp
index 8e02d4a..2e42b91 100644
--- a/src/nanodbc.cpp
+++ b/src/nanodbc.cpp
@@ -209,10 +209,11 @@ namespace
out = utf_to_utf<char>(in.c_str(), in.c_str() + in.size());
#else
#if defined(_MSC_VER) && (_MSC_VER == 1900)
- // Workaround for confirmed bug in VS2015.
- // See: https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error
- auto p = reinterpret_cast<wide_char_t const*>(in.data());
- out = std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t>().to_bytes(p, p + in.size());
+ // Workaround for confirmed bug in VS2015. See:
+ // https://connect.microsoft.com/VisualStudio/Feedback/Details/1403302
+ // https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error
+ auto p = reinterpret_cast<unsigned short const*>(in.data());
+ out = std::wstring_convert<NANODBC_CODECVT_TYPE<unsigned short>, unsigned short>().to_bytes(p, p + in.size());
#else
out = std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t>().to_bytes(in);
#endif
@@ -226,9 +227,10 @@ namespace
using boost::locale::conv::utf_to_utf;
out = utf_to_utf<wide_char_t>(in.c_str(), in.c_str() + in.size());
#elif defined(_MSC_VER) && (_MSC_VER == 1900)
- // Workaround for confirmed bug in VS2015.
- // See: https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error
- auto s = std::wstring_convert<NANODBC_CODECVT_TYPE<wide_char_t>, wide_char_t>().from_bytes(in);
+ // Workaround for confirmed bug in VS2015. See:
+ // https://connect.microsoft.com/VisualStudio/Feedback/Details/1403302
+ // https://social.msdn.microsoft.com/Forums/en-US/8f40dcd8-c67f-4eba-9134-a19b9178e481/vs-2015-rc-linker-stdcodecvt-error
+ auto s = std::wstring_convert<NANODBC_CODECVT_TYPE<unsigned short>, unsigned short>().from_bytes(in);
auto p = reinterpret_cast<wide_char_t const*>(s.data());
out.assign(p, p + s.size());
#else