commit f34e82601645693ba85385d5de37ca5a34751ea7
parent afe8b4363367e87778373bb9009d0efd6a07cb9a
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Sun, 8 Feb 2026 15:37:44 +0100
Platform portability fixes
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/incl_priv/mhd_sys_options.h b/src/incl_priv/mhd_sys_options.h
@@ -463,6 +463,10 @@
# define mhd_UINT_TO_PTR(i) ((void *) (i))
#endif
+/* *************************************************************** *
+ * Macros to enable various features in the system headers *
+ * *************************************************************** */
+
#if defined(OS390)
#define _OPEN_THREADS
@@ -512,6 +516,12 @@
#define __STDC_WANT_LIB_EXT1__ 1
#endif /* HAVE_C11_GMTIME_S */
+#if defined(__sun) || defined(__illumos__)
+# ifndef _REENTRANT
+# define _REENTRANT 1 /* Could be optional, given that POSIX_C_SOURCE is defined */
+# endif
+#endif
+
/* Ensure that exactly one of the two macros is always defined */
#if defined(NDEBUG) && defined(_DEBUG)
#error Both _DEBUG and NDEBUG are defined
diff --git a/src/mhd2/sys_sockets_headers.h b/src/mhd2/sys_sockets_headers.h
@@ -226,8 +226,7 @@ typedef int mhd_SCKT_SEND_SIZE;
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
defined(__OpenBSD__) || defined(__NetBSD__) || \
- defined(MHD_SOCKETS_KIND_WINSOCK) || defined(__MACH__) || defined(__sun) || \
- defined(SOMEBSD)
+ defined(MHD_SOCKETS_KIND_WINSOCK) || defined(__MACH__) || defined(__sun)
/* Most of the OSes inherit nonblocking setting from the listen socket */
# define MHD_ACCEPTED_INHERITS_NONBLOCK 1
#elif defined(__gnu_linux__) || defined(__linux__)