From d987a8dd8c3f35f6f50a63f60cb1777dd38af2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Mellstr=C3=B6m?= Date: Thu, 3 Jun 2021 13:56:11 +0200 Subject: [PATCH] Add define to allow platform override of debug printf function --- src/include/general.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/include/general.h b/src/include/general.h index da7cf3d..ba329d2 100644 --- a/src/include/general.h +++ b/src/include/general.h @@ -59,9 +59,12 @@ enum BMP_DEBUG { * BMP PC-Hosted is the preferred way. Printing DEBUG_WARN * and DEBUG_INFO is kept for comptibiluty. */ +# if !defined(PLATFORM_PRINTF) +# define PLATFORM_PRINTF printf +# endif # if defined(ENABLE_DEBUG) -# define DEBUG_WARN printf -# define DEBUG_INFO printf +# define DEBUG_WARN PLATFORM_PRINTF +# define DEBUG_INFO PLATFORM_PRINTF # else # define DEBUG_WARN(...) do {} while(0) # define DEBUG_INFO(...) do {} while(0)