[winpr,assert] always compile in assert helper

This commit is contained in:
akallabeth
2024-12-12 18:31:24 +01:00
committed by Armin Novak
parent 964063a369
commit 795914e50c
2 changed files with 12 additions and 8 deletions

View File

@@ -34,22 +34,28 @@
winpr_int_assert(#cond, (file), (fkt), (line)); \
} while (0)
#else
#define winpr_internal_assert(cond, file, fkt, line) assert(cond)
#endif
#ifdef __cplusplus
extern "C"
{
#endif
extern WINPR_NORETURN(void winpr_int_assert(const char* condstr, const char* file,
const char* fkt, size_t line));
/* this function meant only to be used by WINPR_ASSERT
* it needs to be exported as our assert implementation calls this for debug logging.
*
* also export when WITH_VERBOSE_WINPR_ASSERT is disabled as other software might compile with
* it enabled
*/
WINPR_API WINPR_NORETURN(void winpr_int_assert(const char* condstr, const char* file,
const char* fkt, size_t line));
#ifdef __cplusplus
}
#endif
#else
#define winpr_internal_assert(cond, file, fkt, line) assert(cond)
#endif
#define WINPR_ASSERT_AT(cond, file, fkt, line) \
do \
{ \

View File

@@ -22,7 +22,6 @@
#include <winpr/wlog.h>
#include <winpr/debug.h>
#if defined(WITH_VERBOSE_WINPR_ASSERT) && (WITH_VERBOSE_WINPR_ASSERT != 0)
void winpr_int_assert(const char* condstr, const char* file, const char* fkt, size_t line)
{
wLog* _log_cached_ptr = WLog_Get("com.freerdp.winpr.assert");
@@ -30,4 +29,3 @@ void winpr_int_assert(const char* condstr, const char* file, const char* fkt, si
winpr_log_backtrace_ex(_log_cached_ptr, WLOG_FATAL, 20);
abort();
}
#endif