[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: minor problem with util-int.c v1.19



At 02:02 PM 3/8/00 , Kurt Zeilenga wrote:
At 01:15 PM 3/8/00 -0600, Phil Tracy wrote:
>I'm compiling the latest (as of 3/8/00 9:00 AM) collection of stuff from
>CVS on HP/UX 10.20 with gcc 2.95.2.  I had to add
>
>      extern int h_errno;
>
>to ~pkg/ldap/libraries/libldap/util-int.c (version 1.19) in order to get it
>to compile properly.  All the tests pass, but I haven't done more testing
>than that.

Adding explicit externs to .c files is not wise as they may
conflict with those contained in system headers.

Does <netdb.h> or other header provide an extern for h_errno?
If not, we'll have to write a macro to detect the lack of an
h_errno extern, define a macro and conditionally provide an
extern (in include/ac/socket.h).

As a matter of fact it does, though it's surrounded by an #ifdef:

   #ifdef _XOPEN_SOURCE_EXTENDED
   extern int h_errno;
   #endif

There are several other things that seem to depend on the opposite setting for _XOPEN_SOURCE_EXTENDED, though; for instance:

   #ifndef _XOPEN_SOURCE_EXTENDED
   #ifdef _REENTRANT
   struct  hostent_data {
      ...
   }
   ...
   #endif
   #endif

And nearly the entire netdb.h file is wrapped by

   #ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED

This is fast getting beyond my knowledge of HP/UX, but I'd be happy to provide copies of man pages and/or .h files if it would help someone else puzzle this out.

Is this why many vendors are reluctant to support threads on HP platforms? It looks like a pain in the butt. When I have a chance, I'll try building this on an HP/UX 11 system and see if it's any different.