Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
e303a2db
Commit
e303a2db
authored
Sep 21, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add last-ditch defense against attempts to compile datetime code with
-ffast-math.
parent
eb3adab5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+17
-9
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/timestamp.c
+10
-2
No files found.
src/backend/utils/adt/date.c
View file @
e303a2db
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.7
2 2002/09/04 20:31:27 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.7
3 2002/09/21 19:52:41 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -27,11 +27,19 @@
...
@@ -27,11 +27,19 @@
#include "utils/nabstime.h"
#include "utils/nabstime.h"
#include "utils/timestamp.h"
#include "utils/timestamp.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
int
time2tm
(
TimeADT
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
);
static
int
time2tm
(
TimeADT
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
);
int
timetz2tm
(
TimeTzADT
*
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
,
int
*
tzp
);
static
int
timetz2tm
(
TimeTzADT
*
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
,
int
*
tzp
);
int
tm2time
(
struct
tm
*
tm
,
fsec_t
fsec
,
TimeADT
*
result
);
static
int
tm2time
(
struct
tm
*
tm
,
fsec_t
fsec
,
TimeADT
*
result
);
int
tm2timetz
(
struct
tm
*
tm
,
fsec_t
fsec
,
int
tz
,
TimeTzADT
*
result
);
static
int
tm2timetz
(
struct
tm
*
tm
,
fsec_t
fsec
,
int
tz
,
TimeTzADT
*
result
);
static
void
AdjustTimeForTypmod
(
TimeADT
*
time
,
int32
typmod
);
static
void
AdjustTimeForTypmod
(
TimeADT
*
time
,
int32
typmod
);
/*****************************************************************************
/*****************************************************************************
...
@@ -525,7 +533,7 @@ time_in(PG_FUNCTION_ARGS)
...
@@ -525,7 +533,7 @@ time_in(PG_FUNCTION_ARGS)
/* tm2time()
/* tm2time()
* Convert a tm structure to a time data type.
* Convert a tm structure to a time data type.
*/
*/
int
static
int
tm2time
(
struct
tm
*
tm
,
fsec_t
fsec
,
TimeADT
*
result
)
tm2time
(
struct
tm
*
tm
,
fsec_t
fsec
,
TimeADT
*
result
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
...
@@ -542,7 +550,7 @@ tm2time(struct tm * tm, fsec_t fsec, TimeADT *result)
...
@@ -542,7 +550,7 @@ tm2time(struct tm * tm, fsec_t fsec, TimeADT *result)
* For dates within the system-supported time_t range, convert to the
* For dates within the system-supported time_t range, convert to the
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
*/
*/
int
static
int
time2tm
(
TimeADT
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
)
time2tm
(
TimeADT
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
...
@@ -1285,7 +1293,7 @@ time_part(PG_FUNCTION_ARGS)
...
@@ -1285,7 +1293,7 @@ time_part(PG_FUNCTION_ARGS)
/* tm2timetz()
/* tm2timetz()
* Convert a tm structure to a time data type.
* Convert a tm structure to a time data type.
*/
*/
int
static
int
tm2timetz
(
struct
tm
*
tm
,
fsec_t
fsec
,
int
tz
,
TimeTzADT
*
result
)
tm2timetz
(
struct
tm
*
tm
,
fsec_t
fsec
,
int
tz
,
TimeTzADT
*
result
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
...
@@ -1357,7 +1365,7 @@ timetz_out(PG_FUNCTION_ARGS)
...
@@ -1357,7 +1365,7 @@ timetz_out(PG_FUNCTION_ARGS)
* For dates within the system-supported time_t range, convert to the
* For dates within the system-supported time_t range, convert to the
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
*/
*/
int
static
int
timetz2tm
(
TimeTzADT
*
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
,
int
*
tzp
)
timetz2tm
(
TimeTzADT
*
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
,
int
*
tzp
)
{
{
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
...
...
src/backend/utils/adt/timestamp.c
View file @
e303a2db
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
*
*
* timestamp.c
* timestamp.c
* Functions for the built-in SQL92 type "timestamp" and "interval".
* Functions for the built-in SQL92 type
s
"timestamp" and "interval".
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.7
3 2002/09/04 20:31:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.7
4 2002/09/21 19:52:41 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -28,6 +28,14 @@
...
@@ -28,6 +28,14 @@
#include "utils/array.h"
#include "utils/array.h"
#include "utils/builtins.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
#ifdef HAVE_INT64_TIMESTAMP
static
int64
time2t
(
const
int
hour
,
const
int
min
,
const
int
sec
,
const
fsec_t
fsec
);
static
int64
time2t
(
const
int
hour
,
const
int
min
,
const
int
sec
,
const
fsec_t
fsec
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment