cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: HAVE_SYS_SELECT_H, HAVE_STRDUP, and port to an RTOS

From: Rolland Dudemaine <rolland_at_ghs.com>
Date: Wed, 25 Jun 2008 10:42:56 +0200

/>> Here are 3 patches that were necessary to make this work. /

/>> The first 2 are actually legit improvements to the code I think, the /
/>> last one doesn't hurt : /
/>> - curl-7.18.2_sys_select.diff : autoconf has a macro to define whether /
/>> sys/select.h is available, which is HAVE_SYS_SELECT_H. Adding it to
the /
/>> list helps, and should not harm existing systems. /

/>> diff -ur curl-7.18.2/include/curl/curl.h
curl-7.18.2-new/include/curl/curl.h /
/>> --- curl-7.18.2/include/curl/curl.h 2008-06-04 17:36:10.000000000
+0200 /
/>> +++ curl-7.18.2-new/include/curl/curl.h 2008-06-24
14:22:16.000000000 +0200 /
/>> @@ -64,7 +64,7 @@ /
/>> libc5-based Linux systems. Only include it on system that are known to /
/>> require it! */ /
/>> #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__)
|| \ /
/>> - defined(__minix) || defined(__SYMBIAN32__) /
/>> + defined(__minix) || defined(__SYMBIAN32__) || HAVE_SYS_SELECT_H /
/>> #include <sys/select.h> /
/>> #endif /

> The comment above this patch implies that sys/select.h shouldn't be
included
> on all systems (presumably, because it's either not needed or causes
> problems). Also, HAVE_* macros aren't available in curl.h so it couldn't
> even be done if it made sense. It's probably best to just add a macro
> specific to INTEGRITY there instead.

I didn't realize curl.h was going in the standard distribution headers
indeed.
you can safely change HAVE_SYS_SELECT_H in the patch to
defined(__INTEGRITY) and things work the same.

/>> - curl-7.18.2_strdup.diff : src/setup.h already optionally include the /
/>> local strdup.h when strdup() is not available globally in the system. /
/>> The same include should be added in lib/setup.h /
/>> /
/>> diff -ur curl-7.18.2/lib/setup.h curl-7.18.2-new/lib/setup.h /
/>> --- curl-7.18.2/lib/setup.h 2008-04-23 22:07:52.000000000 +0200 /
/>> +++ curl-7.18.2-new/lib/setup.h 2008-06-24 15:06:38.000000000 +0200 /
/>> @@ -366,6 +366,11 @@ /
/>> #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") /
/>> #endif /
/>> /
/>> +#ifndef HAVE_STRDUP /
/>> +#include "strdup.h" /
/>> +#define strdup(ptr) curlx_strdup(ptr) /
/>> +#endif /
/>> + /
/>> /* /
/>> * Include macros and defines that should only be processed once. /
/>> */ /

> strdup should already be taken care of. It's defined as a macro in both
> memory.h and memdebug.h, depending on the debugging mode, and always
points
> to a definition that exists. Line 193 of easy.c points to curlx_strdup.
> Where does this fail you?

Actually, this looks like this was a remaining of the port. I did a
fresh install from sources, applied the two other patches, and it
compiles and runs fine now.
So, you can forget about this one.

//

--Rolland

PS : double posting purposedly because I can't seem to be able to subscribe to curl-library.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-06-25