From b262184acf34896f36b4270aba29546fc5b0e65b Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Tue, 25 Aug 2020 19:50:41 +0100 Subject: [PATCH] NetBSD build fix proposal. (#10308) Fixing thread naming call and let the class setting RANDOM_MIN/RANDOM_MAX. --- src/noise.h | 7 +++++++ src/threading/thread.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/noise.h b/src/noise.h index 7b5e83251883..613879890753 100644 --- a/src/noise.h +++ b/src/noise.h @@ -29,6 +29,13 @@ #include "exceptions.h" #include "util/string.h" +#if defined(RANDOM_MIN) +#undef RANDOM_MIN +#endif +#if defined(RANDOM_MAX) +#undef RANDOM_MAX +#endif + extern FlagDesc flagdesc_noiseparams[]; // Note: this class is not polymorphic so that its high level of diff --git a/src/threading/thread.cpp b/src/threading/thread.cpp index f678a09be8e7..eb51516c628a 100644 --- a/src/threading/thread.cpp +++ b/src/threading/thread.cpp @@ -219,7 +219,7 @@ void Thread::setName(const std::string &name) #elif defined(__NetBSD__) - pthread_setname_np(pthread_self(), name.c_str()); + pthread_setname_np(pthread_self(), "%s", const_cast(name.c_str())); #elif defined(__APPLE__)