From patchwork Sat Jan 29 16:57:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 80941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C8A41B70F1 for ; Sun, 30 Jan 2011 03:57:26 +1100 (EST) Received: (qmail 16704 invoked by alias); 29 Jan 2011 16:57:22 -0000 Received: (qmail 16685 invoked by uid 22791); 29 Jan 2011 16:57:21 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, TW_BG, TW_CP X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Jan 2011 16:57:16 +0000 Received: by qwi2 with SMTP id 2so4316923qwi.20 for ; Sat, 29 Jan 2011 08:57:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.95.193 with SMTP id e1mr3962894qcn.171.1296320234357; Sat, 29 Jan 2011 08:57:14 -0800 (PST) Received: by 10.229.214.131 with HTTP; Sat, 29 Jan 2011 08:57:14 -0800 (PST) Date: Sat, 29 Jan 2011 17:57:14 +0100 Message-ID: Subject: [patch libgfortran]: Fix build of libgfortran for mingw and improve POSIX ctime_r implementation From: Kai Tietz To: GCC Patches Cc: Fortran , Janne Blomqvist X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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? 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