cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Re: [PATCH, RFC] Make hostthre.c work on POSIX

From: Yang Tse <yangsita_at_gmail.com>
Date: Mon, 9 Nov 2009 17:03:21 +0100

2009/11/8, Constantine Sapuntzakis wrote:

> Attached is a new full diff:
> thread-v5.diff.gz

> +/* to get defines for error-checking mutexes */
> +#define _XOPEN_SOURCE 500
> +
> +/* Needed for NI_MAXSERV - default normally but _XOPEN_SOURCE disables it*/
> +#ifdef __APPLE__
> +# define _DARWIN_C_SOURCE
> +#else
> +# define _BSD_SOURCE
> +#endif
> +
> #include "setup.h"

These lines in the hostthre.c patch part are contrary to the libcurl
configuration and build philosophy. Nothing allowed before the
inclusion of setup.h in any general purpose source file. If the file
were specific to a single OS that statement could be relaxed, but this
is not the case.

And now all the 'fun' that is related with this.

If for any reason a preprocessor symbol such as _XOPEN_SOURCE which
changes the behavior of system header files and on some OS even
modifies which libraries should be linked must be defined, then the
definition must be done in lib/setup.h immediately below or above
where _REENTRANT might be defined.

Additionally the configure script must check if there is a reason to
define such preprocessor symbol to be defined when the library is
finally built.

Since the definition of this preprocessor symbol invalidates nearly
all checks that the configure script could have done up to that point,
and that autoconf does not support a multi-pass configuration concept,
it becomes necessary that the check is done before the definitive
definitions of function availability are done for the library. Take in
account that if the symbol is going to be defined when building the
library it must also be defined while performing the configuration
tests, otherwise configuration results won't be accurate and all sorts
of funny things will start happening.

So, before making further considerations of what should be done and
specifically how should we do it, please try to remove the statements
above the setup.h inclusion directive, and what is more important
evaluate if definition of _XOPEN_SOURCE is actually going to be needed
in some cases or if all this could be done without libcurl's setup.h
having to define it.

Cheers,

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-09

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET