|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker mailing list Archives
[ curl-Bugs-1824894 ] Recent addition of ws2tcpip.h to curl.h breaks C++ apps
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 02 Nov 2007 14:18:45 -0700
Bugs item #1824894, was opened at 2007-11-02 17:18
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
That header pulls in the Microsoft header <wspiapi.h> at the bottom of the file. That in turn includes an actual C++ template (do NOT ask me why) and because curl.h is wrapping itself in extern "C", that breaks the build with this error:
c:\program files\microsoft visual studio 8\vc\platformsdk\include\wspiapi.h(44) : error C2894: templates cannot be declared to have 'C' linkage
I think the fix for this is to stop wrapping the #includes in curl.h inside the extern "C" block. When you pull in headers, you really should refrain from assuming it's C linkage in case somebody does something like this.
You'll need to carefully wrap your own declarations in the extern "C" block, but pull in headers outside them. This will take quite a bit of testing, I suspect.
Another possibility MIGHT be to refrain from including that ws2tcpip.h header on anything other than the old VS6 compiler, but that may be more trouble, I didn't follow the socklen issue closely.
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info