From 696cd7975c5aa495c838e5ca4d8cc29193b44787 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 29 Dec 2015 02:32:47 -0500 Subject: [PATCH] NetBSD: fixed issues with cpuinfo and pthread_setname_np (thanks, Thomas!). Fixes Bugzilla #3176. --- src/cpuinfo/SDL_cpuinfo.c | 2 +- src/thread/pthread/SDL_systhread.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index ed839cccb5954..92652c66588d0 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -735,7 +735,7 @@ SDL_GetSystemRAM(void) #endif #ifdef HAVE_SYSCTLBYNAME if (SDL_SystemRAM <= 0) { -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) #ifdef HW_REALMEM int mib[2] = {CTL_HW, HW_REALMEM}; #else diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 14eee8deb3c16..a18fa9866a874 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -143,7 +143,11 @@ SDL_SYS_SetupThread(const char *name) #endif } #elif HAVE_PTHREAD_SETNAME_NP + #if defined(__NETBSD__) + pthread_setname_np(pthread_self(), "%s", name); + #else pthread_setname_np(pthread_self(), name); + #endif #elif HAVE_PTHREAD_SET_NAME_NP pthread_set_name_np(pthread_self(), name); #elif defined(__HAIKU__)