Re: Many linker warnings regarding ws2tcpip.h and its inline functions.
Date: Thu, 1 Oct 2015 15:40:00 +0200
Guten Tag Daniel Stenberg,
am Sonntag, 27. September 2015 um 22:58 schrieben Sie:
> That header file seems to treat your compiler wrong so I would submit an error
> report to the maintainer of that header file.
It looks like the headers are not very useful in their current
unmodified state for my compiler, but cURL always includes them
because of HAVE_WS2TCPIP_H, which I can't seem to unset or influence.
My current workaround is to copy the problematic headers into my
project, change them and version them with my project. This works.
But I would like to propose the attached patch which gives users like
me a bit more control: It checks for my problematic compiler and simply
doesn't define HAVE_WS2TCPIP_H anymore in that case. The only problem
is that without these headers one can't use IPv6 anymore, but that may
be fine for a lot of projects.
If one wants to use IPv6 and those headers instead, possibly using my
workaround, one simply needs to define HAVE_WS2TCPIP_H on the project
level manually to override the check of cURL. The important thing is
that we now have the chance to choose and my workaround is not
necessarily necessary anymore.
Any thoughts again?
> Index: config-win32.h
> --- config-win32.h (Revision 4088)
> +++ config-win32.h (Arbeitskopie)
> @@ -152,8 +152,14 @@
> #define HAVE_WINSOCK2_H 1
> -/* Define if you have the <ws2tcpip.h> header file. */
> -#ifndef __SALFORDC__
> +/* Define if you have the <ws2tcpip.h> header file and know it's working, e.g.
> + it doesn't produce warnings because of missing "__inline" operators, like
> + it's the case with __CODEGEARC__ under some circumstances. */
> +#if (!defined(__SALFORDC__) && \
> + !defined(__CODEGEARC__)) || \
> + ( defined(__CODEGEARC__) && \
> + defined(__cplusplus) && \
> + (__CODEGEARC__ >= 0x0660))
> #define HAVE_WS2TCPIP_H 1
Mit freundlichen Grüßen,
-- Thorsten Schöning E-Mail: Thorsten.Schoening_at_AM-SoFT.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...........05151- 9468- 55 Fax...............05151- 9468- 88 Mobil..............0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
- application/octet-stream attachment: config-win32.h.patch