--- Source/Lib/Codec/svt_threads.c.orig	2022-12-10 06:30:47.000000000 +0800
+++ Source/Lib/Codec/svt_threads.c	2023-04-01 21:29:58.000000000 +0800
@@ -45,8 +45,11 @@
 #include <unistd.h>
 #endif // _WIN32
 #ifdef __APPLE__
+#include <AvailabilityMacros.h>
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && !defined(__ppc__)
 #include <dispatch/dispatch.h>
 #endif
+#endif
 #if PRINTF_TIME
 #include <time.h>
 #ifdef _WIN32
@@ -207,7 +210,7 @@
                                                  initial_count, // initial semaphore count
                                                  max_count, // maximum semaphore count
                                                  NULL); // semaphore is not named
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && !defined(__ppc__)
     UNUSED(max_count);
     semaphore_handle = (EbHandle)dispatch_semaphore_create(initial_count);
 #else
@@ -235,7 +238,7 @@
                                      NULL) // pointer to previous count (optional)
         ? EB_ErrorSemaphoreUnresponsive
         : EB_ErrorNone;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && !defined(__ppc__)
     dispatch_semaphore_signal((dispatch_semaphore_t)semaphore_handle);
     return_error = EB_ErrorNone;
 #else
@@ -254,7 +257,7 @@
 #ifdef _WIN32
     return_error = WaitForSingleObject((HANDLE)semaphore_handle, INFINITE) ? EB_ErrorSemaphoreUnresponsive
                                                                            : EB_ErrorNone;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && !defined(__ppc__)
     return_error = dispatch_semaphore_wait((dispatch_semaphore_t)semaphore_handle, DISPATCH_TIME_FOREVER)
         ? EB_ErrorSemaphoreUnresponsive
         : EB_ErrorNone;
@@ -275,7 +278,7 @@
 
 #ifdef _WIN32
     return_error = !CloseHandle((HANDLE)semaphore_handle) ? EB_ErrorDestroySemaphoreFailed : EB_ErrorNone;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 && !defined(__ppc__)
     dispatch_release((dispatch_semaphore_t)semaphore_handle);
     return_error = EB_ErrorNone;
 #else
