# HG changeset patch # User Sebastien Jodogne # Date 1432897183 -7200 # Node ID d0bb3dd34e2dd95295b3d6e7b09f6f36e1d0faab # Parent 5dabfaf6034b35a4c3760f24a1efd39f5012f7d9 find build on old versions of MinGW diff -r 5dabfaf6034b -r d0bb3dd34e2d Resources/CMake/GoogleLogConfiguration.cmake --- a/Resources/CMake/GoogleLogConfiguration.cmake Fri May 29 11:57:53 2015 +0200 +++ b/Resources/CMake/GoogleLogConfiguration.cmake Fri May 29 12:59:43 2015 +0200 @@ -166,3 +166,11 @@ link_libraries(glog) endif() + + +CHECK_INCLUDE_FILES(sec_api/string_s.h HAVE_SECURE_STRING_EXTENSIONS) +if (HAVE_SECURE_STRING_EXTENSIONS) + add_definitions(-DHAVE_SECURE_STRING_EXTENSIONS=1) +else() + add_definitions(-DHAVE_SECURE_STRING_EXTENSIONS=0) +endif() diff -r 5dabfaf6034b -r d0bb3dd34e2d Resources/Patches/glog-port-h-v2.diff --- a/Resources/Patches/glog-port-h-v2.diff Fri May 29 11:57:53 2015 +0200 +++ b/Resources/Patches/glog-port-h-v2.diff Fri May 29 12:59:43 2015 +0200 @@ -1,4 +1,29 @@ -124a125 +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__) -135a137 +135a161,162 > #endif +>