SDL: cmake: fix detection of pthread_setname_np() on Apple platforms.

From f7f61af12bfa5c2c21d39730612c173fe2bdf6dd Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Mon, 13 Feb 2023 11:55:40 +0300
Subject: [PATCH] cmake: fix detection of pthread_setname_np() on Apple
 platforms.

---
 cmake/sdlchecks.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 137f54a62d7e..013deb368623 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -872,7 +872,11 @@ macro(CheckPTHREAD)
         check_c_source_compiles("
             #include <pthread.h>
             int main(int argc, char **argv) {
+              #ifdef __APPLE__
+              pthread_setname_np(pthread_self());
+              #else
               pthread_setname_np(pthread_self(), \"\");
+              #endif
               return 0;
             }" HAVE_PTHREAD_SETNAME_NP)
         if (HAVE_PTHREAD_NP_H)