The enum has no fixed underlying type and its largest enumerator is 511,
so in C++ it can only hold 0..511. The manual calls other numeric values
"possible but not advised" (doc/manual/responses.inc), and
response_create_basic() accepts any code from 100 to 999. But a C++
application cannot pass, for example, 599 without undefined behaviour.
The enum now has the same 65535 sentinel as MHD_ConnectionOption and the
info type enums.
---
 src/include/microhttpd2.h         | 9 +++++++++
 src/include/microhttpd2_main.h.in | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
index c2e546d..a95fcb0 100644
--- a/src/include/microhttpd2.h
+++ b/src/include/microhttpd2.h
@@ -5989,6 +5989,15 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_HTTP_StatusCode

   /* 509 "Bandwidth Limit Exceeded". Apache extension. */
   MHD_HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED =    509
+  ,
+
+  /* * Sentinel * */
+  /**
+   * The sentinel value.
+   * This value enforces specific underlying integer type for the enum.
+   * Do not use.
+   */
+  MHD_HTTP_STATUS_SENTINEL = 65535
 };


diff --git a/src/include/microhttpd2_main.h.in
b/src/include/microhttpd2_main.h.in
index 3292049..a3abb0c 100644
--- a/src/include/microhttpd2_main.h.in
+++ b/src/include/microhttpd2_main.h.in
@@ -930,6 +930,15 @@ enum MHD_FIXED_ENUM_APP_SET_ MHD_HTTP_StatusCode

   /* 509 "Bandwidth Limit Exceeded". Apache extension. */
   MHD_HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED =    509
+  ,
+
+  /* * Sentinel * */
+  /**
+   * The sentinel value.
+   * This value enforces specific underlying integer type for the enum.
+   * Do not use.
+   */
+  MHD_HTTP_STATUS_SENTINEL = 65535
 };


-- 
2.43.0

Reply via email to