Skip to content

Commit

Permalink
Gate stdext::checked_array_iterator usage on _ITERATOR_DEBUG_LEVEL (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-lipinski authored and BillyONeal committed Mar 20, 2019
1 parent 0387cb9 commit fac2ff7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Release/include/cpprest/containerstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class basic_container_buffer : public streams::details::streambuf_state_manager<
auto readBegin = std::begin(m_data) + m_current_position;
auto readEnd = std::begin(m_data) + newPos;

#ifdef _WIN32
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
std::copy(readBegin, readEnd, stdext::checked_array_iterator<_CharType*>(ptr, count));
#else
Expand Down
4 changes: 2 additions & 2 deletions Release/include/cpprest/producerconsumerstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class basic_producer_consumer_buffer : public streams::details::streambuf_state_
_CharType* beg = rbegin();
_CharType* end = rbegin() + countRead;

#ifdef _WIN32
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
std::copy(beg, end, stdext::checked_array_iterator<_CharType*>(dest, count));
#else
Expand All @@ -461,7 +461,7 @@ class basic_producer_consumer_buffer : public streams::details::streambuf_state_

const _CharType* srcEnd = src + countWritten;

#ifdef _WIN32
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
std::copy(src, srcEnd, stdext::checked_array_iterator<_CharType*>(wbegin(), static_cast<size_t>(avail)));
#else
Expand Down
4 changes: 2 additions & 2 deletions Release/include/cpprest/rawptrstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class basic_rawptr_buffer : public streams::details::streambuf_state_manager<_Ch
auto readBegin = m_data + m_current_position;
auto readEnd = m_data + newPos;

#ifdef _WIN32
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
std::copy(readBegin, readEnd, stdext::checked_array_iterator<_CharType*>(ptr, count));
#else
Expand All @@ -466,7 +466,7 @@ class basic_rawptr_buffer : public streams::details::streambuf_state_manager<_Ch
if (newSize > m_size) throw std::runtime_error("Writing past the end of the buffer");

// Copy the data
#ifdef _WIN32
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL != 0
// Avoid warning C4996: Use checked iterators under SECURE_SCL
std::copy(ptr, ptr + count, stdext::checked_array_iterator<_CharType*>(m_data, m_size, m_current_position));
#else
Expand Down

0 comments on commit fac2ff7

Please sign in to comment.