diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-10-14 11:25:29 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-10-14 11:25:29 +0300 |
commit | 30beb61e117fdfe1f7b1bca602c5c4b1cce33fc5 (patch) | |
tree | 80a5b249d2a6c3d335046d52f66b27dcd4036cbb | |
parent | 5e0c22236781a8dfb8cee15264c6b02d3b10725b (diff) | |
download | libmicrohttpd-30beb61e117fdfe1f7b1bca602c5c4b1cce33fc5.tar.gz libmicrohttpd-30beb61e117fdfe1f7b1bca602c5c4b1cce33fc5.zip |
Added ability to check for MHD debug builds at run-time
-rw-r--r-- | src/include/microhttpd.h | 12 | ||||
-rw-r--r-- | 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" | |||
96 | * they are parsed as decimal numbers. | 96 | * they are parsed as decimal numbers. |
97 | * Example: 0x01093001 = 1.9.30-1. | 97 | * Example: 0x01093001 = 1.9.30-1. |
98 | */ | 98 | */ |
99 | #define MHD_VERSION 0x00097542 | 99 | #define MHD_VERSION 0x00097543 |
100 | 100 | ||
101 | /* If generic headers don't work on your platform, include headers | 101 | /* If generic headers don't work on your platform, include headers |
102 | which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', | 102 | which define 'va_list', 'size_t', 'ssize_t', 'intptr_t', 'off_t', |
@@ -6186,7 +6186,15 @@ enum MHD_FEATURE | |||
6186 | * unlikely. | 6186 | * unlikely. |
6187 | * @note Available since #MHD_VERSION 0x00097540 | 6187 | * @note Available since #MHD_VERSION 0x00097540 |
6188 | */ | 6188 | */ |
6189 | MHD_FEATURE_EXTERN_HASH = 32 | 6189 | MHD_FEATURE_EXTERN_HASH = 32, |
6190 | |||
6191 | /** | ||
6192 | * Get whether MHD was built with asserts enabled. | ||
6193 | * For debug builds the error log is always enabled even if #MHD_USE_ERROR_LOG | ||
6194 | * is not specified for daemon. | ||
6195 | * @note Available since #MHD_VERSION 0x00097543 | ||
6196 | */ | ||
6197 | MHD_FEATURE_DEBUG_BUILD = 33 | ||
6190 | }; | 6198 | }; |
6191 | 6199 | ||
6192 | 6200 | ||
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) | |||
8747 | #else | 8747 | #else |
8748 | return MHD_NO; | 8748 | return MHD_NO; |
8749 | #endif | 8749 | #endif |
8750 | case MHD_FEATURE_DEBUG_BUILD: | ||
8751 | #ifdef _DEBUG | ||
8752 | return MHD_YES; | ||
8753 | #else | ||
8754 | return MHD_NO; | ||
8755 | #endif | ||
8750 | 8756 | ||
8751 | default: | 8757 | default: |
8752 | break; | 8758 | break; |