1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add last-ditch defense against attempts to compile datetime code with

-ffast-math.
This commit is contained in:
Tom Lane
2002-09-21 19:52:41 +00:00
parent eb3adab568
commit e303a2dbe8
2 changed files with 27 additions and 11 deletions

View File

@ -1,14 +1,14 @@
/*-------------------------------------------------------------------------
*
* timestamp.c
* Functions for the built-in SQL92 type "timestamp" and "interval".
* Functions for the built-in SQL92 types "timestamp" and "interval".
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.73 2002/09/04 20:31:29 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.74 2002/09/21 19:52:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -28,6 +28,14 @@
#include "utils/array.h"
#include "utils/builtins.h"
/*
* gcc's -ffast-math switch breaks routines that expect exact results from
* expressions like timeval / 3600, where timeval is double.
*/
#ifdef __FAST_MATH__
#error -ffast-math is known to break this code
#endif
#ifdef HAVE_INT64_TIMESTAMP
static int64 time2t(const int hour, const int min, const int sec, const fsec_t fsec);