From abd136caee7de39b6b6a5e38c48febc50a25dd1f Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 10:27:18 +0200 Subject: Inline PostgreSQL traits implementation and remove cxx file --- mapping/traits-pgsql.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mapping/traits-pgsql.hxx') 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 (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 ((v_tt - pg_epoch_tt) / seconds_per_day)); } -- cgit v1.1