# HG changeset patch # User J. Ali Harlow # Date 1467963224 -3600 # Node ID 772ff096a326737ce39c47966ef4e4c1427b861e # Parent 296eac3183bce5d812b77facb1ef69413f3cc894 Avoid Microsoft-specific localtime_s diff -r 296eac3183bc -r 772ff096a326 configure.ac --- a/configure.ac Fri Jul 08 08:26:29 2016 +0100 +++ b/configure.ac Fri Jul 08 08:33:44 2016 +0100 @@ -217,7 +217,7 @@ ################################################## # Checks for library functions. ################################################## -AC_CHECK_FUNCS_ONCE([fchdir fpathconf dirfd]) +AC_CHECK_FUNCS_ONCE([fchdir fpathconf dirfd localtime_r]) ################################################## # Checks for processor independent files. diff -r 296eac3183bc -r 772ff096a326 plover/log.c --- a/plover/log.c Fri Jul 08 08:26:29 2016 +0100 +++ b/plover/log.c Fri Jul 08 08:33:44 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 J. Ali Harlow + * Copyright (C) 2014, 2016 J. Ali Harlow * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -346,12 +346,12 @@ else { time(&t); -#ifdef WIN32 - localtime_s(&today,&t); - localtime_s(&modified,&sb.st_mtime); -#else +#if HAVE_LOCALTIME_R localtime_r(&t,&today); localtime_r(&sb.st_mtime,&modified); +#else + today=*localtime(&t); + modified=*localtime(&sb.st_mtime); #endif if (modified.tm_yday!=today.tm_yday || modified.tm_year!=today.tm_year) rotate_logfile(filename,&modified);