diff options
author | David CARLIER <devnexen@gmail.com> | 2020-08-25 19:50:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 20:50:41 +0200 |
commit | b262184acf34896f36b4270aba29546fc5b0e65b (patch) | |
tree | 701d5c80f5426f39f31aa8eb9483a5a8144afe63 | |
parent | 44c98089cf923fda924902bceec4edb01f36ce2c (diff) | |
download | minetest-b262184acf34896f36b4270aba29546fc5b0e65b.tar.gz minetest-b262184acf34896f36b4270aba29546fc5b0e65b.tar.bz2 minetest-b262184acf34896f36b4270aba29546fc5b0e65b.zip |
NetBSD build fix proposal. (#10308)
Fixing thread naming call and let the class setting RANDOM_MIN/RANDOM_MAX.
-rw-r--r-- | src/noise.h | 7 | ||||
-rw-r--r-- | src/threading/thread.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/noise.h b/src/noise.h index 7b5e83251..613879890 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 f678a09be..eb51516c6 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<char*>(name.c_str())); #elif defined(__APPLE__) |