From 978524b9acebab8df6b788a6ed9ebfcfe0f12eec Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 15 Jul 2023 13:10:51 +0100 Subject: Work around MSVC not implementing uniform_int_distribution. --- src/helperfuncs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index f3a994007..4da2a4d3d 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -463,8 +463,8 @@ void InspIRCd::DefaultGenRandom(char* output, size_t max) #else static std::random_device device; static std::mt19937 engine(device()); - static std::uniform_int_distribution dist; + static std::uniform_int_distribution dist(CHAR_MIN, CHAR_MAX); for (size_t i = 0; i < max; ++i) - output[i] = dist(engine); + output[i] = static_cast(dist(engine)); #endif } -- cgit v1.3.1-10-gc9f91