From f6384b9361f1a3da60b52e84a062ec5b46fbc8bd Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 6 Jan 2008 12:45:03 +0000 Subject: [PATCH] * disable range/overflow checking when calculating with Nan git-svn-id: trunk@9649 - --- rtl/objpas/dateutil.inc | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/rtl/objpas/dateutil.inc b/rtl/objpas/dateutil.inc index d935774963..f5457a7fa5 100644 --- a/rtl/objpas/dateutil.inc +++ b/rtl/objpas/dateutil.inc @@ -1976,7 +1976,16 @@ end; Julian and Modified Julian Date conversion support ---------------------------------------------------------------------} -{$warnings off} +{$ifopt R+} +{$define RangeCheckWasOn} +{$R-} +{$endif opt R+} + +{$ifopt Q+} +{$define OverflowCheckWasOn} +{$Q-} +{$endif opt Q+} + Function DateTimeToJulianDate(const AValue: TDateTime): Double; begin DateTimeToJulianDate := AValue - JulianEpoch; @@ -2015,7 +2024,16 @@ Function TryModifiedJulianDateToDateTime(const AValue: Double; var ADateTime: TD begin NotYetImplemented('TryModifiedJulianDateToDateTime'); end; -{$warnings on} + +{$ifdef RangeCheckWasOn} +{$R+} +{$undef RangeCheckWasOn} +{$endif} + +{$ifdef OverflowCheckWasOn} +{$Q+} +{$undef OverflowCheckWasOn} +{$endif} { --------------------------------------------------------------------- Unix timestamp support. @@ -2064,7 +2082,7 @@ end; Function MacTimeStampToUnix(const AValue: Int64): Int64; const - Epoch=24107 * 24 * 3600; + Epoch=24107 * 24 * 3600; begin Result:=AValue - Epoch; end;