cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: make error

From: Bjorn Reese <breese_at_mail1.stofanet.dk>
Date: Wed, 22 Mar 2000 18:38:06 +0000

Michi 'Witty' wrote:

I suspect it is an error in the AIX include files not to make
the definition of both id_t and getpriority dependent on the
_XOPEN_SOURCE_EXTENDED macro.

> whatfor is the _XOPEN_SOURCE_EXTENDED macro?

There are several Unix standards, such as POSIX, SVR4, and XPG4, and
most of the _SOURCE macros are used to specify which of the different
standards you wants to use.

_XOPEN_SOURCE_EXTENDED == 1 refers to XPG4v2, also is known as UNIX98
or the Single Unix Specification version 2. UNIX98 is the successor of
POSIX, which hitherto has been the most widely accepted standard in
Unixland (POSIX has lost a lot of momentum in the recent years -- could
this be related to the fact that the chairman of POSIX is an Microsoft
employee, or am I just being paranoid?).

Defining _XOPEN_SOURCE_EXTENDED globally is definitely not a good
workaround as it, amoungst others, will start using the XTI socket
API rather than the BSD socket API that cURL relies on. I concur with
you and Daniel that _NO_PROTO is most likely a good workaround.
Another possibility could be to define _ALL_SOURCE globally instead.
Yet another possibility is to define _XOPEN_SOURCE_EXTENDED locally.
For instance,

#if defined(AIX) /* Ugly hack */
#if defined(_XOPEN_SOURCE_EXTENDED)
#define TMP_XOPEN_SOURCE_EXTENDED _XOPEN_SOURCE_EXTENDED
#undef _XOPEN_SOURCE_EXTENDED
#endif
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/types.h>
#undef _XOPEN_SOURCE_EXTENDED
#if defined(TMP_XOPEN_SOURCE_EXTENDED)
#define _XOPEN_SOURCE_EXTENDED TMP_XOPEN_SOURCE_EXTENDED
#undef TMP_XOPEN_SOURCE_EXTENDED
#endif
#endif
#include <sys/resource.h>

Unfortunately this gives us a lot of preprocessor gymnastics, just
because some engineer at IBM forgot to make his work consistant.
Received on 2000-03-22