summaryrefslogtreecommitdiffstats
path: root/libgfortran/intrinsics/date_and_time.c
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-08 08:01:55 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-08 08:01:55 +0000
commit9e09cd236ce2be94ed828668c2925a25ce81616d (patch)
tree54205f64411c22ef87b871e28f9f42f5c3d81cd5 /libgfortran/intrinsics/date_and_time.c
parenta391f3306a233b998286c7dc68d8d4e8391aba52 (diff)
downloadppe42-gcc-9e09cd236ce2be94ed828668c2925a25ce81616d.tar.gz
ppe42-gcc-9e09cd236ce2be94ed828668c2925a25ce81616d.zip
2010-03-08 Kai TIetz <kai.tietz@onevision.com>
PR/42950 * libgfortran.h (_POSIX): Define if __MINGW32__ is defined. (gfc_printf): Define to gnu_printf for __MINGW32__ case, otherwise to __printf__. (gfc_strtof,gfc_strtod,gfc_strtold): Define for mingw case to POSIX compatible converter functions. (runtime_error): Use instead gfc_printf as formatter attribute name. (runtime_error_at): Likewise. (runtime_warning_at): Likewise. (st_printf): Likewise. * intrinsics/date_and_time.c (localtime_r): Undefine possible defined macro. (gmtime_r): Likewise. * io/read.c (convert_real): Use gfc_strtof, gfc_strtod, and gfc_strtold. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157271 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics/date_and_time.c')
-rw-r--r--libgfortran/intrinsics/date_and_time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c
index 4bc6e6928c0..a3f39a76d5b 100644
--- a/libgfortran/intrinsics/date_and_time.c
+++ b/libgfortran/intrinsics/date_and_time.c
@@ -55,6 +55,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
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, struct tm * result)
#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)
{
OpenPOWER on IntegriCloud