From f5b2be0a03556e8ab5246fc75431ed1546c40bb0 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 16 Sep 2021 01:04:38 +0200 Subject: [PATCH] rename Assert to beammp_assert --- include/CustomAssert.h | 2 +- src/TLuaEngine.cpp | 4 ++-- src/TNetwork.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/CustomAssert.h b/include/CustomAssert.h index 7bf3622..cf1c496 100644 --- a/include/CustomAssert.h +++ b/include/CustomAssert.h @@ -55,7 +55,7 @@ inline void _assert([[maybe_unused]] const char* file, [[maybe_unused]] const ch } } -#define Assert(cond) _assert(__FILE__, __func__, __LINE__, #cond, (cond)) +#define beammp_assert(cond) _assert(__FILE__, __func__, __LINE__, #cond, (cond)) #define AssertNotReachable() _assert(__FILE__, __func__, __LINE__, "reached unreachable code", false) #else // In release build, these macros turn into NOPs. The compiler will optimize these out. diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index 990bc08..f8438b4 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -39,6 +39,6 @@ void TLuaEngine::CollectPlugins() { } void TLuaEngine::InitializePlugin(const fs::path& folder) { - Assert(fs::exists(folder)); - Assert(fs::is_directory(folder)); + beammp_assert(fs::exists(folder)); + beammp_assert(fs::is_directory(folder)); } diff --git a/src/TNetwork.cpp b/src/TNetwork.cpp index 66d4299..016deac 100644 --- a/src/TNetwork.cpp +++ b/src/TNetwork.cpp @@ -542,7 +542,7 @@ void TNetwork::UpdatePlayer(TClient& Client) { } void TNetwork::OnDisconnect(const std::weak_ptr& ClientPtr, bool kicked) { - Assert(!ClientPtr.expired()); + beammp_assert(!ClientPtr.expired()); auto LockedClientPtr = ClientPtr.lock(); TClient& c = *LockedClientPtr; beammp_info(c.GetName() + (" Connection Terminated")); @@ -591,7 +591,7 @@ int TNetwork::OpenID() { } void TNetwork::OnConnect(const std::weak_ptr& c) { - Assert(!c.expired()); + beammp_assert(!c.expired()); beammp_info("Client connected"); auto LockedClient = c.lock(); LockedClient->SetID(OpenID()); @@ -843,7 +843,7 @@ bool TNetwork::SyncClient(const std::weak_ptr& c) { void TNetwork::SendToAll(TClient* c, const std::string& Data, bool Self, bool Rel) { if (!Self) - Assert(c); + beammp_assert(c); char C = Data.at(0); bool ret = true; mServer.ForEachClient([&](std::weak_ptr ClientPtr) -> bool {