bug-gnulib
[Top][All Lists]
Advanced

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

Re: gettimeofday() for Win32


From: Paul Eggert
Subject: Re: gettimeofday() for Win32
Date: Fri, 02 Sep 2005 12:11:37 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Martin Lambers <address@hidden> writes:

> The patch is mostly a recombination of code written by Jim Meyering and
> Bruno Haible, so there should by no copyright problem when including
> this into gnulib.

Hmm, I suspect that it's enough extra work that we'll need papers from
you.  Would you be willing to assign the copyright to the Free Software
Foundation, so that we could install it in gnulib?

> +  if (tp != NULL)
> +    {
> +#ifdef _WIN32    
> +      struct _timeb timebuf;
> +      _ftime (&timebuf);
> +      tp->tv_sec = timebuf.time;
> +      tp->tv_usec = (long)(timebuf.millitm) * (1000000/1000);
> +#else    
> +      tp->tv_sec = time (NULL);
> +      tp->tv_usec = 0;
> +#endif
> +    }

You don't need to check whether tp is NULL.  Gettimeofday can assume
its first arg is NULL.

Assuming we can resolve the copyright issues it otherwise looks good to me.
(Though I can't comment on the Microsoft Windows stuff.)




reply via email to

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