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.
This commit is contained in:
Yang Tse
2007-11-06 17:18:27 +00:00
parent 66e4d391d3
commit 775b60fa09
3 changed files with 44 additions and 37 deletions

View File

@@ -6,6 +6,12 @@
Changelog Changelog
Yang Tse (6 Nov 2007)
- 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.
Daniel S (1 Nov 2007) Daniel S (1 Nov 2007)
- Toby Peterson patched a memory problem in the command line tool that - Toby Peterson patched a memory problem in the command line tool that
happened when a user had a home dir as an empty string. curl would then do happened when a user had a home dir as an empty string. curl would then do

View File

@@ -17,6 +17,7 @@ This release includes the following bugfixes:
o curl-config --features and --protocols show the correct output when built o curl-config --features and --protocols show the correct output when built
with NSS, and also when SCP, SFTP and libz are not available with NSS, and also when SCP, SFTP and libz are not available
o free problem in the curl tool for users with empty home dir o free problem in the curl tool for users with empty home dir
o curl.h version 7.17.1 problem when building C++ apps with MSVC
This release includes the following known bugs: This release includes the following known bugs:

View File

@@ -41,12 +41,48 @@
# include <time.h> # include <time.h>
#endif /* defined (vms) */ #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 #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef void CURL;
/* /*
* Decorate exportable functions for Win32 DLL linking. * Decorate exportable functions for Win32 DLL linking.
* This avoids using a .def file for building libcurl.dll. * This avoids using a .def file for building libcurl.dll.
@@ -139,38 +175,6 @@ extern "C" {
#undef FILESIZEBITS #undef FILESIZEBITS
#endif #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 #ifndef curl_socket_typedef
/* socket typedef */ /* socket typedef */
#ifdef WIN32 #ifdef WIN32
@@ -1241,10 +1245,6 @@ typedef enum {
CURL_TIMECOND_LAST CURL_TIMECOND_LAST
} curl_TimeCond; } curl_TimeCond;
#ifdef __BEOS__
#include <support/SupportDefs.h>
#endif
/* curl_strequal() and curl_strnequal() are subject for removal in a future /* curl_strequal() and curl_strnequal() are subject for removal in a future
libcurl, see lib/README.curlx for details */ libcurl, see lib/README.curlx for details */