[vlc-devel] EPG on Win32 (#ifdef HAVE_LOCALTIME_R)

Marian Ďurkovič md at bts.sk
Wed Aug 19 08:44:41 CEST 2009

On Wed, Aug 19, 2009 at 08:32:37AM +0200, Rémi Denis-Courmont wrote:
> On Wed, 19 Aug 2009 08:08:38 +0200, Marian Ďurkovič <md at bts.sk> wrote:
> > #if defined (HAVE_LOCALTIME_R) || defined (WIN32)
> > 
> > What do you think?
> I think we don't care about hopeless platforms lacking both localtime_r()
> and a thread-safe localtime().

Sure, I'm also doing all testing on Linux :-) But unfortunately, the users
here typically have win on their workstations...

> The #ifdef should not be needed at all since localtime_r() is implemented
> in compat/

Good, could you please remove it then?

BTW, shouldn't the localtime_r in compat/ actually use memcpy, i.e. look
like this:

struct tm *localtime_r (const time_t *timep, struct tm *result)
    struct tm *s = localtime (timep);
    if (s == NULL || result == NULL)
        return NULL;

    memcpy(result, s, sizeof(result));
    return result;

    Thanks & kind regards,


More information about the vlc-devel mailing list