From 0d96de11b21630b32ea20dd8b1b26377e077c469 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 20 Oct 2024 14:48:29 +0200 Subject: [PATCH] fix the stream operator of bitfield flags, to print hex --- include/libtorrent/flags.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/flags.hpp b/include/libtorrent/flags.hpp index 3ba35c93f4b..c19fcd72aaa 100644 --- a/include/libtorrent/flags.hpp +++ b/include/libtorrent/flags.hpp @@ -11,7 +11,11 @@ see LICENSE file. #define TORRENT_FLAGS_HPP_INCLUDED #include // for enable_if + +#if TORRENT_USE_IOSTREAM #include +#include +#endif namespace libtorrent { @@ -105,7 +109,7 @@ struct bitfield_flag #if TORRENT_USE_IOSTREAM friend std::ostream& operator<<(std::ostream& os, bitfield_flag val) - { return os << static_cast(val); } + { return os << std::hex << std::uint64_t(static_cast(val)); } #endif private: