Commit c6fc8052 authored by Martin Marinov's avatar Martin Marinov
Browse files

Fix portability for format_hex()

parent cb9cfb27
......@@ -6,7 +6,7 @@
#include <string>
#include <vector>
#include <stdint.h>
#include <inttypes.h>
#include <limits.h>
// Find out if we need separate streaming operators for uint and size_t
#if ((UINT_MAX) != (SIZE_MAX))
......@@ -242,14 +242,14 @@ inline FormatT<> format_hex(const T _vrbl)
template <>
inline FormatT<> format_hex(const uint32_t _vrbl)
return FormatT<>("%x", _vrbl);
return FormatT<>("%" PRIx32, _vrbl);
//! Format a 64bit size_t variable for streaming in hex (e.g. for hash)
template <>
inline FormatT<> format_hex(const uint64_t _vrbl)
return FormatT<>("%I64x", _vrbl);
return FormatT<>("%" PRIx64, _vrbl);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment