From 6aa9e4ae7da1fb9b21896e44f31b549ce2dc64ee Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Mon, 17 Feb 2020 21:27:09 +0800 Subject: [PATCH] cleanup and declare __mg_idle_handler_with_fds --- src/include/internals.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/include/internals.h b/src/include/internals.h index f483194a..b01eebd5 100644 --- a/src/include/internals.h +++ b/src/include/internals.h @@ -217,7 +217,7 @@ struct _MSGQUEUE PSYNCMSG pLastSyncMsg; // tail of the sync message queue #endif - IDLEHANDLER OnIdle; // XXX: idle handler + IDLEHANDLER OnIdle; // idle handler for this message queue. PMAINWIN pRootMainWin; // the root main window of this message queue. int nrWindows; // the number of main/virtual windows. @@ -291,22 +291,17 @@ static inline BOOL QueueDeskMessage (PMSG msg) } #ifndef _MGRM_THREADS -static inline BOOL InitDskMsgQueue (void) -{ - return mg_InitMsgQueue (__mg_dsk_msg_queue, 0); -} - -static inline void DestroyDskMsgQueue (void) -{ - mg_DestroyMsgQueue (__mg_dsk_msg_queue); -} - static inline void SetDskIdleHandler (IDLEHANDLER idle_handler) { __mg_dsk_msg_queue->OnIdle = idle_handler; } #endif /* not defined _MGRM_THREADS */ +/* Since 4.2.0 */ +#ifdef _HAVE_SELECT +BOOL __mg_idle_handler_with_fds (MSGQUEUE* msg_queue, BOOL wait); +#endif + #ifdef _MGHAVE_VIRTUAL_WINDOW #define MG_MUTEX_INIT(lock) pthread_mutex_init(lock, NULL)