|
24 | 24 | #include <sys/utsname.h> |
25 | 25 |
|
26 | 26 | #include <mach/mach.h> |
| 27 | +#ifdef HAVE_GCD |
27 | 28 | #include <dispatch/dispatch.h> |
| 29 | +#endif |
28 | 30 |
|
29 | 31 | #include <CoreFoundation/CoreFoundation.h> |
30 | 32 | #include <CoreFoundation/CFArray.h> |
|
127 | 129 |
|
128 | 130 | static char darwin_cpu_model_name[64] = {0}; |
129 | 131 |
|
| 132 | +#ifdef HAVE_GCD |
130 | 133 | /* Directory watching implementation using GCD dispatch sources */ |
131 | 134 | typedef struct darwin_watch_entry |
132 | 135 | { |
|
143 | 146 | volatile int32_t has_changes; /* Atomic flag indicating changes occurred */ |
144 | 147 | int flags; /* Event flags to monitor */ |
145 | 148 | } darwin_watch_data_t; |
| 149 | +#endif |
146 | 150 |
|
147 | 151 | static void CFSearchPathForDirectoriesInDomains( |
148 | 152 | char *s, size_t len) |
@@ -853,6 +857,7 @@ static bool accessibility_speak_macos(int speed, |
853 | 857 |
|
854 | 858 | #endif |
855 | 859 |
|
| 860 | +#ifdef HAVE_GCD |
856 | 861 | static void frontend_darwin_watch_path_for_changes( |
857 | 862 | struct string_list *list, int flags, |
858 | 863 | path_change_data_t **change_data) |
@@ -1002,6 +1007,7 @@ static bool frontend_darwin_check_for_path_changes( |
1002 | 1007 | /* Atomically read and clear the flag */ |
1003 | 1008 | return OSAtomicCompareAndSwap32(1, 0, &watch_data->has_changes); |
1004 | 1009 | } |
| 1010 | +#endif |
1005 | 1011 |
|
1006 | 1012 | static bool frontend_darwin_is_narrator_running(void) |
1007 | 1013 | { |
@@ -1093,8 +1099,13 @@ static enum rarch_display_type frontend_darwin_get_display_type(void) |
1093 | 1099 | NULL, /* detach_console */ |
1094 | 1100 | NULL, /* get_lakka_version */ |
1095 | 1101 | NULL, /* set_screen_brightness */ |
| 1102 | +#ifdef HAVE_GCD |
1096 | 1103 | frontend_darwin_watch_path_for_changes, /* watch_path_for_changes */ |
1097 | 1104 | frontend_darwin_check_for_path_changes, /* check_for_path_changes */ |
| 1105 | +#else |
| 1106 | + NULL, /* watch_path_for_changes */ |
| 1107 | + NULL, /* check_for_path_changes */ |
| 1108 | +#endif |
1098 | 1109 | NULL, /* set_sustained_performance_mode */ |
1099 | 1110 | frontend_darwin_get_cpu_model_name, /* get_cpu_model_name */ |
1100 | 1111 | frontend_darwin_get_user_language, /* get_user_language */ |
|
0 commit comments