summaryrefslogtreecommitdiff
path: root/platform/server
diff options
context:
space:
mode:
Diffstat (limited to 'platform/server')
-rw-r--r--platform/server/godot_server.cpp3
-rw-r--r--platform/server/platform_config.h13
2 files changed, 14 insertions, 2 deletions
diff --git a/platform/server/godot_server.cpp b/platform/server/godot_server.cpp
index 32bd943ac3..9f22240a80 100644
--- a/platform/server/godot_server.cpp
+++ b/platform/server/godot_server.cpp
@@ -34,6 +34,9 @@
int main(int argc, char *argv[]) {
OS_Server os;
+ // We must override main when testing is enabled
+ TEST_MAIN_OVERRIDE
+
Error err = Main::setup(argv[0], argc - 1, &argv[1]);
if (err != OK)
return 255;
diff --git a/platform/server/platform_config.h b/platform/server/platform_config.h
index bdff93f02b..73136ec81b 100644
--- a/platform/server/platform_config.h
+++ b/platform/server/platform_config.h
@@ -31,10 +31,19 @@
#if defined(__linux__) || defined(__APPLE__)
#include <alloca.h>
#endif
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
-#include <stdlib.h>
+
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#include <stdlib.h> // alloca
+// FreeBSD and OpenBSD use pthread_set_name_np, while other platforms,
+// include NetBSD, use pthread_setname_np. NetBSD's version however requires
+// a different format, we handle this directly in thread_posix.
+#ifdef __NetBSD__
+#define PTHREAD_NETBSD_SET_NAME
+#else
#define PTHREAD_BSD_SET_NAME
#endif
+#endif
+
#ifdef __APPLE__
#define PTHREAD_RENAME_SELF
#endif