mirror of git://gcc.gnu.org/git/gcc.git
PR 47802 Hack to work around draft POSIX localtime_r
From-SVN: r170680
This commit is contained in:
parent
d9d114ecd0
commit
7a9d7a4f86
|
|
@ -1,3 +1,9 @@
|
||||||
|
2011-03-04 Janne Blomqvist <jb@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR libfortran/47802
|
||||||
|
* intrinsics/ctime.c (strctime): Don't use return value of
|
||||||
|
localtime_r.
|
||||||
|
|
||||||
2011-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2011-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
PR libgfortran/47567
|
PR libgfortran/47567
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,13 @@ static size_t
|
||||||
strctime (char *s, size_t max, const time_t *timep)
|
strctime (char *s, size_t max, const time_t *timep)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
struct tm res;
|
struct tm ltm;
|
||||||
struct tm *ltm = localtime_r (timep, &res);
|
/* Note: We can't use the return value of localtime_r, as some
|
||||||
return strftime (s, max, "%c", ltm);
|
targets provide localtime_r based on a draft of the POSIX
|
||||||
|
standard where the return type is int rather than the
|
||||||
|
standardized struct tm*. */
|
||||||
|
localtime_r (timep, <m);
|
||||||
|
return strftime (s, max, "%c", <m);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue