From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 7E01E383F84B; Mon, 4 May 2020 09:21:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E01E383F84B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] localtime 1.80 X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: a40701c7dc9970457a19728e371c71e7501057e7 X-Git-Newrev: 9e29639ca01208a4a8bac5b9d0f6491b34b1017e Message-Id: <20200504092101.7E01E383F84B@sourceware.org> Date: Mon, 4 May 2020 09:21:01 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2020 09:21:01 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9e29639ca01208a4a8bac5b9d0f6491b34b1017e commit 9e29639ca01208a4a8bac5b9d0f6491b34b1017e Author: Corinna Vinschen Date: Tue Apr 28 21:21:14 2020 +0200 localtime 1.80 Diff: --- winsup/cygwin/localtime.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/localtime.cc b/winsup/cygwin/localtime.cc index 88290c663..b0a1a4f2d 100644 --- a/winsup/cygwin/localtime.cc +++ b/winsup/cygwin/localtime.cc @@ -1,4 +1,4 @@ -/* $NetBSD: localtime.c,v 1.79 2013/12/13 10:34:47 christos Exp $ */ +/* $NetBSD: localtime.c,v 1.80 2013/12/13 10:37:24 christos Exp $ */ /* ** This file is in the public domain, so clarified as of @@ -74,8 +74,6 @@ static char privatehid[] = "@(#)private.h 7.48"; #if 0 #include #endif -#define time_t_min LONG_MIN -#define time_t_max LONG_MAX /* Unlike 's isdigit, this also works if c < 0 | c > UCHAR_MAX. */ #define is_digit(c) ((unsigned)(c) - '0' <= 9) @@ -90,7 +88,7 @@ static char privatehid[] = "@(#)private.h 7.48"; #if 0 static char elsieid[] = "@(#)localtime.cc 8.17"; #else -__RCSID("$NetBSD: localtime.c,v 1.79 2013/12/13 10:34:47 christos Exp $"); +__RCSID("$NetBSD: localtime.c,v 1.80 2013/12/13 10:37:24 christos Exp $"); #endif /* @@ -361,6 +359,16 @@ struct tzhead { # define TM_ZONE __TM_ZONE #endif +/* The minimum and maximum finite time values. */ +static time_t const time_t_min = + (TYPE_SIGNED(time_t) + ? (time_t) -1 << (int)(CHAR_BIT * sizeof (time_t) - 1) + : 0); +static time_t const time_t_max = + (TYPE_SIGNED(time_t) + ? - (~ 0 < 0) - ((time_t) -1 << (int)(CHAR_BIT * sizeof (time_t) - 1)) + : -1); + /* ** SunOS 4.1.1 headers lack O_BINARY. */