From b6be4f040ea6afc6a49985e6bdec692db7cf2b35 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 25 Jan 2024 10:35:09 +0100 Subject: [PATCH] =?UTF-8?q?#if=20defined(=5FDEBUG)=20=E2=86=92=20#if=20!de?= =?UTF-8?q?fined(NDEBUG)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- include/stdex/html.hpp | 2 +- include/stdex/ring.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/stdex/html.hpp b/include/stdex/html.hpp index 7105cb0cb..4f21ccc5e 100644 --- a/include/stdex/html.hpp +++ b/include/stdex/html.hpp @@ -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); diff --git a/include/stdex/ring.hpp b/include/stdex/ring.hpp index 795a86209..87746e270 100644 --- a/include/stdex/ring.hpp +++ b/include/stdex/ring.hpp @@ -55,7 +55,7 @@ namespace stdex { { const std::lock_guard 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 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