From 0c701a4ca052cbf3345aee7961d39f4fdce39b7d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 6 Apr 2026 22:00:45 +0100 Subject: Define NDEBUG when not building in debug mode. --- src/cull.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/cull.cpp') diff --git a/src/cull.cpp b/src/cull.cpp index 8513bf84b..f3bcc23db 100644 --- a/src/cull.cpp +++ b/src/cull.cpp @@ -25,14 +25,14 @@ #include "inspircd.h" -#ifdef INSPIRCD_DEBUG +#ifndef NDEBUG # include #endif #include Cullable::Cullable() { -#ifdef INSPIRCD_DEBUG +#ifndef NDEBUG if (ServerInstance) { ServerInstance->Logs.Debug("CULL", "Cullable::+{} @{}", @@ -43,7 +43,7 @@ Cullable::Cullable() Cullable::~Cullable() { -#ifdef INSPIRCD_DEBUG +#ifndef NDEBUG if (ServerInstance) { ServerInstance->Logs.Debug("CULL", "Cullable::~{} @{}", @@ -54,7 +54,7 @@ Cullable::~Cullable() Cullable::Result Cullable::Cull() { -#ifdef INSPIRCD_DEBUG +#ifndef NDEBUG if (ServerInstance) { ServerInstance->Logs.Debug("CULL", "Cullable::-{} @{}", @@ -90,7 +90,7 @@ void CullList::Apply() auto* c = list[idx]; if (culled.insert(c).second) { -#ifdef INSPIRCD_DEBUG +#ifndef NDEBUG ServerInstance->Logs.Debug("CULL", "Culling {} @{}", typeid(*c).name(), (void*)c); #endif @@ -102,12 +102,12 @@ void CullList::Apply() } else { -#ifdef INSPIRCD_DEBUG - ServerInstance->Logs.Debug("CULL", "BUG: {} @{} was added to the cull list twice!", - typeid(*c).name(), (void*)c); -#else +#ifdef NDEBUG ServerInstance->Logs.Debug("CULL", "BUG: @{} was added to the cull list twice!", (void*)c); +#else + ServerInstance->Logs.Debug("CULL", "BUG: {} @{} was added to the cull list twice!", + typeid(*c).name(), (void*)c); #endif } } @@ -115,7 +115,7 @@ void CullList::Apply() for (auto* c : deletable) { -#ifdef INSPIRCD_DEBUG +#ifndef NDEBUG ServerInstance->Logs.Debug("CULL", "Deleting {} @{}", typeid(*c).name(), (void*)c); #endif -- cgit v1.3.1-10-gc9f91