libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit db3d2d32f56fadc0f668d3113a9b3b78a9ab0c96
parent a868dbc89705411f0db745b90c6c0639bd471f12
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sat, 28 Feb 2026 23:25:56 +0100

connection.c: improved macro to avoid duplication of error messages macros

Diffstat:
Msrc/microhttpd/connection.c | 19+++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c @@ -2946,19 +2946,34 @@ transmit_error_response_len (struct MHD_Connection *connection, /** * Transmit static string as error response */ -#define transmit_error_response_static(c, code, msg) \ +#ifdef HAVE_MESSAGES +# define transmit_error_response_static(c, code, msg) \ transmit_error_response_len (c, code, \ msg, MHD_STATICSTR_LEN_ (msg), \ NULL, 0, NULL, 0) +#else /* ! HAVE_MESSAGES */ +# define transmit_error_response_static(c, code, msg) \ + transmit_error_response_len (c, code, \ + "", 0, \ + NULL, 0, NULL, 0) +#endif /* ! HAVE_MESSAGES */ /** * Transmit static string as error response and add specified header */ -#define transmit_error_response_header(c, code, m, hd_n, hd_n_l, hd_v, hd_v_l) \ +#ifdef HAVE_MESSAGES +# define transmit_error_response_header(c, code, m, hd_n, hd_n_l, hd_v, hd_v_l) \ transmit_error_response_len (c, code, \ m, MHD_STATICSTR_LEN_ (m), \ hd_n, hd_n_l, \ hd_v, hd_v_l) +#else /* ! HAVE_MESSAGES */ +# define transmit_error_response_header(c, code, m, hd_n, hd_n_l, hd_v, hd_v_l) \ + transmit_error_response_len (c, code, \ + "", 0, \ + hd_n, hd_n_l, \ + hd_v, hd_v_l) +#endif /* ! HAVE_MESSAGES */ /**