commit 30beb61e117fdfe1f7b1bca602c5c4b1cce33fc5
parent 5e0c22236781a8dfb8cee15264c6b02d3b10725b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Fri, 14 Oct 2022 11:25:29 +0300
Added ability to check for MHD debug builds at run-time
Diffstat:
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git 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
@@ -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;