Merge pull request #1384 from keymanapp/common-msvc-update-to-1916

[Common] Update VS version checks to 19.16 for latest release of VS2017 (bug in VS workaround)
This commit is contained in:
Marc Durdin 2018-12-05 15:16:40 +11:00 committed by GitHub
commit 8d0f85b7dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -56,7 +56,7 @@ json & km::kbp::operator << (json & j, km::kbp::keyboard const & kb)
https://stackoverflow.com/a/35103224/1836776
*/
#if _MSC_VER >= 1900 /* VS 2015 */ && _MSC_VER <= 1915 /* VS 2017 */
#if _MSC_VER >= 1900 /* VS 2015 */ && _MSC_VER <= 1916 /* VS 2017 19.16 */
std::string utf16_to_utf8(std::u16string utf16_string)
{

View file

@ -229,14 +229,14 @@ PKMX_WCHAR km::kbp::kmx::strtowstr(PKMX_CHAR in)
{
km_kbp_cp *result;
#if _MSC_VER >= 1900 /* VS 2015 */ && _MSC_VER <= 1915 /* VS 2017 */
#if _MSC_VER >= 1900 /* VS 2015 */ && _MSC_VER <= 1916 /* VS 2017 19.16 */
std::wstring_convert<std::codecvt_utf8_utf16<int16_t>, int16_t> convert;
#else
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert;
#endif
auto s = convert.from_bytes(in, strchr(in, 0));
result = new KMX_WCHAR[s.length() + 1];
#if _MSC_VER >= 1900 /* VS 2015 */ && _MSC_VER <= 1915 /* VS 2017 */
#if _MSC_VER >= 1900 /* VS 2015 */ && _MSC_VER <= 1916 /* VS 2017 19.16 */
s.copy(reinterpret_cast<int16_t *>(result), s.length());
#else
s.copy(result, s.length());