From 3a75228242401de96eaf66222e77a72a40dc3b40 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 10 Jun 2021 08:57:40 +0200 Subject: [PATCH] Added option do disable WINPR_ASSERT --- winpr/CMakeLists.txt | 6 ++++++ winpr/include/winpr/assert.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index 05e662885..512f5926d 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -21,6 +21,12 @@ project(WinPR C) set(CMAKE_COLOR_MAKEFILE ON) +option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON) + +if (WITH_VERBOSE_WINPR_ASSERT) + add_definitions(-DWITH_VERBOSE_WINPR_ASSERT) +endif() + if(FREERDP_VERSION) set(FREERDP_BUILD 1) endif() diff --git a/winpr/include/winpr/assert.h b/winpr/include/winpr/assert.h index 724f82b97..ae9deb2e7 100644 --- a/winpr/include/winpr/assert.h +++ b/winpr/include/winpr/assert.h @@ -26,6 +26,7 @@ #include #include +#if WITH_VERBOSE_WINPR_ASSERT #define WINPR_ASSERT(cond) \ do \ { \ @@ -36,6 +37,12 @@ abort(); \ } \ } while (0) +#else +#define WINPR_ASSERT(cond) \ + do \ + { \ + } while (0) +#endif #ifdef __cplusplus extern "C"