curl-library
Re: [Patch] docs/examples/httpput.c
Date: Tue, 22 Oct 2013 21:46:24 +0200
On Tue, Oct 22, 2013 at 03:34:20PM +0200, Gisle Vanem wrote:
> Patch docs/examples/httpput.c for MSVC since it's missing <unistd.h>:
>
> --- Git-latest/docs/examples/httpput.c 2013-01-28 15:48:38 +0000
> +++ docs/examples/httpput.c 2013-10-09 11:54:26 +0000
> @@ -22,7 +22,9 @@
> #include <stdio.h>
> #include <fcntl.h>
> #include <sys/stat.h>
> -#include <unistd.h>
> +#ifndef _MSC_VER
> +# include <unistd.h>
> +#endif
>
> #include <curl/curl.h>
>
> ----------------
>
> But I'm not sure <unistd.h> is needed at all.
It's needed for close(2). But the only reason that's needed is because fstat
is used instead of stat(2); if you fix that, then you could remove that
include altogether.
>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-10-22