aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-11-06 17:18:27 +0000
committerYang Tse <yangsita@gmail.com>2007-11-06 17:18:27 +0000
commit775b60fa09c335451e01fef9d7e327afbb0dff8f (patch)
treeccceb939b523bec0123d8afece33ee6878df21ff /include
parent66e4d391d3040df1e8d810f134adb02a4e5b8a20 (diff)
Bug report #1824894 (http://curl.haxx.se/bug/view.cgi?id=1824894) pointed
out a problem in curl.h when building C++ apps with MSVC. To fix it, the inclusion of header files in curl.h is moved outside of the C++ extern "C" linkage block.
Diffstat (limited to 'include')
-rw-r--r--include/curl/curl.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 6a7a71963..a29476017 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -41,12 +41,48 @@
# include <time.h>
#endif /* defined (vms) */
-typedef void CURL;
+#if defined(_WIN32) && !defined(WIN32)
+/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we
+ make this adjustment to catch this. */
+#define WIN32 1
+#endif
+
+#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
+ !defined(__CYGWIN__) || defined(__MINGW32__)
+#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
+/* The check above prevents the winsock2 inclusion if winsock.h already was
+ included, since they can't co-exist without problems */
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#else
+
+/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
+ libc5-based Linux systems. Only include it on system that are known to
+ require it! */
+#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
+#include <sys/select.h>
+#endif
+
+#ifndef _WIN32_WCE
+#include <sys/socket.h>
+#endif
+#ifndef __WATCOMC__
+#include <sys/time.h>
+#endif
+#include <sys/types.h>
+#endif
+
+#ifdef __BEOS__
+#include <support/SupportDefs.h>
+#endif
#ifdef __cplusplus
extern "C" {
#endif
+typedef void CURL;
+
/*
* Decorate exportable functions for Win32 DLL linking.
* This avoids using a .def file for building libcurl.dll.
@@ -139,38 +175,6 @@ extern "C" {
#undef FILESIZEBITS
#endif
-#if defined(_WIN32) && !defined(WIN32)
-/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we
- make this adjustment to catch this. */
-#define WIN32 1
-#endif
-
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
- !defined(__CYGWIN__) || defined(__MINGW32__)
-#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
-/* The check above prevents the winsock2 inclusion if winsock.h already was
- included, since they can't co-exist without problems */
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-#else
-
-/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
- libc5-based Linux systems. Only include it on system that are known to
- require it! */
-#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
-#include <sys/select.h>
-#endif
-
-#ifndef _WIN32_WCE
-#include <sys/socket.h>
-#endif
-#ifndef __WATCOMC__
-#include <sys/time.h>
-#endif
-#include <sys/types.h>
-#endif
-
#ifndef curl_socket_typedef
/* socket typedef */
#ifdef WIN32
@@ -1241,10 +1245,6 @@ typedef enum {
CURL_TIMECOND_LAST
} curl_TimeCond;
-#ifdef __BEOS__
-#include <support/SupportDefs.h>
-#endif
-
/* curl_strequal() and curl_strnequal() are subject for removal in a future
libcurl, see lib/README.curlx for details */