diff --git a/include/incredis/arg_to_bin_safe.hpp b/include/incredis/arg_to_bin_safe.hpp index 5981e1d..9eb2d59 100644 --- a/include/incredis/arg_to_bin_safe.hpp +++ b/include/incredis/arg_to_bin_safe.hpp @@ -19,6 +19,7 @@ #define id9348909738B047B7B6912D73CB519039 #include "duckhandy/compatibility.h" +#include "duckhandy/endianness.hpp" #include #include #include @@ -76,6 +77,15 @@ namespace redis { boost::string_view m_data; }; + template<> + struct MakeCharInfo { + MakeCharInfo (RedisInt parValue) : m_value(dhandy::htobe(parValue)) {} + const char* data() const { return reinterpret_cast(&m_value); } + std::size_t size() const { return sizeof(RedisInt); } + private: + RedisInt m_value; + }; + template inline const char* arg_to_bin_safe_char (const T& parArg) { return MakeCharInfo(parArg).data(); diff --git a/lib/duckhandy b/lib/duckhandy index 7bcdb10..3276bc6 160000 --- a/lib/duckhandy +++ b/lib/duckhandy @@ -1 +1 @@ -Subproject commit 7bcdb10d19d02d11ed22ec00bbea43198ec756e8 +Subproject commit 3276bc64f4afbf3dee1256654700b763e89bcd98