[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 179/335: microhttpd2_portability.h: lowered scope of inc
From: |
gnunet |
Subject: |
[libmicrohttpd] 179/335: microhttpd2_portability.h: lowered scope of included system headers, minor refactoring |
Date: |
Sat, 27 Jul 2024 22:01:15 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.
commit 97e031c9a23bb69a0139adcf1d6056f80e6d19fc
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu May 16 15:36:27 2024 +0200
microhttpd2_portability.h: lowered scope of included system headers, minor
refactoring
---
src/include/microhttpd2_portability.h | 52 ++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 22 deletions(-)
diff --git a/src/include/microhttpd2_portability.h
b/src/include/microhttpd2_portability.h
index a6036891..b05d8fed 100644
--- a/src/include/microhttpd2_portability.h
+++ b/src/include/microhttpd2_portability.h
@@ -1,29 +1,37 @@
MHD_C_DECLRATIONS_START_HERE_
/* *INDENT-OFF* */
-/* If generic headers don't work on your platform, include headers
- which define 'va_list', 'size_t', 'uint_fast16_t', 'uint_fat32_t',
- 'uint_fast64_t', 'struct sockaddr', and "#define MHD_PLATFORM_H"
- before including "microhttpd.h". Then the following "standard"
- includes won't be used (which might be a good idea, especially
- on platforms where they do not exist).
+/* If generic headers don't work on your platform, include headers which define
+ 'va_list', 'size_t', 'uint_fast16_t', 'uint_fast32_t', 'uint_fast64_t',
+ 'struct sockaddr', and then "#define MHD_HAVE_SYS_HEADERS_INCLUDED" before
+ including "microhttpd2.h".
+ When 'MHD_HAVE_SYS_HEADERS_INCLUDED' is defined the following "standard"
+ includes won't be used (which might be a good idea, especially on platforms
+ where they do not exist).
*/
-#ifndef MHD_PLATFORM_H
-#include <stdarg.h>
-#include <stdint.h>
-#include <sys/types.h>
-#if defined(_WIN32) && ! defined(__CYGWIN__)
-#include <ws2tcpip.h>
-#else
-#include <unistd.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#endif
-#endif
-
-#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET)
-/* Do not define __USE_W32_SOCKETS under Cygwin! */
-#error Cygwin with winsock fd_set is not supported
+#ifndef MHD_HAVE_SYS_HEADERS_INCLUDED
+# include <stdarg.h>
+# ifndef MHD_SYS_BASE_TYPES_H
+ /* Headers for uint_fastXX_t, size_t */
+# include <stdint.h>
+# include <stddef.h>
+# include <sys/types.h>
+# endif
+# ifndef MHD_SYS_SOCKET_TYPES_H
+ /* Headers for 'struct sockaddr' */
+# if !defined(_WIN32) || defined(__CYGWIN__)
+# include <sys/socket.h>
+# else
+ /* Prevent conflict of <winsock.h> and <winsock2.h> */
+# if !defined(_WINSOCK2API_) && !defined(_WINSOCKAPI_)
+# ifndef WIN32_LEAN_AND_MEAN
+ /* Do not use unneeded parts of W32 headers. */
+# define WIN32_LEAN_AND_MEAN 1
+# endif /* !WIN32_LEAN_AND_MEAN */
+# include <winsock2.h>
+# endif
+# endif
+# endif
#endif
#ifndef __cplusplus
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 171/335: mhd_socket_type.h: new internal header, renamed MHD_socket -> MHD_Socket, (continued)
- [libmicrohttpd] 171/335: mhd_socket_type.h: new internal header, renamed MHD_socket -> MHD_Socket, gnunet, 2024/07/27
- [libmicrohttpd] 186/335: GENERATED: guard header double inclusion, gnunet, 2024/07/27
- [libmicrohttpd] 178/335: microhttpd2_portability.h: dropped wrong comment, gnunet, 2024/07/27
- [libmicrohttpd] 168/335: mhd_sys_options.h: use function attribute "used", gnunet, 2024/07/27
- [libmicrohttpd] 188/335: GENERATED: use proper includes in .c, gnunet, 2024/07/27
- [libmicrohttpd] 180/335: microhttpd2_portability.h: simplified macros for MHD_EXTERN_, gnunet, 2024/07/27
- [libmicrohttpd] 187/335: GENERATED: use proper includes in headers, gnunet, 2024/07/27
- [libmicrohttpd] 172/335: sys_base_types.h: new internal header, gnunet, 2024/07/27
- [libmicrohttpd] 192/335: GENERATED: check the state before using the options, gnunet, 2024/07/27
- [libmicrohttpd] 184/335: GENERATED: fixed License version, gnunet, 2024/07/27
- [libmicrohttpd] 179/335: microhttpd2_portability.h: lowered scope of included system headers, minor refactoring,
gnunet <=
- [libmicrohttpd] 173/335: sys_bool_type.h: new internal header, gnunet, 2024/07/27
- [libmicrohttpd] 196/335: GENERATED: copy some temporal pointers, gnunet, 2024/07/27
- [libmicrohttpd] 175/335: mhd_sys_options.h: improved doxy, gnunet, 2024/07/27
- [libmicrohttpd] 181/335: microhttpd2_portability.h: added FIXME comments, gnunet, 2024/07/27
- [libmicrohttpd] 195/335: GENERATED: use pointer for the daemon settings, gnunet, 2024/07/27
- [libmicrohttpd] 198/335: This API is even more *TERRIBLE*, gnunet, 2024/07/27
- [libmicrohttpd] 201/335: configure: added detection of the binary format of NULL pointers, gnunet, 2024/07/27
- [libmicrohttpd] 183/335: configure: fixed configuration summary, gnunet, 2024/07/27
- [libmicrohttpd] 197/335: GENERATED: use logger directly, gnunet, 2024/07/27
- [libmicrohttpd] 204/335: configure: improved checks for function name magic-macros, gnunet, 2024/07/27