cURL / Mailing Lists / curl-library / Single Mail

curl-library

MSVC compile funness

From: codemastr <codemstr_at_ptd.net>
Date: Mon, 8 Mar 2004 13:24:06 -0500

Someone messed up the MSVC stuff.

7.11.0 connect.c line 67 is "#define HAVE_IOCTLSOCKET"
That line is gone in 7.11.1pre1
<http://cvs.php.net/diff.php/curl/lib/connect.c?r1=1.77&r2=1.78&ty=h>

It seems Andrés García's fix for mingw removed it. I don't know how exactly
to solve this without again breaking mingw, but without it, MSVC is broken.
Without that line, it won't compile on MSVC since SETBLOCK is then #undef'ed
which generates an #error.

I'd submit a patch for this, but I don't know which compilers need these
changes made. Something tells me that the HAVE_IOCTLSOCKET line was removed
since it breaks mingw, so I assume if I just readded it, I'd be fixing one
compiler and breaking another.

Then on to warnings:
transfer.c(515) : warning C4244: 'function' : conversion from 'curl_off_t'
to 'double', possible loss of data
http.c(1262) : warning C4244: 'initializing' : conversion from 'curl_off_t'
to 'size_t', possible loss of data
hostip.c(1175) : warning C4013: 'getenv' undefined; assuming extern
returning int
getdate.y(695) : warning C4028: formal parameter 1 different from
declaration

The getenv one is interesting. Though MSVC has stdlib.h, it is in an #if
!defined(WIN32) type thing in hostip.c. A small patch is attached to solve
this. The other warnings, well I really don't know much about the largefile
stuff so I'm just going to leave those alone if someone else wants to take a
look, feel free.

Dominick Meglio.

Received on 2004-03-08