gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]