commit 68904e36dc3eff00ef3c076d1c9047be766ab63e
parent 6d3f2a4b44890e8017bed8d49dacd63d4a9740a5
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Mon, 22 Dec 2025 15:57:54 +0100
MbedTLS backend: added a workaround for C++ compilers
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/mhd2/tls_mbed_tls_lib.h b/src/mhd2/tls_mbed_tls_lib.h
@@ -51,6 +51,16 @@
#error This header can be used only if MbedTLS is enabled
#endif
+#ifndef __cplusplus
+# define mhd_MBETLS_C_HDR_START /* Empty */
+# define mhd_MBETLS_C_HDR_FINISH /* Empty */
+#else /* __cplusplus */
+/* *INDENT-OFF* */
+# define mhd_MBETLS_C_HDR_START extern "C" {
+# define mhd_MBETLS_C_HDR_FINISH }
+/* *INDENT-ON* */
+#endif /* __cplusplus */
+
#include "microhttpd2_portability.h"
#if defined(MHD_WARN_IGNORE_STYLE_GCC)
@@ -118,7 +128,9 @@ MHD_WARN_IGNORE_ ("-Wdocumentation-pedantic")
#endif /* MBEDTLS_ENTROPY_C */
#ifdef mhd_TLS_MBED_USE_PSA
+mhd_MBETLS_C_HDR_START
# include <mbedtls/psa_util.h>
+mhd_MBETLS_C_HDR_FINISH
# define mhd_TLS_MBED_HAS_RNG_PSA 1
#elif defined(MHD_TLS_MBED_PREF_RNG_PSA)
# undef MHD_TLS_MBED_PREF_RNG_PSA