Skip to content

Commit 01a1dc1

Browse files
committed
Fixing some incorrect _MSC_VER checks for VS2015.
1 parent 1cc2f93 commit 01a1dc1

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Release/src/http/common/http_helpers.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static const utility::string_t textual_types [] = {
6060
#endif
6161
bool is_content_type_textual(const utility::string_t &content_type)
6262
{
63-
#if !defined(_WIN32) || _MSC_VER > 1900
63+
#if !defined(_WIN32) || _MSC_VER >= 1900
6464
static const utility::string_t textual_types [] = {
6565
mime_types::message_http,
6666
mime_types::application_json,
@@ -93,7 +93,7 @@ static const utility::string_t json_types [] = {
9393
#endif
9494
bool is_content_type_json(const utility::string_t &content_type)
9595
{
96-
#if !defined(_WIN32) || _MSC_VER > 1900
96+
#if !defined(_WIN32) || _MSC_VER >= 1900
9797
static const utility::string_t json_types [] = {
9898
mime_types::application_json,
9999
mime_types::application_xjson,
@@ -173,7 +173,7 @@ utility::string_t get_default_charset(const utility::string_t &content_type)
173173

174174
// Remove once VS 2013 is no longer supported.
175175
#if defined(_WIN32) && _MSC_VER < 1900
176-
static http_status_to_phrase idToPhraseMap [] = {
176+
static const http_status_to_phrase idToPhraseMap [] = {
177177
#define _PHRASES
178178
#define DAT(a,b,c) {status_codes::a, c},
179179
#include "cpprest/details/http_constants.dat"
@@ -183,11 +183,11 @@ static http_status_to_phrase idToPhraseMap [] = {
183183
#endif
184184
utility::string_t get_default_reason_phrase(status_code code)
185185
{
186-
#if !defined(_WIN32) || _MSC_VER > 1900
186+
#if !defined(_WIN32) || _MSC_VER >= 1900
187187
// Future improvement: why is this stored as an array of structs instead of a map
188188
// indexed on the status code for faster lookup?
189189
// Not a big deal because it is uncommon to not include a reason phrase.
190-
static http_status_to_phrase idToPhraseMap [] = {
190+
static const http_status_to_phrase idToPhraseMap [] = {
191191
#define _PHRASES
192192
#define DAT(a,b,c) {status_codes::a, c},
193193
#include "cpprest/details/http_constants.dat"
@@ -197,11 +197,11 @@ utility::string_t get_default_reason_phrase(status_code code)
197197
#endif
198198

199199
utility::string_t phrase;
200-
for (const auto &iter : idToPhraseMap)
200+
for (const auto &elm : idToPhraseMap)
201201
{
202-
if (iter.id == code)
202+
if (elm.id == code)
203203
{
204-
phrase = iter.phrase;
204+
phrase = elm.phrase;
205205
break;
206206
}
207207
}

Release/src/http/oauth/oauth1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ const oauth1_token& oauth1_config::token() const
409409
}
410410
else
411411
{
412-
#if !defined(_WIN32) || _MSC_VER > 1900
412+
#if !defined(_WIN32) || _MSC_VER >= 1900
413413
static const oauth1_token empty_token;
414414
#endif
415415
return empty_token;

Release/src/json/json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static web::json::details::json_error_category_impl instance;
488488
#endif
489489
const web::json::details::json_error_category_impl& web::json::details::json_error_category()
490490
{
491-
#if !defined(_WIN32) || _MSC_VER > 1900
491+
#if !defined(_WIN32) || _MSC_VER >= 1900
492492
static web::json::details::json_error_category_impl instance;
493493
#endif
494494
return instance;

Release/src/utilities/asyncrt_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static details::windows_category_impl instance;
170170
#endif
171171
const std::error_category & __cdecl windows_category()
172172
{
173-
#if _MSC_VER > 1900
173+
#if _MSC_VER >= 1900
174174
static details::windows_category_impl instance;
175175
#endif
176176
return instance;

0 commit comments

Comments
 (0)