gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] Build broken for non-QT


From: Greg Troxel
Subject: Re: [gpsd-users] Build broken for non-QT
Date: Tue, 13 Jan 2015 10:22:15 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.4 (berkeley-unix)

"O'Connor, Daniel" <address@hidden> writes:

> diff --git a/gpsutils.c b/gpsutils.c
> index 1564131..c049bf5 100644
> --- a/gpsutils.c
> +++ b/gpsutils.c
> @@ -25,6 +25,11 @@
>  #ifdef USE_QT
>  #include <QDateTime>
>  #include <QStringList>
> +#else
> +/* XXX: The use of _XOPEN_SOURCE causes timegm() to not be declared */
> +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
> +time_t timegm(struct tm * const);
> +#endif
>  #endif
>  
>  /*
> @@ -352,7 +357,12 @@ timestamp_t iso8601_to_unix( /address@hidden@*/ char 
> *isotime)
>       usec = strtod(dp, NULL);
>      else
>       usec = 0;
> +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
> +    /* *BSD lacks timezone from SUS03 but has timegm() */
> +    return (timestamp_t)timegm(&tm) + usec;
> +#else
>      return (timestamp_t)mktime(&tm) - timezone + usec;
> +#endif
>  #else
>      double usec = 0;
>  

What revision is broken?  I am doing non-qt builds on NetBSD all the
time.

If the problem is that FreeBSD fails to define timegm as required by
POSIX, then there should be a FreeBSD-specific workaround.

Attachment: pgpqMwHMBRHDQ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]