Skip to content
  • Stefan Weil's avatar
    w32: Add implementation of gmtime_r, localtime_r · d3e8f957
    Stefan Weil authored
    
    
    Those functions are missing in MinGW.
    
    Some versions of MinGW-w64 include defines for gmtime_r and localtime_r.
    Older versions of these macros are buggy (they return a pointer to a
    static variable), therefore we don't want them. Newer versions are
    similar to the code used here, but without the memset.
    
    The implementation which is used here is not strictly reentrant,
    but sufficiently good for QEMU on w32 or w64.
    
    Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
    [blauwirbel@gmail.com: added comment about locking]
    Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
    d3e8f957