cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Many linker warnings regarding ws2tcpip.h and its inline functions.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 5 Oct 2015 21:43:17 +0200 (CEST)

On Thu, 1 Oct 2015, Thorsten Schöning wrote:

> Any thoughts again?

Yes, but only a rather simple thought. This is a mighty complicated #if
expression!

>> +#if (!defined(__SALFORDC__) && \
>> + !defined(__CODEGEARC__)) || \
>> + ( defined(__CODEGEARC__) && \
>> + defined(__cplusplus) && \
>> + (__CODEGEARC__ >= 0x0660))
>> #define HAVE_WS2TCPIP_H 1
>> #endif

Can we turn it into an unconditional define first, and then check for the
particular compiler condition that would then undefine it? I think that will
make it a simpler expression that is easier to read and document in a comment.

Something like the following, although I'm just guessing:

#define HAVE_WS2TCPIP_H 1

/* in old Codegear C, the file doesn't exist */
#if defined(__CODEGEARC__) && (__CODEGEARC__ < 0x0660)
#undef HAVE_WS2TCPIP_H
#endif

-- 
  / daniel.haxx.se

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-10-05