From d9f372d7b1bc1abbff5fdf9735118290cd024d5e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 25 Jan 2024 17:28:38 +0300 Subject: Turn libodb-pgsql repository into package for muti-package repository --- libodb-pgsql/odb/pgsql/details/endian-traits.cxx | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libodb-pgsql/odb/pgsql/details/endian-traits.cxx (limited to 'libodb-pgsql/odb/pgsql/details/endian-traits.cxx') diff --git a/libodb-pgsql/odb/pgsql/details/endian-traits.cxx b/libodb-pgsql/odb/pgsql/details/endian-traits.cxx new file mode 100644 index 0000000..77fdc95 --- /dev/null +++ b/libodb-pgsql/odb/pgsql/details/endian-traits.cxx @@ -0,0 +1,30 @@ +// file : odb/pgsql/details/endian-traits.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +namespace odb +{ + namespace pgsql + { + namespace details + { + namespace + { + endian_traits::endian + infer_host_endian () + { + short s (1); + char* c (reinterpret_cast (&s)); + + return *c == 0 ? + endian_traits::big : + endian_traits::little; + } + } + + const endian_traits::endian endian_traits::host_endian ( + infer_host_endian ()); + } + } +} -- cgit v1.1