NetBSD: fixed issues with cpuinfo and pthread_setname_np (thanks, Thomas!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 29 Dec 2015 02:32:47 -0500
changeset 9987d64783aac765
parent 9986 081fbd89a347
child 9988 08d023f75d78
NetBSD: fixed issues with cpuinfo and pthread_setname_np (thanks, Thomas!).

Fixes Bugzilla #3176.
src/cpuinfo/SDL_cpuinfo.c
src/thread/pthread/SDL_systhread.c
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Tue Dec 29 02:29:56 2015 -0500
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Tue Dec 29 02:32:47 2015 -0500
     1.3 @@ -735,7 +735,7 @@
     1.4  #endif
     1.5  #ifdef HAVE_SYSCTLBYNAME
     1.6          if (SDL_SystemRAM <= 0) {
     1.7 -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
     1.8 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
     1.9  #ifdef HW_REALMEM
    1.10              int mib[2] = {CTL_HW, HW_REALMEM};
    1.11  #else
     2.1 --- a/src/thread/pthread/SDL_systhread.c	Tue Dec 29 02:29:56 2015 -0500
     2.2 +++ b/src/thread/pthread/SDL_systhread.c	Tue Dec 29 02:32:47 2015 -0500
     2.3 @@ -143,7 +143,11 @@
     2.4              #endif
     2.5          }
     2.6          #elif HAVE_PTHREAD_SETNAME_NP
     2.7 +            #if defined(__NETBSD__)
     2.8 +            pthread_setname_np(pthread_self(), "%s", name);
     2.9 +            #else
    2.10              pthread_setname_np(pthread_self(), name);
    2.11 +            #endif
    2.12          #elif HAVE_PTHREAD_SET_NAME_NP
    2.13              pthread_set_name_np(pthread_self(), name);
    2.14          #elif defined(__HAIKU__)