aboutsummaryrefslogtreecommitdiff
path: root/mapping/traits-pgsql.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-07-14 10:27:18 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-07-14 10:32:25 +0200
commitabd136caee7de39b6b6a5e38c48febc50a25dd1f (patch)
tree68af3df290df297b9365d30ce06585385db2ac37 /mapping/traits-pgsql.hxx
parentc4958231d9399091b4f4a7e4c45c24ce6beb3ae8 (diff)
Inline PostgreSQL traits implementation and remove cxx file
Diffstat (limited to 'mapping/traits-pgsql.hxx')
-rw-r--r--mapping/traits-pgsql.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/mapping/traits-pgsql.hxx b/mapping/traits-pgsql.hxx
index 6ee396d..92ce4c4 100644
--- a/mapping/traits-pgsql.hxx
+++ b/mapping/traits-pgsql.hxx
@@ -74,6 +74,9 @@ namespace odb
return;
}
+ tm pg_epoch_tm = {0, 0, 0, 1, 1, 100, 0, 0, 0, 0, 0};
+ time_t pg_epoch_tt (mktime (&pg_epoch_tm));
+
time_t v_tt (pg_epoch_tt +
static_cast<time_t> (details::endian_traits::ntoh (i)) *
seconds_per_day);
@@ -97,6 +100,9 @@ namespace odb
time_t v_tt (mktime (&v_tm));
+ tm pg_epoch_tm = {0, 0, 0, 1, 1, 100, 0, 0, 0, 0, 0};
+ time_t pg_epoch_tt (mktime (&pg_epoch_tm));
+
i = details::endian_traits::hton (
static_cast<int> ((v_tt - pg_epoch_tt) / seconds_per_day));
}