view Resources/Patches/glog-port-h-v2.diff @ 1380:31b884468b05

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 29 May 2015 13:23:54 +0200
parents d0bb3dd34e2d
children 0d9812893262
line wrap: on
line source

124a125,149
> 
> #if HAVE_SECURE_STRING_EXTENSIONS == 0
> // Emulation of "localtime_s" and "strerror_s" for old versions of MinGW
> inline int localtime_s(tm * _tm, const time_t * time)
> {
>   tm * posix_local_time_struct = localtime(time);
>   if (posix_local_time_struct == NULL) 
>   {
>     return 1;
>   }
> 
>   *_tm = *posix_local_time_struct;
> 
>   return 0;
> }
> 
> inline char* strerror_s(char* buf, size_t buflen, int errnum) 
> {
>   const char* str = strerror(errnum);
>   return strncpy(buf, str, buflen - 1);
> }
> #endif
> 
> 
> #if !defined(__MINGW32__) || HAVE_SECURE_STRING_EXTENSIONS == 0
135a161,162
> #endif
>