From 30beb61e117fdfe1f7b1bca602c5c4b1cce33fc5 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 14 Oct 2022 11:25:29 +0300 Subject: Added ability to check for MHD debug builds at run-time --- src/include/microhttpd.h | 12 ++++++++++-- src/microhttpd/daemon.c | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 13bfa554..34b35c4f 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h @@ -96,7 +96,7 @@ extern "C" * they are parsed as decimal numbers. * Example: 0x01093001 = 1.9.30-1. */ -#define MHD_VERSION 0x00097542 +#define MHD_VERSION 0x00097543 /* If generic headers don't work on your platform, include headers which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', @@ -6186,7 +6186,15 @@ enum MHD_FEATURE * unlikely. * @note Available since #MHD_VERSION 0x00097540 */ - MHD_FEATURE_EXTERN_HASH = 32 + MHD_FEATURE_EXTERN_HASH = 32, + + /** + * Get whether MHD was built with asserts enabled. + * For debug builds the error log is always enabled even if #MHD_USE_ERROR_LOG + * is not specified for daemon. + * @note Available since #MHD_VERSION 0x00097543 + */ + MHD_FEATURE_DEBUG_BUILD = 33 }; diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 90a49e91..c5aa3d9d 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -8747,6 +8747,12 @@ MHD_is_feature_supported (enum MHD_FEATURE feature) #else return MHD_NO; #endif + case MHD_FEATURE_DEBUG_BUILD: +#ifdef _DEBUG + return MHD_YES; +#else + return MHD_NO; +#endif default: break; -- cgit v1.2.3