Skip to content

Commit b262184

Browse files
authoredAug 25, 2020
NetBSD build fix proposal. (#10308)
Fixing thread naming call and let the class setting RANDOM_MIN/RANDOM_MAX.
1 parent 44c9808 commit b262184

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

Diff for: ‎src/noise.h

+7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
#include "exceptions.h"
3030
#include "util/string.h"
3131

32+
#if defined(RANDOM_MIN)
33+
#undef RANDOM_MIN
34+
#endif
35+
#if defined(RANDOM_MAX)
36+
#undef RANDOM_MAX
37+
#endif
38+
3239
extern FlagDesc flagdesc_noiseparams[];
3340

3441
// Note: this class is not polymorphic so that its high level of

Diff for: ‎src/threading/thread.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void Thread::setName(const std::string &name)
219219

220220
#elif defined(__NetBSD__)
221221

222-
pthread_setname_np(pthread_self(), name.c_str());
222+
pthread_setname_np(pthread_self(), "%s", const_cast<char*>(name.c_str()));
223223

224224
#elif defined(__APPLE__)
225225

0 commit comments

Comments
 (0)
Please sign in to comment.