#if defined(_DEBUG) → #if !defined(NDEBUG)

Microsoft declares all identifiers starting with underscore _ as
internal to MSVC. Thus, we should either use defined(DEBUG) or
!defined(NDEBUG) to distinguish Debug and Release builds.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2024-01-25 10:35:09 +01:00
parent ce1688964a
commit b6be4f040e
2 changed files with 3 additions and 3 deletions

View File

@ -1440,7 +1440,7 @@ namespace stdex
{ "wbr", element_t::wbr, },
{ "xmp", element_t::xmp, },
};
#ifdef _DEBUG
#ifndef NDEBUG
// The mapping table MUST be sorted and all names in lowercase.
for (size_t i = 1; i < _countof(mapping); i++)
_Assume_(stdex::strcmp(mapping[i - 1].name, mapping[i].name) <= 0);

View File

@ -55,7 +55,7 @@ namespace stdex
{
{
const std::lock_guard<std::mutex> lg(m_mutex);
#ifdef _DEBUG
#ifndef NDEBUG
size_t tail = wrap(m_head + m_size);
_Assume_(size <= (m_head <= tail ? N_cap - tail : m_head - tail));
#endif
@ -90,7 +90,7 @@ namespace stdex
{
{
const std::lock_guard<std::mutex> lg(m_mutex);
#ifdef _DEBUG
#ifndef NDEBUG
size_t tail = wrap(m_head + m_size);
_Assume_(size <= (m_head < tail ? m_size : N_cap - m_head));
#endif