]> git.lizzy.rs Git - minetest.git/commitdiff
NetBSD build fix proposal. (#10308)
authorDavid CARLIER <devnexen@gmail.com>
Tue, 25 Aug 2020 18:50:41 +0000 (19:50 +0100)
committerGitHub <noreply@github.com>
Tue, 25 Aug 2020 18:50:41 +0000 (20:50 +0200)
Fixing thread naming call and let the class setting RANDOM_MIN/RANDOM_MAX.

src/noise.h
src/threading/thread.cpp

index 7b5e83251883a90d1fb5f83a66b5225a3df096d9..6138798907533f41b1209dcbd797e91f0d8256ad 100644 (file)
 #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
index f678a09be8e769a818fdcb681b391542daf7cb10..eb51516c628a335cf1b2ab44f81d331b8a37d0df 100644 (file)
@@ -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__)