diff --git a/desmume/src/frontend/cocoa/cocoa_GPU.mm b/desmume/src/frontend/cocoa/cocoa_GPU.mm index e9294df27..e8f32d433 100644 --- a/desmume/src/frontend/cocoa/cocoa_GPU.mm +++ b/desmume/src/frontend/cocoa/cocoa_GPU.mm @@ -1769,10 +1769,12 @@ CGLPBufferObj OSXOpenGLRendererPBuffer = NULL; static void* RunFetchThread(void *arg) { +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) { pthread_setname_np("Video Fetch"); } +#endif MacClientSharedObject *sharedData = (MacClientSharedObject *)arg; [sharedData runFetchLoop]; diff --git a/desmume/src/frontend/cocoa/cocoa_core.mm b/desmume/src/frontend/cocoa/cocoa_core.mm index 8522f5a45..b447c83bc 100644 --- a/desmume/src/frontend/cocoa/cocoa_core.mm +++ b/desmume/src/frontend/cocoa/cocoa_core.mm @@ -1142,10 +1142,12 @@ volatile bool execute = true; static void* RunCoreThread(void *arg) { +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) { pthread_setname_np("Emulation Core"); } +#endif CoreThreadParam *param = (CoreThreadParam *)arg; CocoaDSCore *cdsCore = (CocoaDSCore *)param->cdsCore; diff --git a/desmume/src/frontend/cocoa/cocoa_output.mm b/desmume/src/frontend/cocoa/cocoa_output.mm index e90ef8bfd..48c2d6672 100644 --- a/desmume/src/frontend/cocoa/cocoa_output.mm +++ b/desmume/src/frontend/cocoa/cocoa_output.mm @@ -1314,10 +1314,12 @@ static void* RunOutputThread(void *arg) { +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) { pthread_setname_np("EmulationOutput"); } +#endif CocoaDSOutput *cdsDisplayOutput = (CocoaDSOutput *)arg; [cdsDisplayOutput runMessageLoop]; diff --git a/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm b/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm index 7a9890010..553dab534 100644 --- a/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm +++ b/desmume/src/frontend/cocoa/userinterface/MacAVCaptureTool.mm @@ -1463,10 +1463,12 @@ ClientAVCaptureError FFmpegFileStream::WriteOneFrame(const AVStreamWriteParam &p static void* RunAVCaptureCloseThread(void *arg) { +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) { pthread_setname_np("AVCapture Close"); } +#endif /* ClientAVCaptureObject *captureObject = (ClientAVCaptureObject *)arg; diff --git a/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm b/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm index 20b5a4bc1..98adfa491 100644 --- a/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm +++ b/desmume/src/frontend/cocoa/userinterface/MacScreenshotCaptureTool.mm @@ -131,10 +131,12 @@ static void* RunFileWriteThread(void *arg) { +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) { pthread_setname_np("Mac File Write"); } +#endif // Copy the rendering properties from the calling thread. MacCaptureToolParams *inParams = (MacCaptureToolParams *)arg; diff --git a/desmume/src/frontend/cocoa/userinterface/appDelegate.mm b/desmume/src/frontend/cocoa/userinterface/appDelegate.mm index 6b18041ff..2f5e8e7d4 100644 --- a/desmume/src/frontend/cocoa/userinterface/appDelegate.mm +++ b/desmume/src/frontend/cocoa/userinterface/appDelegate.mm @@ -241,10 +241,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { +#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) { pthread_setname_np("App Main Thread"); } +#endif EmuControllerDelegate *emuControl = (EmuControllerDelegate *)[emuControlController content]; diff --git a/desmume/src/utils/task.cpp b/desmume/src/utils/task.cpp index d1e898cd2..d8dde9832 100644 --- a/desmume/src/utils/task.cpp +++ b/desmume/src/utils/task.cpp @@ -133,7 +133,7 @@ void Task::Impl::start(bool spinlock, int threadPriority, const char *name) sthread_setname(this->_thread, name); #else -#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) +#if defined(DESMUME_COCOA) && defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) // Setting the thread name on macOS uses pthread_setname_np(), but this requires macOS v10.6 or later. this->needSetThreadName = (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_6) && (name != NULL); #else