Skip to content

Commit 5c9b2ef

Browse files
committed
Added noexcept to VS 14, changed char16_t overloads on MSVC to use wchar_t instead
1 parent c3dcdcf commit 5c9b2ef

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Release/include/cpprest/details/windows_compat.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@
2626
****/
2727
#pragma once
2828

29-
#if _MSC_VER >= 1700
29+
#if defined(_MSC_VER) && _MSC_VER >= 1700
3030
// Support VS2012 SAL syntax only
3131
#include <sal.h>
3232
#else
3333
#include "cpprest/details/nosal.h"
3434
#endif
3535

36-
#define _noexcept
36+
#if defined(_MSC_VER) && _MSC_VER >= 1800
37+
#define _noexcept noexcept
38+
#else
39+
#define _noexcept
40+
#endif
3741

3842
#define CASABLANCA_UNREFERENCED_PARAMETER(x) (x)
3943

Release/src/json/json_parsing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,11 @@ bool JSON_StringParser<CharType>::CompleteComment(typename JSON_Parser<CharType>
697697
return true;
698698
}
699699

700-
void convert_append_unicode_code_unit(JSON_Parser<wchar_t>::Token &token, char16_t value)
700+
void convert_append_unicode_code_unit(JSON_Parser<wchar_t>::Token &token, utf16char value)
701701
{
702702
token.string_val.push_back(value);
703703
}
704-
void convert_append_unicode_code_unit(JSON_Parser<char>::Token &token, char16_t value)
704+
void convert_append_unicode_code_unit(JSON_Parser<char>::Token &token, utf16char value)
705705
{
706706
utf16string utf16(reinterpret_cast<utf16char *>(&value), 1);
707707
token.string_val.append(::utility::conversions::utf16_to_utf8(utf16));
@@ -766,7 +766,7 @@ inline bool JSON_Parser<CharType>::handle_unescape_char(Token &token)
766766
}
767767

768768
// Construct the character based on the decoded number
769-
convert_append_unicode_code_unit(token, static_cast<char16_t>(decoded));
769+
convert_append_unicode_code_unit(token, static_cast<utf16char>(decoded));
770770

771771
return true;
772772
}

0 commit comments

Comments
 (0)