Changeset c84e332e33cce35369272ed4c42fa8d62f97615f

Show
Ignore:
Timestamp:
11/09/06 19:06:21 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1163095581 +0000
git-parent:

[9020d59c74c88e6a6b0e2665e2d620368b5d34fd]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1163095581 +0000
Message:

Add a bug. Fix compilation on Win32.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_filter/dump.c

    raa55b21 rc84e332  
    234234 
    235235 
    236 #ifdef WIN32 
     236#ifndef HAVE_LOCALTIME_R 
    237237static inline struct tm *localtime_r (const time_t *now, struct tm *res) 
    238238{ 
    239     return _localtime_s (res, now) ? NULL : res; 
     239    struct tm *unsafe = localtime (now); 
     240    /* 
     241     * This is not thread-safe. Blame your C library. 
     242     * On Win32 there SHOULD be _localtime_s instead, but of course 
     243     * Cygwin and Mingw32 don't know about it. You're on your own if you 
     244     * this platform. 
     245     */ 
     246    if (unsafe == NULL) 
     247        return NULL; 
     248 
     249    memcpy (res, unsafe, sizeof (*res)); 
     250    return res; 
    240251} 
    241252#endif