This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch libgfortran]: Fix build of libgfortran for mingw and improve POSIX ctime_r implementation


On Sat, Jan 29, 2011 at 18:57, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> recent changes lead to a build failure for mingw targets in gfortran.
> Following patch solves this.
>
> ChangeLog
>
> 2011-01-29 ÂKai Tietz
>
> Â Â Â Â* intrinsics/ctime.c (ctime_r): Improve implementation.
>
> Tested for x86_64-w64-mingw32. Ok for apply?

Ok, thanks for the patch!

>
> Regards,
> Kai
>
> Index: intrinsics/ctime.c
> ===================================================================
> --- intrinsics/ctime.c Â(revision 169388)
> +++ intrinsics/ctime.c Â(working copy)
> @@ -42,11 +42,17 @@
>
>
> Â#ifndef HAVE_CTIME_R
> +/* Make sure we don't see here a macro. Â*/
> +#undef ctime_r
> +
> Âstatic char *
> Âctime_r (const time_t * timep, char * buf __attribute__((unused)))
> Â{
> Â#ifdef HAVE_CTIME
> - Âreturn ctime (timep);
> + Âchar *tmp = ctime (timep);
> + Âif (tmp)
> + Â Âtmp = strcpy (buf, tmp);
> + Âreturn tmp;
> Â#else
> Â return NULL;
> Â#endif
>



-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]