]> granicus.if.org Git - curl/commitdiff
Provide a socklen_t definition in curl.h for Win32 API build targets
authorYang Tse <yangsita@gmail.com>
Thu, 22 Nov 2007 16:35:07 +0000 (16:35 +0000)
committerYang Tse <yangsita@gmail.com>
Thu, 22 Nov 2007 16:35:07 +0000 (16:35 +0000)
which don't have one.

CHANGES
RELEASE-NOTES
include/curl/curl.h

diff --git a/CHANGES b/CHANGES
index 1dbf53215664ca8a07d2f53d7b36c8df61e1e4de..3882b35320767cfe17ec50653c8233f866d7df57 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,10 @@
                                   Changelog
 
 
+Yang Tse (22 Nov 2007)
+- Provide a socklen_t definition in curl.h for Win32 API build targets
+  which don't have one.
+
 Daniel S (22 Nov 2007)
 - Alessandro Vesely helped me improve the --data-urlencode's syntax, parser
   and documentation.
index eb85cd7c4dc3e3a7ad890bf60d581dc7fe41f3a9..3ba305f8fef9856104cb9698027dfb519f5dba95 100644 (file)
@@ -26,6 +26,7 @@ This release includes the following bugfixes:
  o SSL connections with NSS done with the multi-interface
  o setting a share no longer activates cookies
  o Negotiate now works on auth and proxy simultanouesly
+ o curl.h now includes a socklen_t definition for Win32 API build targets
 
 This release includes the following known bugs:
 
index 79ea49752b21ef88ca1471bdcd6c48a281ce1d9c..83028928aad3c89fb3ea924700c71cfe2ea6388c 100644 (file)
@@ -85,6 +85,23 @@ extern "C" {
 
 typedef void CURL;
 
+/*
+ * Windows build targets have socklen_t definition in
+ * ws2tcpip.h but some versions of ws2tcpip.h do not
+ * have the definition. It seems that when the socklen_t
+ * definition is missing from ws2tcpip.h the definition
+ * for INET_ADDRSTRLEN is also missing, and that when one
+ * definition is present the other one also is available.
+ */
+
+#if defined(WIN32) && !defined(HAVE_SOCKLEN_T)
+#  if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \
+      (!defined(_MSC_VER) && !defined(_WS2TCPIP_H_) && !defined(_WS2TCPIP_H) )
+#    define socklen_t int
+#    define HAVE_SOCKLEN_T
+#  endif
+#endif
+
 /*
  * Decorate exportable functions for Win32 DLL linking.
  * This avoids using a .def file for building libcurl.dll.