@@ -212,42 +212,29 @@ void ffInitInstance(FFinstance* instance)
212212 defaultConfig (instance );
213213}
214214
215- #ifdef FF_HAVE_THREADS
216-
217- FF_THREAD_ENTRY_DECL_WRAPPER (ffConnectDisplayServer , FFinstance * )
218-
219- #if !(defined (__APPLE__ ) || defined (_WIN32 ))
215+ #if defined(FF_HAVE_THREADS ) && !(defined(__APPLE__ ) || defined(_WIN32 ) || defined(__ANDROID__ ))
220216
221217#include "detection/gtk_qt/gtk_qt.h"
222218
223- #define FF_DETECT_QT_GTK 1
219+ #define FF_START_DETECTION_THREADS
224220
221+ FF_THREAD_ENTRY_DECL_WRAPPER (ffConnectDisplayServer , FFinstance * )
225222FF_THREAD_ENTRY_DECL_WRAPPER (ffDetectQt , FFinstance * )
226223FF_THREAD_ENTRY_DECL_WRAPPER (ffDetectGTK2 , FFinstance * )
227224FF_THREAD_ENTRY_DECL_WRAPPER (ffDetectGTK3 , FFinstance * )
228225FF_THREAD_ENTRY_DECL_WRAPPER (ffDetectGTK4 , FFinstance * )
229226
230- #endif //!(defined(__APPLE__) || defined(_WIN32))
231-
232- #endif //FF_HAVE_THREADS
233-
234227void startDetectionThreads (FFinstance * instance )
235228{
236- #ifdef FF_HAVE_THREADS
237229 ffThreadDetach (ffThreadCreate (ffConnectDisplayServerThreadMain , instance ));
238-
239- #ifdef FF_DETECT_QT_GTK
240230 ffThreadDetach (ffThreadCreate (ffDetectQtThreadMain , instance ));
241231 ffThreadDetach (ffThreadCreate (ffDetectGTK2ThreadMain , instance ));
242232 ffThreadDetach (ffThreadCreate (ffDetectGTK3ThreadMain , instance ));
243233 ffThreadDetach (ffThreadCreate (ffDetectGTK4ThreadMain , instance ));
244- #endif
245-
246- #else
247- FF_UNUSED (instance );
248- #endif
249234}
250235
236+ #endif //FF_HAVE_THREADS
237+
251238static volatile bool ffDisableLinewrap = true;
252239static volatile bool ffHideCursor = true;
253240
@@ -268,7 +255,7 @@ static void resetConsole()
268255BOOL WINAPI consoleHandler (DWORD signal )
269256{
270257 FF_UNUSED (signal );
271- resetConsole ();
258+ resetConsole ();
272259 exit (0 );
273260}
274261#else
@@ -282,8 +269,10 @@ static void exitSignalHandler(int signal)
282269
283270void ffStart (FFinstance * instance )
284271{
285- if (instance -> config .multithreading )
286- startDetectionThreads (instance );
272+ #ifdef FF_START_DETECTION_THREADS
273+ if (instance -> config .multithreading )
274+ startDetectionThreads (instance );
275+ #endif
287276
288277 ffDisableLinewrap = instance -> config .disableLinewrap && !instance -> config .pipe ;
289278 ffHideCursor = instance -> config .hideCursor && !instance -> config .pipe ;
0 commit comments