This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch libgfortran]: Fix build of libgfortran for mingw and improve POSIX ctime_r implementation
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Fortran <fortran at gcc dot gnu dot org>
- Date: Sat, 29 Jan 2011 19:16:08 +0200
- Subject: Re: [patch libgfortran]: Fix build of libgfortran for mingw and improve POSIX ctime_r implementation
- References: <AANLkTikx7BpCr3aK8Tdzs=LOESJOe=vaWf-sHwQEo3a7@mail.gmail.com>
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