Ethereal-dev: Re: [Ethereal-dev] text2pcap.c: strptime

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Wed, 30 Jan 2002 02:39:33 -0800
On Tue, Jan 29, 2002 at 03:40:48PM -0600, Gilbert Ramirez wrote:
> Unfortunately, this alone doesn't work for glibc.  glibc requires
> the use of __USE_XOPEN in order to declare strptime().
> (I tried it). It looks like we should defien both _XOPEN_SOURCE
> and __USE_XOPEN.

Unfortunately, defining _XOPEN_SOURCE, at least on Solaris 7, means that
"struct timeval" isn't defined (after all, it's not in whatever version
of the X/Open spec Solaris 7 claims to conform to).

Defining just __USE_XOPEN seems to do the trick, at least on my Debian
partition (and not defining it causes "strptime()" not to be defined),
so that's I checked in.  Prior to that, I checked in something that also
defines __EXTENSIONS__, which enables such Nasty Namespace Polluting
Extensions as "struct timeval" even if _XOPEN_SOURCE is defined; if on
any platform you *must* define _XOPEN_SOURCE (and can't use any other
scheme), we could revert to that.

I'll try building on Digital UNIX and HP-UX at work tomorrow.