------- Comment #7 from ktietz at gcc dot gnu dot org 2010-03-05 10:34 ------- (In reply to comment #6)
As by this patch libgfortran.h defines _POSIX, some additional features (at least for mingw-w64) getting active about localtime_r and gmtime_r (which getting implemented by defines, if _POSIX is defined). So the following patch is getting necessary too. Index: gcc/libgfortran/intrinsics/date_and_time.c =================================================================== --- gcc.orig/libgfortran/intrinsics/date_and_time.c 2009-06-22 09:43:32.000000000 +0200 +++ gcc/libgfortran/intrinsics/date_and_time.c 2010-03-05 11:14:39.200103300 +0100 @@ -55,6 +55,11 @@ see the files COPYING3 and COPYING.RUNTI thread-local storage so they are threadsafe. */ #ifndef HAVE_LOCALTIME_R +/* If _POSIX is defined localtime_r gets defined by mingw-w64 headers. */ +#ifdef localtime_r +#undef localtime_r +#endif + static struct tm * localtime_r (const time_t * timep, struct tm * result) { @@ -64,6 +69,11 @@ localtime_r (const time_t * timep, struc #endif #ifndef HAVE_GMTIME_R +/* If _POSIX is defined gmtime_r gets defined by mingw-w64 headers. */ +#ifdef gmtime_r +#undef gmtime_r +#endif + static struct tm * gmtime_r (const time_t * timep, struct tm * result) { -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42950